After constructing and changing your business processes, you will want to validate the functionality and flow. This section explains how to use the JUnit framework to verify the correctness and completeness of your business process. This verification is called unit testing.
JUnit is a unit-testing framework for Java. JUnit is based on a TestCase
concept: each TestCase
contains a set of assertions; if any of these assertions fail, the TestCase
fails. To run unit tests you need to download JUnit from http://junit.org/ index.html. Unpack the distribution and copy junit.jar
to your classpath; that's the only file we need to run our example (in addition to the OSWorkflow libraries we've used before).
For this example, we'll build a JUnit TestCase
with a set of assertions about the current steps and available actions of a sample WorkflowDescriptor
. You can extend this example with your own set of assertions, as they vary across business processes. Here...