Class AbstractTestClass

java.lang.Object
com.teracloud.streams.topology.tester.junit.AbstractTestClass

public class AbstractTestClass extends Object
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 Details

    • AbstractTestClass

      public AbstractTestClass()
  • Method Details

    • setTesterType

      public void setTesterType()
    • assertTesterType

      protected void assertTesterType()
    • getDefaultTesterType

      public StreamsContext.Type getDefaultTesterType()
    • getDefaultTimeout

      public int getDefaultTimeout()
    • getTesterType

      public StreamsContext.Type getTesterType()
    • getConfig

      public Map<String,Object> getConfig()
    • getTesterContext

      public StreamsContext<?> 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

      protected void checkMinimumVersion(String reason, int... vrmf)
      Only run a test at a specific minimum version or higher.
    • checkMaximumVersion

      protected void checkMaximumVersion(String reason, int... vrmf)
      Only run a test at a specific maximum version or lower.
    • skipVersion

      protected void skipVersion(String reason, int... vrmf)
      Allow a test to be skipped for a specific version.
    • newTopology

      public Topology 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

      public void verifyComplete(Tester tester, Condition<?> endCondition) throws Exception
      Throws:
      Exception