Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
AmeerAhmed
IntegratingJBPMIntoA...
IntegratingJBPMIntoA...




JSPWiki v2.2.33

[RSS]


Hide Menu

IntegratingJBPMIntoAppFusePartDeux


Difference between version 20 and version 19:

At line 9 changed 1 line.
* [2] Create and deploy a simple Process Defintion
* [2] Create a simple Process Defintion
At line 25 changed 1 line.
!![#2] Create and deploy a simple Process Defintion
!![#2] Create a simple Process Defintion
At line 81 changed 1 line.
!What is AppFuse?
Congratulations you have created a process definition using the process design tool!
At line 83 changed 1 line.
<a href="http://appfuse.org"><img src="https://appfuse.dev.java.net/images/icon.gif" alt="AppFuse Logo" style="margin: 0px 10px 10px 0px; float: left" /></a><a href="http://www.frappr.com/appfuse"><img src="http://www.frappr.com/i/frapper_sticker.gif" style="float: right; margin: 0px 5px 10px 10px" alt="Check out our Frappr!" title="Check out our Frappr!"></a>
Let's write a test case to validate our process definition.
!![#2] Write test case to validate Process Definition execution
We have already written a test case in the [previous article|IntegratingJBPMIntoAppFuse.html#ref-IntegratingJBPMIntoAppFuse-4], So go ahead and create {{ProcessTest.java}} class under {{test/dao/org/appfuse/jbpm/dao}} and copy the code from the previous installment with the following modifications:\\
{{{
protected void onSetUpBeforeTransaction() throws Exception {
...
definition = context.getGraphSession().findLatestProcessDefinition("test");
}
public void testProcessDefinition() throws Exception {
ProcessDefinition def = context.getGraphSession().findLatestProcessDefinition("test");
assertNotNull("Definition should not be null", def);
}
public void testTransitions() throws Exception {
.....
assertEquals("Instance is in 'helloWorld' state", inst.getRootToken().getNode().getName(), "helloWorld");
.....
}
}}}
It time to recompile and run our junit test. Execute __ant refresh__.
[test1.jpg]
Select the project's context menu by right clicking on the project root(jbpmtutorial) and choosing the refresh option.
[test2.jpg]
And finally select Project from the Eclispe's menu above and choose clean.
[test3.jpg]
Now you can run the ProcessTest. Ensure you have ProcessTest open and selected and then choose Run As -> Junit Test
[test4.jpg]
Upon execution JbpmConfiguration will deploy the 'test' process definition, and run through the tests.
[test5.jpg]
You have successfully deployed and tested a process definition.

Back to IntegratingJBPMIntoAppFusePartDeux, or to the Page History.