[MOBY-guts] biomoby commit

Paul Gordon gordonp at dev.open-bio.org
Mon Jun 30 17:42:30 UTC 2008


gordonp
Mon Jun 30 13:42:29 EDT 2008
Update of /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test
In directory dev.open-bio.org:/tmp/cvs-serv9782/src/main/ca/ucalgary/services/util/test

Modified Files:
	KEGG.wsdl WSDLConfigTestCase.java 
Log Message:
Changes to reflect full SAWSDL support
moby-live/Java/src/main/ca/ucalgary/services/util/test KEGG.wsdl,1.1,1.2 WSDLConfigTestCase.java,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/KEGG.wsdl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/KEGG.wsdl	2008/03/13 23:08:26	1.1
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/KEGG.wsdl	2008/06/30 17:42:29	1.2
@@ -77,12 +77,14 @@
         </xsd:complexContent>
       </xsd:complexType>
 <!-- DEFINITION -->
-      <xsd:complexType name="Definition">
+      <!-- PG: define a lifting mapping so we can use definitions as secondary params for other services -->
+      <xsd:complexType name="Definition" sawsdl:liftingSchemaMapping="urn:lsid:bioxml.info:mobyLiftingSchemaMapping:Definition2KeggDefSecondaryString">
         <xsd:all>
           <xsd:element name="entry_id" type="xsd:string"/>
           <xsd:element name="definition" type="xsd:string"/>
         </xsd:all>
       </xsd:complexType>
+      <!-- PG: Array of definition, when used a secondary, automatically becomes an enumerated string parameter -->
       <xsd:complexType name="ArrayOfDefinition">
         <xsd:complexContent>
           <xsd:restriction base="soapenc:Array">
@@ -481,10 +483,12 @@
          and the (bioxml.info) rules for converting incoming Moby XML to plain text ("dem rule" XSLT). -->
     <part name="enzyme_id" type="xsd:string"
           sawsdl:modelReference="urn:lsid:biomoby.org:namespacetype:EC"
-          sawsdl:loweringSchemaMapping="urn:lsid:bioxml.info:mobyLoweringSchemaMapping:EC2ecString"/>
+          sawsdl:loweringSchemaMapping="urn:lsid:bioxml.info:mobyLoweringSchemaMapping:EC2ecPrefixedString"/>
     <part name="org" type="xsd:string"
-          sawsdl:modelReference="urn:lsid:biomoby.org:objectclass:Organism"
-          sawsdl:loweringSchemaMapping="urn:lsid:bioxml.info:mobyLoweringSchemaMapping:Organism2orgNameString"/>
+          sawsdl:modelReference="urn:lsid:biomoby.org:secondaryParamClass:String"
+          sawsdl:loweringSchemaMapping="urn:lsid:bioxml.info:mobyLoweringSchemaMapping:KeggDefSecondaryString2String"
+          moby:secondaryParamSource="list_organisms"
+          xmlns:moby="http://www.biomoby.org/moby"/>
   </message>
   <message name="get_genes_by_enzymeResponse">
     <!-- PG: Mark up the output item with an LSID pointing to the Moby ontology term, 

===================================================================
RCS file: /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/WSDLConfigTestCase.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/WSDLConfigTestCase.java	2008/03/13 23:08:26	1.1
+++ /home/repository/moby/moby-live/Java/src/main/ca/ucalgary/services/util/test/WSDLConfigTestCase.java	2008/06/30 17:42:29	1.2
@@ -26,15 +26,16 @@
     private final static String OP_INPUT_NAME = "get_genes_by_enzymeRequest";
     private final static String OP_OUTPUT_NAME = "get_genes_by_enzymeResponse";
 
-    private final static int NUM_INPUTS = 2;
+    private final static int NUM_INPUTS = 1;
     private final static String INPUT_NAME1 = "enzyme_id";
     private final static String INPUT_TYPE1 = "enzyme_id:Object:EC";
     private final static String INPUT_XSDTYPE1 = "xsd:string";
-    private final static String INPUT_SCHEMA_MAPPING1 = "urn:lsid:bioxml.info:mobyLoweringSchemaMapping:EC2ecString";
-    private final static String INPUT_NAME2 = "org";
-    private final static String INPUT_TYPE2 = "org:Organism";
-    private final static String INPUT_XSDTYPE2 = "xsd:string";
-    private final static String INPUT_SCHEMA_MAPPING2 = "urn:lsid:bioxml.info:mobyLoweringSchemaMapping:Organism2orgNameString";
+    private final static String INPUT_SCHEMA_MAPPING1 = "urn:lsid:bioxml.info:mobyLoweringSchemaMapping:EC2ecPrefixedString";
+    private final static int NUM_SECONDARY_INPUTS = 1;
+    private final static String INPUT_SECONDARY_NAME1 = "org";
+    private final static String INPUT_SECONDARY_TYPE1 = "org:String:[^:]+ - \\S+:\\[.*\\]";  //form of the secondary param
+    private final static String INPUT_SECONDARY_XSDTYPE1 = "xsd:string";
+    private final static String INPUT_SECONDARY_SCHEMA_MAPPING1 = "urn:lsid:bioxml.info:mobyLoweringSchemaMapping:KeggDefSecondaryString2String";
 
     private final static int NUM_OUTPUTS = 1;
     private final static String OUTPUT_NAME1 = "return";
@@ -105,12 +106,12 @@
 	assertTrue("The SOAP operation name '" + wsdl.getOperationName() + "' for service " + 
 		   SERVICE_NAME + " in the test WSDL was not '" + OP_NAME + "' as expected", 
 		   OP_NAME.equals(wsdl.getOperationName()));
-	assertTrue("The SOAP operation input name '" + wsdl.getOperationInputName() + "' for service " + 
+	assertTrue("The SOAP operation input name '" + wsdl.getOperationInputQName().getLocalPart() + "' for service " + 
 		   SERVICE_NAME + " in the test WSDL was not '" + OP_INPUT_NAME + "' as expected", 
-		   OP_INPUT_NAME.equals(wsdl.getOperationInputName()));
-	assertTrue("The SOAP operation output name '" + wsdl.getOperationOutputName() + "' for service " + 
+		   OP_INPUT_NAME.equals(wsdl.getOperationInputQName().getLocalPart()));
+	assertTrue("The SOAP operation output name '" + wsdl.getOperationOutputQName().getLocalPart() + "' for service " + 
 		   SERVICE_NAME + " in the test WSDL was not '" + OP_OUTPUT_NAME + "' as expected", 
-		   OP_OUTPUT_NAME.equals(wsdl.getOperationOutputName()));
+		   OP_OUTPUT_NAME.equals(wsdl.getOperationOutputQName().getLocalPart()));
 
 	Map<String,String> inputs = wsdl.getPrimaryInputs();
 	assertNotNull("The input specification parsed from the test WSDL was unexpectedly null", inputs);
@@ -120,35 +121,38 @@
 	assertTrue("The expected input parameter " + INPUT_NAME1 + 
 		   " does not exist in the parsed test WSDL input spec", 
 		   inputs.containsKey(INPUT_NAME1));
-	assertTrue("The expected input parameter " + INPUT_NAME2 + 
-		   " does not exist in the parsed test WSDL input spec", 
-		   inputs.containsKey(INPUT_NAME2));
 	assertTrue("The expected type (" + INPUT_TYPE1 + ") for input parameter " + INPUT_NAME1 +
 		   " was not found, but rather: " + inputs.get(INPUT_NAME1),
 		   INPUT_TYPE1.equals(inputs.get(INPUT_NAME1)));
-	assertTrue("The expected type (" + INPUT_TYPE2 + ") for input parameter " + INPUT_NAME2 +
-		   " was not found, but rather: " + inputs.get(INPUT_NAME2),
-		   INPUT_TYPE2.equals(inputs.get(INPUT_NAME2)));
+	
+	Map<String,String> inputs2 = wsdl.getSecondaryInputs();
+	assertNotNull("The secondary input specification parsed from the test WSDL was unexpectedly null", 
+		      inputs2);
+	assertTrue("The number of SOAP operation inputs (" + inputs2.size() + 
+		   " in the test WSDL was not " + NUM_SECONDARY_INPUTS + " as expected ",
+		   NUM_SECONDARY_INPUTS == inputs2.size());
+	assertTrue("The expected secondary input parameter " + INPUT_SECONDARY_NAME1 + 
+		   " does not exist in the parsed test WSDL input spec", 
+		   inputs2.containsKey(INPUT_SECONDARY_NAME1));
+	assertTrue("The expected pattern match (" + INPUT_SECONDARY_TYPE1 + ") for secondary input parameter " + 
+		   INPUT_SECONDARY_NAME1 +
+		   " was not found, but rather the value is: " + inputs2.get(INPUT_SECONDARY_NAME1),
+		   inputs2.get(INPUT_SECONDARY_NAME1) != null &&
+		   inputs2.get(INPUT_SECONDARY_NAME1).matches(INPUT_SECONDARY_TYPE1));
 
 	Map<String,String> inputFormats = wsdl.getPrimaryInputFormats();
-	assertNotNull("The input schema mapping specification parsed from the test WSDL was unexpectedly null", inputFormats);
+	assertNotNull("The input schema mapping specification parsed from the test WSDL " +
+		      "was unexpectedly null", inputFormats);
 	assertTrue("The number of SOAP operation input schema mappings (" + inputFormats.size() + 
 		   " in the test WSDL was not " + NUM_INPUTS + " as expected ",
 		   NUM_INPUTS == inputFormats.size());
 	assertTrue("The expected input parameter " + INPUT_NAME1 + 
 		   " schema mapping does not exist in the parsed test WSDL input spec", 
 		   inputFormats.containsKey(INPUT_NAME1));
-	assertTrue("The expected input parameter " + INPUT_NAME2 + 
-		   " schema mapping does not exist in the parsed test WSDL input spec", 
-		   inputFormats.containsKey(INPUT_NAME2));
 	assertTrue("The expected schema mapping LSID " + INPUT_SCHEMA_MAPPING1 + 
 		   " for input parameter " + INPUT_NAME1 + " was not found, but rather: " +
 		   inputFormats.get(INPUT_NAME1),
 		   INPUT_SCHEMA_MAPPING1.equals(inputFormats.get(INPUT_NAME1)));
-	assertTrue("The expected schema mapping LSID " + INPUT_SCHEMA_MAPPING2 + 
-		   " for input parameter " + INPUT_NAME2 + " was not found, but rather: " +
-		   inputFormats.get(INPUT_NAME2),
-		   INPUT_SCHEMA_MAPPING2.equals(inputFormats.get(INPUT_NAME2)));
 
 	Map<String,String> inputXSDTypes = wsdl.getInputXSDTypes();
 	assertNotNull("The input XSD-type specification parsed from the test WSDL was unexpectedly null", inputXSDTypes);
@@ -158,17 +162,10 @@
 	assertTrue("The expected input parameter " + INPUT_NAME1 + 
 		   " XSD-type spec does not exist in the parsed test WSDL input spec", 
 		   inputXSDTypes.containsKey(INPUT_NAME1));
-	assertTrue("The expected input parameter " + INPUT_NAME2 + 
-		   " XSD-type spec does not exist in the parsed test WSDL input spec", 
-		   inputXSDTypes.containsKey(INPUT_NAME2));
 	assertTrue("The expected XSD-type spec " + INPUT_XSDTYPE1 + 
 		   " for input parameter " + INPUT_NAME1 + " was not found, but rather: " +
 		   inputXSDTypes.get(INPUT_NAME1),
 		   INPUT_XSDTYPE1.equals(inputXSDTypes.get(INPUT_NAME1)));
-	assertTrue("The expected XSD-type spec " + INPUT_XSDTYPE2 + 
-		   " for input parameter " + INPUT_NAME2 + " was not found, but rather: " +
-		   inputXSDTypes.get(INPUT_NAME2),
-		   INPUT_XSDTYPE2.equals(inputXSDTypes.get(INPUT_NAME2)));
 
 	Map<String,String> outputs = wsdl.getPrimaryOutputs();
 	assertNotNull("The output specification parsed from the test WSDL was unexpectedly null", outputs);
@@ -250,8 +247,8 @@
     public static Test suite() {
 
 	TestSuite suite = new TestSuite();
- 	suite.addTest(new WSDLConfigTestCase("testParsingBasic"));
- 	suite.addTest(new WSDLConfigTestCase("testMetadata"));
+ 	//suite.addTest(new WSDLConfigTestCase("testParsingBasic"));
+ 	//suite.addTest(new WSDLConfigTestCase("testMetadata"));
  	suite.addTest(new WSDLConfigTestCase("testIOSpecs"));
 	
         return suite;




More information about the MOBY-guts mailing list