org.fest.swing.driver
Class JProgressBarDriver

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.JProgressBarDriver
All Implemented Interfaces:
TextDisplayDriver<JProgressBar>

public class JProgressBarDriver
extends JComponentDriver
implements TextDisplayDriver<JProgressBar>

Understands functional testing of JProgressBars:

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

Since:
1.2
Author:
Alex Ruiz

Field Summary
 
Fields inherited from class org.fest.swing.driver.ComponentDriver
robot
 
Constructor Summary
JProgressBarDriver(Robot robot)
          Creates a new JProgressBarDriver.
 
Method Summary
 void requireDeterminate(JProgressBar progressBar)
          Verifies that the given JProgressBar is in determinate mode.
 void requireIndeterminate(JProgressBar progressBar)
          Verifies that the given JProgressBar is in indeterminate mode.
 void requireText(JProgressBar progressBar, Pattern pattern)
          Asserts that the text of the JProgressBar matches the given regular expression pattern.
 void requireText(JProgressBar progressBar, String expected)
          Asserts that the text of the JProgressBar is equal to the specified String.
 void requireValue(JProgressBar progressBar, int value)
          Verifies that the value of the given JProgressBar is equal to the given one.
 String textOf(JProgressBar progressBar)
          Returns the text of the given JProgressBar.
 void waitUntilIsDeterminate(JProgressBar progressBar)
          Waits until the value of the given JProgressBar is in determinate mode.
 void waitUntilIsDeterminate(JProgressBar progressBar, Timeout timeout)
          Waits until the value of the given JProgressBar is in determinate mode.
 void waitUntilValueIs(JProgressBar progressBar, int value)
          Waits until the value of the given JProgressBar is equal to the given value.
 void waitUntilValueIs(JProgressBar progressBar, int value, Timeout timeout)
          Waits until the value of the given JProgressBar is equal to the given value.
 
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

JProgressBarDriver

public JProgressBarDriver(Robot robot)
Creates a new JProgressBarDriver.

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

requireText

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

Specified by:
requireText in interface TextDisplayDriver<JProgressBar>
Parameters:
progressBar - the target JProgressBar.
expected - the text to match.
Throws:
AssertionError - if the text of the JProgressBar is not equal to the given one.
See Also:
JProgressBar.getString()

requireText

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

Specified by:
requireText in interface TextDisplayDriver<JProgressBar>
Parameters:
progressBar - the target JProgressBar.
pattern - the regular expression pattern to match.
Throws:
AssertionError - if the text of the JProgressBar does not match the given regular expression pattern.
NullPointerException - if the given regular expression pattern is null.
See Also:
JProgressBar.getString()

requireValue

@RunsInEDT
public void requireValue(JProgressBar progressBar,
                                   int value)
Verifies that the value of the given JProgressBar is equal to the given one.

Parameters:
progressBar - the target JProgressBar.
value - the expected value.
Throws:
AssertionError - if the value of the JProgressBar is not equal to the given one.

requireIndeterminate

@RunsInEDT
public void requireIndeterminate(JProgressBar progressBar)
Verifies that the given JProgressBar is in indeterminate mode.

Parameters:
progressBar - the target JProgressBar.
Throws:
AssertionError - if the given JProgressBar is not in indeterminate mode.

requireDeterminate

@RunsInEDT
public void requireDeterminate(JProgressBar progressBar)
Verifies that the given JProgressBar is in determinate mode.

Parameters:
progressBar - the target JProgressBar.
Throws:
AssertionError - if the given JProgressBar is not in determinate mode.

waitUntilValueIs

@RunsInEDT
public void waitUntilValueIs(JProgressBar progressBar,
                                       int value)
Waits until the value of the given JProgressBar is equal to the given value.

Parameters:
progressBar - the target JProgressBar.
value - the expected value.
Throws:
IllegalArgumentException - if the given value is less than the JProgressBar's minimum value.
IllegalArgumentException - if the given value is greater than the JProgressBar's maximum value.
WaitTimedOutError - if the value of the JProgressBar does not reach the expected value within 30 seconds.

waitUntilValueIs

@RunsInEDT
public void waitUntilValueIs(JProgressBar progressBar,
                                       int value,
                                       Timeout timeout)
Waits until the value of the given JProgressBar is equal to the given value.

Parameters:
progressBar - the target JProgressBar.
value - the expected value.
timeout - the amount of time to wait.
Throws:
IllegalArgumentException - if the given value is less than the JProgressBar's minimum value.
IllegalArgumentException - if the given value is greater than the JProgressBar's maximum value.
NullPointerException - if the given timeout is null.
WaitTimedOutError - if the value of the JProgressBar does not reach the expected value within the specified timeout.

waitUntilIsDeterminate

@RunsInEDT
public void waitUntilIsDeterminate(JProgressBar progressBar)
Waits until the value of the given JProgressBar is in determinate mode.

Parameters:
progressBar - the target JProgressBar.
Throws:
WaitTimedOutError - if the JProgressBar does not reach determinate mode within 30 seconds.

waitUntilIsDeterminate

@RunsInEDT
public void waitUntilIsDeterminate(JProgressBar progressBar,
                                             Timeout timeout)
Waits until the value of the given JProgressBar is in determinate mode.

Parameters:
progressBar - the target JProgressBar.
timeout - the amount of time to wait.
Throws:
NullPointerException - if the given timeout is null.
WaitTimedOutError - if the JProgressBar does not reach determinate mode within the specified timeout.

textOf

@RunsInEDT
public String textOf(JProgressBar progressBar)
Returns the text of the given JProgressBar.

Specified by:
textOf in interface TextDisplayDriver<JProgressBar>
Parameters:
progressBar - the target JProgressBar.
Returns:
the text of the given JProgressBar.


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