KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > graph > node > EndStateTest


1 package org.jbpm.graph.node;
2
3 import junit.framework.TestCase;
4
5 import org.jbpm.graph.def.ProcessDefinition;
6 import org.jbpm.graph.exe.ProcessInstance;
7
8 public class EndStateTest extends TestCase {
9
10   public void testEndEvent() {
11     // create the state definition graph
12
ProcessDefinition sd = new ProcessDefinition(
13         new String JavaDoc[]{"start-state start",
14                      "end-state end"},
15         new String JavaDoc[]{"start --> end"});
16     
17     // run the process
18
ProcessInstance si = new ProcessInstance(sd);
19     si.signal();
20     try {
21       si.signal();
22       fail("expected exception");
23     } catch (IllegalStateException JavaDoc e) {
24       //OK
25
}
26   }
27
28 }
29
Popular Tags