1 package org.jbpm.bpel.service.def; 2 3 import java.util.HashSet ; 4 import java.util.Set ; 5 6 import javax.xml.namespace.QName ; 7 8 import org.jbpm.bpel.db.AbstractDbTestCase; 9 import org.jbpm.bpel.def.BpelDefinition; 10 import org.jbpm.bpel.wsdl.impl.PropertyImpl; 11 12 public class CorrelationSetDefinitionDbTest extends AbstractDbTestCase { 13 14 BpelDefinition processDefinition; 15 CorrelationSetDefinition csDefinition; 16 17 public void setUp() { 18 super.setUp(); 19 processDefinition = new BpelDefinition(); 20 csDefinition = new CorrelationSetDefinition(); 21 csDefinition.setName("cs"); 22 processDefinition.getScope().addCorrelationSet(csDefinition); 23 } 24 25 public void testName() { 26 processDefinition = saveAndReload(processDefinition); 27 assertEquals("cs", getCorrelationSetDefinition().getName()); 28 } 29 30 public void testProperties() { 31 Set properties = new HashSet (); 32 PropertyImpl property = new PropertyImpl(); 33 property.setQName(new QName ("aQName")); 34 property.setType(new QName ("aType")); 35 36 properties.add(property); 37 csDefinition.setProperties(properties); 38 39 processDefinition = saveAndReload(processDefinition); 40 41 assertNotNull(getCorrelationSetDefinition().getProperties()); 42 } 43 44 private CorrelationSetDefinition getCorrelationSetDefinition() { 45 return processDefinition.getScope().getCorrelationSet("cs"); 46 } 47 } 48 | Popular Tags |