com.ibm.streamsx.topology.tester.junit

Class AbstractTestClass

  • java.lang.Object
    • com.ibm.streamsx.topology.tester.junit.AbstractTestClass


  • public class AbstractTestClass
    extends java.lang.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 Detail

      • AbstractTestClass

        public AbstractTestClass()
    • Method Detail

      • setTesterType

        public void setTesterType()
      • assertTesterType

        protected void assertTesterType()
      • getDefaultTimeout

        public int getDefaultTimeout()
      • getConfig

        public java.util.Map<java.lang.String,java.lang.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(java.lang.String reason,
                                           int... vrmf)
        Only run a test at a specific minimum version or higher.
      • checkMaximumVersion

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

        protected void skipVersion(java.lang.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,
                                java.util.concurrent.TimeUnit unit)
                         throws java.lang.Exception
        Test a topology that may run forever. If endCondition is null then: In a distributed environment the
        Throws:
        java.lang.Exception
      • verifyComplete

        public boolean verifyComplete(Tester tester,
                                      Condition<?> endCondition,
                                      long timeout,
                                      java.util.concurrent.TimeUnit unit)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • verifyComplete

        public void verifyComplete(Tester tester,
                                   Condition<?> endCondition)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
streamsx.topology 2.1 @ IBMStreams GitHub