|
|||||||||
| 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.CubeTest<B,E,T>
public class CubeTest<B extends Cube<E,T>,E,T>
Test methods to check the contract of cube implementing classes.
| Nested Class Summary | |
|---|---|
static class |
CubeTest.ProjectionTest<E,T>
Test methods to check the contract of projections. |
| Constructor Summary | |
|---|---|
protected |
CubeTest(B testObject)
Creates a new test with the specified candidate. |
| Method Summary | ||
|---|---|---|
void |
assertConsistency()
Checks consistency of all reading cube methods. |
|
protected void |
assertConsistency(List<E> key)
Checks consistency of all reading cube methods regarding the element at the specified key. |
|
protected void |
checkConsistency()
This method is called at the start of the test cycle and after each modification of the test object. |
|
protected void |
checkConsistency(List<E> key)
This method is called at the start of the test cycle and after each modification of the element at the specified key. |
|
static
|
getInstance(Cube<E,T> testObject)
Creates a new instance of this class with the specified testObject as test object. |
|
void |
performCycle()
Performs a test cycle. |
|
protected void |
performCycle(List<E> key)
Puts the specified key/value pair and restores the old value. |
|
void |
performIntegerTest()
Deprecated. Use setStringTestValues(net.sf.molae.pipe.test.CubeTest, ? super java.lang.String, ? super java.lang.String>)
and performValuesTest() instead. |
|
void |
performValuesTest()
Fills the test object with three entries and runs tests with it. |
|
static void |
setStringTestValues(CubeTest<?,? super String,? super String> test)
Sets default values for the test values. |
|
void |
setTestValue(T testValue)
Sets the test value to the specified value. |
|
void |
setTestValues(E e1,
E e2,
T value1,
T value2,
T value3)
Defines the test data to be used in performValuesTest(). |
|
| 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 CubeTest(B testObject)
testObject - the candidate of the test
NullPointerException - if the specified test objects is
null.| Method Detail |
|---|
public static final <E,T> CubeTest<Cube<E,T>,E,T> getInstance(Cube<E,T> testObject)
testObject - the candidate of the test
NullPointerException - if the specified test objects is
null.protected void assertConsistency(List<E> key)
key - key of the element to check
AssertionFailedError - if the cube contract is broken by
the tested cube.public void assertConsistency()
assertConsistency in class ObjectTest<B extends Cube<E,T>>AssertionFailedError - if the cube contract is broken by
the tested cube.protected void checkConsistency(List<E> key)
assertConsistency(List).
key - key of the element to check
AssertionFailedError - if the test object is not consistent.protected void checkConsistency()
assertConsistency().
AssertionFailedError - if the test object is not consistent.public void setTestValue(T testValue)
put method.
testValue - new value of the test value.protected void performCycle(List<E> key)
key - key of the cube entry to be modified
AssertionFailedError - if the cube contract is broken by
the tested cube.public void performCycle()
AssertionFailedError - if the cube contract is broken by
the tested cube.
public void setTestValues(E e1,
E e2,
T value1,
T value2,
T value3)
performValuesTest().
public static void setStringTestValues(CubeTest<?,? super String,? super String> test)
public void performValuesTest()
AssertionFailedError - if the test object does not pass the test.
IllegalStateException - if test values have not been set.public void performIntegerTest()
setStringTestValues(net.sf.molae.pipe.test.CubeTest, ? super java.lang.String, ? super java.lang.String>)
and performValuesTest() instead.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||