Example Code

Modified on Tue, 28 Dec 2010 11:39 AM by John — Categorized as: Jetfire Core

Example Code - Unit Tests

The Jetfire download contains example code contained in two projects, JetfireCoreExampleTests and JetfireCode.

The core examples (project:JetfireCoreExampleTests) demonstrate use of the Jetfire code through documented unit tests.

Project 'JetfireCoreExampleTests' Directories

The following directories are contained in the 'JetfireCoreExampleTests' project in the 'ExampleCode' directory.


Application Examples

Hello World Unit Test

Hello world unit test demonstrates persistence of Jetfire objects with this variant of the classical 'Hello World' program. See Hello World description for a detailed explanation.

DVD Library Example Unit Test

This example demonstrates how Jetfire can be used to create a DVD library using the 'state' first class construct. The 'state' construct prevents methods, in this example, from being executed when the workflow is not in the proper state. For example the 'Borrow' method can not be executed when the workflow is in the 'Borrowed' state.

There is just one Jetfire workflow class, called 'DVD' required for the solution. Individual DVDs can be borrowed and returned using the 'Borrow' and 'Return' methods. The status of each individual DVD is determined by the state, 'CheckedIn' or 'Borrowed'.

See DVD Library Example description for a detailed explanation.

'ToDo' List Unit Test

The ToDo Workflows consist of:
Notes

See Also