Package org.tquadrat.foundation.testutil
Class TestDataBase<E>
java.lang.Object
org.tquadrat.foundation.testutil.TestDataBase<E>
- Type Parameters:
E
- The type of the expected result.
- All Implemented Interfaces:
Serializable
@API(status=STABLE,
since="0.0.5")
public abstract class TestDataBase<E>
extends Object
implements Serializable
This class is meant as the base class for test data records.
- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: TestDataBase.java 820 2020-12-29 20:34:22Z tquadrat $
- Since:
- 0.1.0
- See Also:
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.testutil.TestDataBase"
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TestDataBase[]
An empty array ofTestDataBase
objects.The optional description of the test.The expected result. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TestDataBase
(E expected) Creates a newTestDataBase
instance.protected
TestDataBase
(E expected, String description) Creates a newTestDataBase
instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the description for the test.expected()
Returns the expected result for the test.final boolean
Indicates whether the test should fail.
-
Field Details
-
EMPTY_TestDataBase_ARRAY
An empty array ofTestDataBase
objects. -
m_Description
The optional description of the test. -
m_Expected
The expected result.
-
-
Constructor Details
-
TestDataBase
Creates a newTestDataBase
instance.- Parameters:
expected
- The expected result for the test; ifnull
the test should fail.
-
TestDataBase
Creates a newTestDataBase
instance.- Parameters:
expected
- The expected result for the test; ifnull
the test should fail.description
- The description for this test.
-
-
Method Details
-
description
Returns the description for the test.- Returns:
- An instance of
Optional
that holds the description.
-
expected
Returns the expected result for the test. An empty return value indicates that the test should fail.- Returns:
- An instance of
Optional
that holds the expected result.
-
shouldFail
Indicates whether the test should fail.- Returns:
true
if the test should fail,false
if it should be successful.
-