[mashup-dev] svn commit r6471 - in trunk/mashup/java/modules/integration: test-resources/scripts test/org/wso2/mashup/integration

svn at wso2.org svn at wso2.org
Wed Aug 22 03:04:15 PDT 2007


Author: keith
Date: Wed Aug 22 03:04:08 2007
New Revision: 6471

Modified:
   trunk/mashup/java/modules/integration/test-resources/scripts/schemaTest.js
   trunk/mashup/java/modules/integration/test/org/wso2/mashup/integration/SchemaIntegrationTest.java
Log:
Uncomment the test cases for mashup-16 and also add a new test cases.



Modified: trunk/mashup/java/modules/integration/test-resources/scripts/schemaTest.js
==============================================================================
--- trunk/mashup/java/modules/integration/test-resources/scripts/schemaTest.js	(original)
+++ trunk/mashup/java/modules/integration/test-resources/scripts/schemaTest.js	Wed Aug 22 03:04:08 2007
@@ -544,16 +544,24 @@
 
 
 // Added to test Mashup-16 (These test cases were extracted from there)
-function echoXMLNnode(payload) {
+// Test returning xml
+function echoXMLNode(payload) {
    return <successful/>;
 }
 
+// Added to test Mashup-16 (These test cases were extracted from there)
+// Test returning a list with a single element
 function echoXMLNodeList(payload) {
    return <><successful/></>;
 }
 
+// Added to test Mashup-16 (These test cases were extracted from there)
+// Test returning a list with a multiple elements
 function echoXMLNodeList2(payload) {
    return <><successful/><excess/></>;
 }
 
-
+// Test returning an empty list
+function echoXMLNodeList3(payload) {
+   return <></>;
+}
\ No newline at end of file

Modified: trunk/mashup/java/modules/integration/test/org/wso2/mashup/integration/SchemaIntegrationTest.java
==============================================================================
--- trunk/mashup/java/modules/integration/test/org/wso2/mashup/integration/SchemaIntegrationTest.java	(original)
+++ trunk/mashup/java/modules/integration/test/org/wso2/mashup/integration/SchemaIntegrationTest.java	Wed Aug 22 03:04:08 2007
@@ -199,7 +199,7 @@
         OMElement payload = staxOMBuilder.getDocumentElement();
         Options options = new Options();
         options.setTo(schemaTestEPR);
-        options.setTimeOutInMilliSeconds(10000000);
+        options.setTimeOutInMilliSeconds(10000);
         sender.setOptions(options);
         try {
             sender.sendReceive(payload);
@@ -673,49 +673,64 @@
         TestCase.assertNull(result);
     }
 
-    // Keeping these test cases commented for now. We will need to add them once we get an issue with E4X-axiom fixed.
+    // Test case taken from Mashup-16
+    public void testEchoXMLNnode() throws Exception {
+        String str = "<test/>";
+        StAXOMBuilder staxOMBuilder = new StAXOMBuilder(new ByteArrayInputStream(str.getBytes()));
+        OMElement payload = staxOMBuilder.getDocumentElement();
+        Options options = new Options();
+        options.setAction("urn:echoXMLNode");
+        options.setTo(schemaTestEPR);
+        options.setTimeOutInMilliSeconds(10000);
+        sender.setOptions(options);
+        OMElement result = sender.sendReceive(payload);
+        TestCase.assertEquals("<echoXMLNodeResponse xmlns:js=\"http://www.wso2.org/ns/jstype\" js:type=\"xml\"><successful /></echoXMLNodeResponse>",
+                result.toString());
+    }
 
-//    public void testEchoXMLNnode() throws Exception {
-//        String str = "<test/>";
-//        StAXOMBuilder staxOMBuilder = new StAXOMBuilder(new ByteArrayInputStream(str.getBytes()));
-//        OMElement payload = staxOMBuilder.getDocumentElement();
-//        Options options = new Options();
-//        options.setAction("urn:echoXMLNnode");
-//        options.setTo(schemaTestEPR);
-//        options.setTimeOutInMilliSeconds(10000);
-//        sender.setOptions(options);
-//        OMElement result = sender.sendReceive(payload);
-//        TestCase.assertEquals("<echoXMLNnodeResponse xmlns:js=\"http://www.wso2.org/ns/jstype\" js:type=\"xml\"><successful/></echoXMLNnodeResponse>",
-//                result.toString());
-//    }
-//
-//    public void testEchoXMLNnodeList() throws Exception {
-//        String str = "<test/>";
-//        StAXOMBuilder staxOMBuilder = new StAXOMBuilder(new ByteArrayInputStream(str.getBytes()));
-//        OMElement payload = staxOMBuilder.getDocumentElement();
-//        Options options = new Options();
-//        options.setAction("urn:echoXMLNodeList");
-//        options.setTo(schemaTestEPR);
-//        options.setTimeOutInMilliSeconds(10000);
-//        sender.setOptions(options);
-//        OMElement result = sender.sendReceive(payload);
-//        TestCase.assertEquals("<echoXMLNnodeListResponse xmlns:js=\"http://www.wso2.org/ns/jstype\" js:type=\"xmlList\"><successful/></echoXMLNnodeListResponse>",
-//                result.toString());
-//    }
-//
-//    public void testEchoXMLNodeList2() throws Exception {
-//        String str = "<test/>";
-//        StAXOMBuilder staxOMBuilder = new StAXOMBuilder(new ByteArrayInputStream(str.getBytes()));
-//        OMElement payload = staxOMBuilder.getDocumentElement();
-//        Options options = new Options();
-//        options.setAction("urn:echoXMLNodeList2");
-//        options.setTo(schemaTestEPR);
-//        options.setTimeOutInMilliSeconds(10000);
-//        sender.setOptions(options);
-//        OMElement result = sender.sendReceive(payload);
-//        TestCase.assertEquals("<echoXMLNodeList2Response xmlns:js=\"http://www.wso2.org/ns/jstype\" js:type=\"xml\"><><successful/><excess/></></echoXMLNodeList2Response>",
-//                result.toString());
-//    }
+    // Test case taken from Mashup-16
+    public void testEchoXMLNnodeList() throws Exception {
+        String str = "<test/>";
+        StAXOMBuilder staxOMBuilder = new StAXOMBuilder(new ByteArrayInputStream(str.getBytes()));
+        OMElement payload = staxOMBuilder.getDocumentElement();
+        Options options = new Options();
+        options.setAction("urn:echoXMLNodeList");
+        options.setTo(schemaTestEPR);
+        options.setTimeOutInMilliSeconds(10000);
+        sender.setOptions(options);
+        OMElement result = sender.sendReceive(payload);
+        TestCase.assertEquals("<echoXMLNodeListResponse xmlns:js=\"http://www.wso2.org/ns/jstype\" js:type=\"xmlList\"><successful /></echoXMLNodeListResponse>",
+                result.toString());
+    }
+
+    // Test case taken from Mashup-16
+    public void testEchoXMLNodeList2() throws Exception {
+        String str = "<test/>";
+        StAXOMBuilder staxOMBuilder = new StAXOMBuilder(new ByteArrayInputStream(str.getBytes()));
+        OMElement payload = staxOMBuilder.getDocumentElement();
+        Options options = new Options();
+        options.setAction("urn:echoXMLNodeList2");
+        options.setTo(schemaTestEPR);
+        options.setTimeOutInMilliSeconds(10000);
+        sender.setOptions(options);
+        OMElement result = sender.sendReceive(payload);
+        TestCase.assertEquals("<echoXMLNodeList2Response xmlns:js=\"http://www.wso2.org/ns/jstype\" js:type=\"xmlList\"><return><successful /><excess /></return></echoXMLNodeList2Response>",
+                result.toString());
+    }
+
+    public void testEchoXMLNodeList3() throws Exception {
+        String str = "<test/>";
+        StAXOMBuilder staxOMBuilder = new StAXOMBuilder(new ByteArrayInputStream(str.getBytes()));
+        OMElement payload = staxOMBuilder.getDocumentElement();
+        Options options = new Options();
+        options.setAction("urn:echoXMLNodeList3");
+        options.setTo(schemaTestEPR);
+        options.setTimeOutInMilliSeconds(10000);
+        sender.setOptions(options);
+        OMElement result = sender.sendReceive(payload);
+        TestCase.assertEquals("<echoXMLNodeList3Response />",
+                result.toString());
+    }
 
 }
 




More information about the Mashup-dev mailing list