org.fest.swing.timing
Class Condition

java.lang.Object
  extended by org.fest.swing.timing.Condition
Direct Known Subclasses:
ComponentFoundCondition, EdtSafeCondition, WaitForComponentToShowCondition

public abstract class Condition
extends Object

Understands a condition to verify, usually used in the method Pause.pause(Condition).

Author:
Yvonne Wang, Alex Ruiz

Field Summary
protected static String EMPTY_TEXT
           
 
Constructor Summary
Condition(org.fest.assertions.Description description)
          Creates a new Condition.
Condition(String description)
          Creates a new Condition.
 
Method Summary
protected  String descriptionAddendum()
          Returns any text to be added to this condition's description.
protected  void done()
          Notification that this condition has been evaluated.
abstract  boolean test()
          Checks if the condition has been satisfied.
 String toString()
          Returns the String representation of this condition, which is its description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_TEXT

protected static final String EMPTY_TEXT
See Also:
Constant Field Values
Constructor Detail

Condition

public Condition(String description)
Creates a new Condition.

Parameters:
description - describes this condition.

Condition

public Condition(org.fest.assertions.Description description)
Creates a new Condition.

Parameters:
description - describes this condition.
Method Detail

test

public abstract boolean test()
Checks if the condition has been satisfied.

Returns:
true if the condition has been satisfied, otherwise false.

toString

public final String toString()
Returns the String representation of this condition, which is its description.

Overrides:
toString in class Object
Returns:
the description of this condition.

descriptionAddendum

protected String descriptionAddendum()
Returns any text to be added to this condition's description. The default value is an empty String.

Returns:
by default, an empty String.

done

protected void done()
Notification that this condition has been evaluated. This method is invoked by Pause.pause(Condition) (and all overloaded methods) when this condition is evaluated (either it was satisfied or it timed-out.) This is a good place to do any necessary resource cleanup.



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