KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > graph > def > NodeTest


1 package org.jbpm.graph.def;
2
3 import junit.framework.*;
4
5 public class NodeTest extends TestCase {
6   
7   public void testNameChange() {
8     Node node = new Node();
9     assertNull(node.getName());
10     node.setName("jos");
11     assertEquals("jos", node.getName());
12     node.setName("piet");
13     assertEquals("piet", node.getName());
14   }
15
16   public void testNameChangeInProcessDefinition() {
17     Node node = new Node();
18     ProcessDefinition processDefinition = new ProcessDefinition();
19     processDefinition.addNode(node);
20     
21     assertSame(node, processDefinition.getNode(null));
22     node.setName("jos");
23     assertNull(processDefinition.getNode(null));
24     assertSame(node, processDefinition.getNode("jos"));
25     assertEquals("jos", node.getName());
26     node.setName("piet");
27     assertNull(processDefinition.getNode(null));
28     assertNull(processDefinition.getNode("jos"));
29     assertSame(node, processDefinition.getNode("piet"));
30   }
31
32 }
33
Popular Tags