1 package org.jbpm.jpdl.xml; 2 3 import org.dom4j.*; 4 import org.jbpm.graph.def.*; 5 6 public class ProcessDefinitionXmlTest extends AbstractXmlTestCase { 7 8 public void testParseProcessDefinition() { 9 ProcessDefinition processDefinition = ProcessDefinition.parseXmlString( 10 "<process-definition />" 11 ); 12 assertNotNull(processDefinition); 13 } 14 15 public void testParseProcessDefinitionName() { 16 ProcessDefinition processDefinition = ProcessDefinition.parseXmlString( 17 "<process-definition name='make coffee' />" 18 ); 19 assertEquals("make coffee", processDefinition.getName()); 20 } 21 22 public void testWriteProcessDefinition() throws Exception { 23 ProcessDefinition processDefinition = new ProcessDefinition(); 24 Element element = toXmlAndParse( processDefinition ); 25 assertNotNull(element); 26 assertEquals("process-definition", element.getName()); 27 assertEquals(0, element.attributeCount()); 28 } 29 30 public void testWriteProcessDefinitionName() throws Exception { 31 ProcessDefinition processDefinition = new ProcessDefinition( "myprocess" ); 32 Element element = toXmlAndParse( processDefinition ); 33 assertNotNull(element); 34 assertEquals("process-definition", element.getName()); 35 assertEquals("myprocess", element.attributeValue("name")); 36 assertEquals(1, element.attributeCount()); 37 } 38 39 } 40 | Popular Tags |