OOoRunner test harness

lib
Class MultiPropertyTest.PropertyValueSwitcher

java.lang.Object
  |
  +--lib.MultiPropertyTest.PropertyTester
        |
        +--lib.MultiPropertyTest.PropertyValueSwitcher
Enclosing class:
MultiPropertyTest

public class MultiPropertyTest.PropertyValueSwitcher
extends MultiPropertyTest.PropertyTester

Extension for PropertyTester which switches two different values. getNewValue() method of this class returns one of these two values depending on the old value, so new value is not equal to old value.


Constructor Summary
MultiPropertyTest.PropertyValueSwitcher(Object val1, Object val2)
          Constructs a property tester with two different values specified as parameters.
 
Method Summary
protected  Object getNewValue(String propName, Object old)
          Overriden method of PropertyTester which retruns new value from two values specified.
 
Methods inherited from class lib.MultiPropertyTest.PropertyTester
checkResult, compare, testProperty, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiPropertyTest.PropertyValueSwitcher

public MultiPropertyTest.PropertyValueSwitcher(Object val1,
                                               Object val2)
Constructs a property tester with two different values specified as parameters.
Parameters:
val1 - Not null value for the property tested.
val1 - Not null value for the property tested which differs from the first value.
Method Detail

getNewValue

protected Object getNewValue(String propName,
                             Object old)
Overriden method of PropertyTester which retruns new value from two values specified.
Overrides:
getNewValue in class MultiPropertyTest.PropertyTester
Returns:
The second value if old value is equal to the first one, the first value otherwise.

OOoRunner test harness