KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jbpm > bpel > def > ImportDbTest


1 package org.jbpm.bpel.def;
2
3 import org.jbpm.bpel.db.AbstractDbTestCase;
4
5 public class ImportDbTest extends AbstractDbTestCase {
6   
7   public void testLocation() {
8     BpelDefinition processDefinition = new BpelDefinition();
9     Import anImport = new Import();
10     anImport.setLocation("aLocation");
11     processDefinition.getImports().addImport(anImport);
12
13     processDefinition = saveAndReload(processDefinition);
14
15     anImport = (Import)processDefinition.getImports().getImports().get(0);
16     assertEquals( "aLocation", anImport.getLocation() );
17   }
18  
19   public void testNamespace() {
20     BpelDefinition processDefinition = new BpelDefinition();
21     Import anImport = new Import();
22     anImport.setNamespace("http://www.enoughisenough.org");
23     processDefinition.getImports().addImport(anImport);
24     
25     processDefinition = saveAndReload(processDefinition);
26
27     anImport = (Import)processDefinition.getImports().getImports().get(0);
28     assertEquals( "http://www.enoughisenough.org", anImport.getNamespace() );
29   }
30   
31   public void testWsdlType() {
32     BpelDefinition processDefinition = new BpelDefinition();
33     Import anImport = new Import();
34     anImport.setType(Import.Type.WSDL);
35     processDefinition.getImports().addImport(anImport);
36     
37     processDefinition = saveAndReload(processDefinition);
38
39     anImport = (Import)processDefinition.getImports().getImports().get(0);
40     assertEquals( Import.Type.WSDL, anImport.getType() );
41   }
42   
43   public void testSchemaType() {
44     BpelDefinition processDefinition = new BpelDefinition();
45     Import anImport = new Import();
46     anImport.setType(Import.Type.XML_SCHEMA);
47     processDefinition.getImports().addImport(anImport);
48     
49     processDefinition = saveAndReload(processDefinition);
50
51     anImport = (Import)processDefinition.getImports().getImports().get(0);
52     assertEquals( Import.Type.XML_SCHEMA, anImport.getType() );
53   }
54 }
Popular Tags