AbstractTestClass (Java Application API for IBM Streams)
Date: 2020-08-07

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 Summary

    Constructors
    Constructor and Description
    `AbstractTestClass()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `assertTesterType()`
    `protected void` | `checkMaximumVersion(java.lang.String reason, int... vrmf)` Only run a test at a specific maximum version or lower.
    `protected void` | `checkMinimumVersion(java.lang.String reason, int... vrmf)` Only run a test at a specific minimum version or higher.
    `boolean` | `complete(Tester tester, Condition<?> endCondition, long timeout, java.util.concurrent.TimeUnit unit)` Test a topology that may run forever.
    `java.util.Map<java.lang.String,java.lang.Object>` | `getConfig()`
    `StreamsContext.Type` | `getDefaultTesterType()`
    `int` | `getDefaultTimeout()`
    `StreamsContext<?>` | `getTesterContext()` Return the default context for tests.
    `StreamsContext.Type` | `getTesterType()`
    `Topology` | `newTopology()`
    `void` | `setTesterType()`
    `protected void` | `skipVersion(java.lang.String reason, int... vrmf)` Allow a test to be skipped for a specific version.
    `protected void` | `splOK()`
    `boolean` | `verifyComplete(Tester tester, Condition<?> endCondition, long timeout, java.util.concurrent.TimeUnit unit)`
    `void` | `verifyComplete(Tester tester, Condition<?> endCondition)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AbstractTestClass

          public AbstractTestClass()

  - ### Method Detail

    - #### setTesterType

          public void setTesterType()

    - #### assertTesterType

          protected void assertTesterType()

    - #### getDefaultTesterType

          public StreamsContext.Type getDefaultTesterType()

    - #### getDefaultTimeout

          public int getDefaultTimeout()

    - #### getTesterType

          public StreamsContext.Type getTesterType()

    - #### 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`