|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.junit.Assert
net.sf.molae.pipe.test.ObjectTest<B>
net.sf.molae.pipe.test.BinaryFunctionTest<B,S1,S2,T>
public class BinaryFunctionTest<B extends BinaryFunction<S1,S2,T>,S1,S2,T>
Test methods to check the contract of BinaryFunction
implementing classes.
| Constructor Summary | |
|---|---|
protected |
BinaryFunctionTest(B testObject)
Creates a new test with the specified candidate. |
| Method Summary | ||
|---|---|---|
void |
assertConsistency()
Checks consistency of all reading methods. |
|
static
|
getInstance(BinaryFunction<S1,S2,T> testObject)
Creates a new instance of this class with the specified testObject as test object. |
|
void |
testWith(Object arg1)
Performs various tests using the specified object as identity element and sink. |
|
protected void |
testWith(S1 arg1,
S1 arg2,
S2 arg3)
Placeholder for associativity tests. |
|
void |
testWith(S1 arg1,
S2 arg2)
Performs various tests using the specified objects as arguments to the compute function of the tested binary function. |
|
| Methods inherited from class net.sf.molae.pipe.test.ObjectTest |
|---|
assertFalse, assertTestValuesSet, getTestObject, setTestValuesSet, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected BinaryFunctionTest(B testObject)
testObject - the candidate of the test
NullPointerException - if the specified test objects is
null.| Method Detail |
|---|
public static final <S1,S2,T> BinaryFunctionTest<BinaryFunction<S1,S2,T>,S1,S2,T> getInstance(BinaryFunction<S1,S2,T> testObject)
testObject - the candidate of the test
NullPointerException - if the specified test objects is
null.public void assertConsistency()
assertConsistency in class ObjectTest<B extends BinaryFunction<S1,S2,T>>AssertionFailedError - if the BinaryFunction
contract is broken by the test object.
public void testWith(S1 arg1,
S2 arg2)
arg1 - a valid left argument to the underlying binary functionarg2 - a valid right argument to the underlying binary function
AssertionFailedError - if the BinaryFunction
contract is broken by the test object.public void testWith(Object arg1)
arg1 - an arbitrary object
AssertionFailedError - if the BinaryFunction
contract is broken by the test object.
protected void testWith(S1 arg1,
S1 arg2,
S2 arg3)
arg1 - a valid left argument to the underlying binary functionarg2 - a valid left and right argument to the underlying binary
functionarg3 - a valid right argument to the underlying binary function
AssertionFailedError - if the BinaryFunction
contract is broken by the test object.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||