sbtest
StreamBase Test Utility — runs a unit test defined in a StreamBase test file
DESCRIPTION
sbtest runs a unit test of a StreamBase application as defined in a StreamBase test file.
OPTIONS
-
-h,--help -
Displays usage text.
-
-u[uri] -
Specifies the URI of the StreamBase Server to communicate with, overriding the server URI, if any, defined in the test file. No space is allowed between
–uand its argument.If a URI is not currently specified in the test file, you must specify
-awithout an argument to remove the application setting at the same time.Without an argument,
-uignores the current URI setting in the test file and requires-aapplication.sbappon the same command line.See the sburi page of the Reference Guide (or see sburi(5) at the UNIX shell prompt) for a discussion of the URI format and its shortcuts. The URI can also be set using the
STREAMBASE_SERVERenvironment variable. -
-a[file.sbapp] -
Specifies an EventFlow or StreamSQL application file to run the test against, overriding the application, if any, defined in the test file. No space is allowed between
–aand its argument.If an application name is not currently specified in the test file, you must specify
-uwithout an argument to remove the URI setting at the same time.Without an argument,
-aignores the current application setting in the test file and requires-usb://host:porton the same command line. -
-fconfig-file -
Specifies an
sbd.sbconfconfiguration file to use when running the test. -
--version -
Prints version information and exits.
EXAMPLES
Run the test file named tradeapp.sbtest, which specifies
an application name and server URI:
sbtest tradeapp.sbtest
Run the same test file, but override the server URI specified in the test file:
sbtest -usb://localhost:9900
tradeapp.sbtest
Run the same test file, but override the application specified in the test file,
instead running tradetest.sbapp:
sbtest -atradetest.sbapp
tradeapp.sbtest
Another test file named uri-noapp.sbtest specifies a
server URI, but does not specify an application name. You can run this test against
an application named with -a, but you must override the
test file's URI at the same time with an empty -u. In
this case, the default URI is used, unless you specify a URI in a server
configuration file:
sbtest -u -atradetest.sbapp -f sbd.sbconf
uri-noapp.sbtest
A third test file named app-nouri.sbtest specifies an
application name, but does not specify a server URI. You can run this test with a URI
specified with -u, but you must also override the test
file's application name at the same time with an empty -a. In this case, specify the application to test in a server
configuration file:
sbtest -a -usb://sbhost:9500 -f sbd.sbconf
app-nouri.sbtest
FILES
sbtest requires a
StreamBase test file, which usually has a .sbtest extension. The test file is typically generated in
StreamBase Studio, either by recording a running application in test
mode, or by editing a test scenario with the Unit Test Editor. See Creating and Running Unit Tests in
the Test/Debug Guide for more information.
ENVIRONMENT
-
STREAMBASE_SERVER -
Optional. Contains the URI for a StreamBase Server instance. Use this variable to set a default StreamBase URI for StreamBase commands that take the
–uoption. If set, commands use the URI in this variable, overriding their built-in default URI, which issb://localhost:10000.If this variable is set, you must use the –u option to communicate with any server other than the one specified in this variable. See the sburi page in the Reference Guide for more on StreamBase URIs.
