KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > bpel > wsdl > impl > PropertyImplDbTest


1 package org.jbpm.bpel.wsdl.impl;
2
3 import java.util.HashSet JavaDoc;
4 import java.util.Set JavaDoc;
5
6 import javax.xml.namespace.QName JavaDoc;
7
8 import org.jbpm.bpel.db.AbstractDbTestCase;
9 import org.jbpm.bpel.def.BpelDefinition;
10 import org.jbpm.bpel.service.def.CorrelationSetDefinition;
11
12 public class PropertyImplDbTest extends AbstractDbTestCase {
13   
14   BpelDefinition processDefinition;
15   PropertyImpl property;
16   
17   public void setUp() {
18     super.setUp();
19     processDefinition = new BpelDefinition();
20     CorrelationSetDefinition csDefinition = new CorrelationSetDefinition();
21     csDefinition.setName("cs");
22     property = new PropertyImpl();
23     processDefinition.getScope().addCorrelationSet(csDefinition);
24     Set JavaDoc properties = new HashSet JavaDoc();
25     property.setQName(new QName JavaDoc("aQName"));
26     property.setElementType(new QName JavaDoc("aElementType"));
27     properties.add(property);
28     csDefinition.setProperties(properties);
29   }
30   
31   public void testQName() {
32     processDefinition = saveAndReload(processDefinition);
33     
34     assertNotNull( getProperty().getQName() );
35   }
36   
37   public void testElementType() {
38     processDefinition = saveAndReload(processDefinition);
39     
40     assertNotNull( getProperty().getElementType() );
41   }
42   
43   public void testType() {
44     property.setType(new QName JavaDoc("aType"));
45     
46     processDefinition = saveAndReload(processDefinition);
47     
48     assertNotNull( getProperty().getType() );
49   }
50   
51   private PropertyImpl getProperty() {
52     CorrelationSetDefinition cs = processDefinition.getScope().getCorrelationSet("cs");
53     return (PropertyImpl) cs.getProperties().iterator().next();
54   }
55 }
56
Popular Tags