Book Image

OSWorkflow: A guide for Java developers and architects to integrating open-source Business Process Management

Book Image

OSWorkflow: A guide for Java developers and architects to integrating open-source Business Process Management

Overview of this book

OSWorkflow is an open-source workflow engine written entirely in Java with a flexible approach and a technical user-base target. It is released under the Apache License. You can create simple or complex workflows, depending on your needs. You can focus your work on the business logic and rules. No more Petri Net or finite state machine coding! You can integrate OSWorkflow into your application with a minimum of fuss. OSWorkflow provides all of the workflow constructs that you might encounter in real-life processes, such as steps, conditions, loops, splits, joins, roles, etc.This book explains in detail all the various aspects of OSWorkflow, without assuming any prior knowledge of Business Process Management. Real-life examples are used to clarify concepts.
Table of Contents (13 chapters)
OSWorkflow
Credits
About the Author
About the Reviewers
Introduction

Unit Testing your Workflow


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.

What is JUnit?

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...