StreamBase Tests (sbtest)

StreamBase Unit Tests provide a way to verify that an application module produces the exact expected output for specific input. This testing methodology is designed to ensure that the module under test continues to behave correctly after you have made changes to the module.

The StreamBase Test mechanism is comparable to a macro recording and playback feature, and does not require writing or editing Java code. By contrast, StreamBase Studio also provides the StreamBase Unit Test mechanism, which is a true JUnit subsystem and API that provides an alternate method of module unit testing using Java-based test files. See StreamBase JUnit Tests for more on StreamBase JUnit Test features.

You develop and run StreamBase Tests to confirm that StreamBase applications return the expected result tuples given known input streams. You can organize a group of tests to be executed together as a StreamBase Test suite.

Create StreamBase Tests in one of two ways:

  • By recording a test configuration while an application is running and saving the results, as described in Creating and Running StreamBase Tests. The recording includes feed simulations representing input data, validation CSV files representing output data, and a test configuration file to tie them together as a unified test.

  • By creating and editing a test configuration file with .sbtest extension, along with the input and verification files the test needs.

A StreamBase Test suite contains a set of StreamBase Tests to be run as a group. Create a StreamBase Test suite by moving a group of related test configuration files, plus all the resources those tests require, to the same folder, as described in Creating and Running Test Suites.

Once a StreamBase Test or a Test suite is prepared, you can run it:

  • Interactively in Studio, in the SB Test/Debug perspective.

  • From the shell command prompt with the sbtest command.

  • As part of an automated application test script.