Class AbstractTestClass
java.lang.Object
com.teracloud.streams.topology.tester.junit.AbstractTestClass
Test class providing utilities for testing of topologies.
Test classes using JUnit extend this class allowing
them to focus on what is being tested. This class
handles the invocation of the test including supporting
the ability for the same test to be run in different
environments.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidcheckMaximumVersion(String reason, int... vrmf) Only run a test at a specific maximum version or lower.protected voidcheckMinimumVersion(String reason, int... vrmf) Only run a test at a specific minimum version or higher.booleanTest a topology that may run forever.intReturn the default context for tests.voidprotected voidskipVersion(String reason, int... vrmf) Allow a test to be skipped for a specific version.protected voidsplOK()voidverifyComplete(Tester tester, Condition<?> endCondition) booleanverifyComplete(Tester tester, Condition<?> endCondition, long timeout, TimeUnit unit)
-
Constructor Details
-
AbstractTestClass
public AbstractTestClass()
-
-
Method Details
-
setTesterType
public void setTesterType() -
assertTesterType
protected void assertTesterType() -
getDefaultTesterType
-
getDefaultTimeout
public int getDefaultTimeout() -
getTesterType
-
getConfig
-
getTesterContext
Return the default context for tests. Using this allows the tests to be run against different contexts, assuming the results/asserts are expected to be the same. -
splOK
protected void splOK() -
checkMinimumVersion
Only run a test at a specific minimum version or higher. -
checkMaximumVersion
Only run a test at a specific maximum version or lower. -
skipVersion
Allow a test to be skipped for a specific version. -
newTopology
-
complete
public boolean complete(Tester tester, Condition<?> endCondition, long timeout, TimeUnit unit) throws Exception Test a topology that may run forever. If endCondition is null then: In a distributed environment the- Throws:
Exception
-
verifyComplete
public boolean verifyComplete(Tester tester, Condition<?> endCondition, long timeout, TimeUnit unit) throws Exception - Throws:
Exception
-
verifyComplete
- Throws:
Exception
-