org.fest.swing.driver
Class JLabelDriver

java.lang.Object
  extended by org.fest.swing.driver.ComponentDriver
      extended by org.fest.swing.driver.ContainerDriver
          extended by org.fest.swing.driver.JComponentDriver
              extended by org.fest.swing.driver.JLabelDriver
All Implemented Interfaces:
TextDisplayDriver<JLabel>

public class JLabelDriver
extends JComponentDriver
implements TextDisplayDriver<JLabel>

Understands functional testing of JLabels:

This class is intended for internal use only. Please use the classes in the package org.fest.swing.fixture in your tests.

Author:
Alex Ruiz

Field Summary
 
Fields inherited from class org.fest.swing.driver.ComponentDriver
robot
 
Constructor Summary
JLabelDriver(Robot robot)
          Creates a new JLabelDriver.
 
Method Summary
 void requireText(JLabel label, Pattern pattern)
          Asserts that the text of the JLabel matches the given regular expression pattern.
 void requireText(JLabel label, String expected)
          Asserts that the text of the JLabel is equal to the specified String.
 String textOf(JLabel label)
          Returns the text of the given JLabel.
 
Methods inherited from class org.fest.swing.driver.JComponentDriver
clientProperty, invokeAction, isVisible, isVisible, requireToolTip, requireToolTip, scrollToVisible
 
Methods inherited from class org.fest.swing.driver.ContainerDriver
move, resize, resizeHeight, resizeWidth
 
Methods inherited from class org.fest.swing.driver.ComponentDriver
assertIsEnabledAndShowing, click, click, click, click, click, doubleClick, drag, dragOver, drop, focus, focusAndWaitForFocusGain, invokePopupMenu, invokePopupMenu, moveMouseIgnoringAnyError, moveMouseIgnoringAnyError, performAccessibleActionOf, pressAndReleaseKey, pressAndReleaseKey, pressAndReleaseKeys, pressKey, propertyName, releaseKey, requireDisabled, requireEnabled, requireEnabled, requireFocused, requireNotVisible, requireSize, requireVisible, rightClick, settings, waitForShowing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JLabelDriver

public JLabelDriver(Robot robot)
Creates a new JLabelDriver.

Parameters:
robot - the robot to use to simulate user input.
Method Detail

requireText

@RunsInEDT
public void requireText(JLabel label,
                                  String expected)
Asserts that the text of the JLabel is equal to the specified String.

Specified by:
requireText in interface TextDisplayDriver<JLabel>
Parameters:
label - the target JLabel.
expected - the text to match.
Throws:
AssertionError - if the text of the JLabel is not equal to the given one.

requireText

@RunsInEDT
public void requireText(JLabel label,
                                  Pattern pattern)
Asserts that the text of the JLabel matches the given regular expression pattern.

Specified by:
requireText in interface TextDisplayDriver<JLabel>
Parameters:
label - the target JLabel.
pattern - the regular expression pattern to match.
Throws:
AssertionError - if the text of the JLabel does not match the given regular expression pattern.
NullPointerException - if the given regular expression pattern is null.
Since:
1.2

textOf

@RunsInEDT
public String textOf(JLabel label)
Returns the text of the given JLabel.

Specified by:
textOf in interface TextDisplayDriver<JLabel>
Parameters:
label - the given JLabel.
Returns:
the text of the given JLabel.


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.