Author: keith
Date: Mon Apr 21 21:54:30 2008
New Revision: 15907
Log:
Adding test cases and cleints for hasSimpleContent
Modified:
trunk/mashup/java/modules/integration/test-resources/scripts/E4XTest.js
trunk/mashup/java/modules/integration/test/org/wso2/mashup/integration/E4XTest.java
Modified:
trunk/mashup/java/modules/integration/test-resources/scripts/E4XTest.js
==============================================================================
--- trunk/mashup/java/modules/integration/test-resources/scripts/E4XTest.js
(original)
+++ trunk/mashup/java/modules/integration/test-resources/scripts/E4XTest.js
Mon Apr 21 21:54:30 2008
@@ -142,4 +142,22 @@
<employee id="1"
><name>Joe</name><age>20</age></employee>
</employees>;
return e.employee[0].hasComplexContent();
+}
+
+hasSimpleContent1.documentation="Tests the hasSimpleContent method of the E4X
XML object";
+function hasSimpleContent1(){
+ var e = <employees>
+ <employee id="0"
><name>Jim</name><age>25</age></employee>
+ <employee id="1"
><name>Joe</name><age>20</age></employee>
+ </employees>;
+ return e.employee[0].name.hasSimpleContent();
+}
+
+hasSimpleContent2.documentation="Tests the hasSimpleContent method of the E4X
XML object";
+function hasSimpleContent2(){
+ var e = <employees>
+ <employee id="0"
><name>Jim</name><age>25</age></employee>
+ <employee id="1"
><name>Joe</name><age>20</age></employee>
+ </employees>;
+ return e.employee[0].hasSimpleContent();
}
\ No newline at end of file
Modified:
trunk/mashup/java/modules/integration/test/org/wso2/mashup/integration/E4XTest.java
==============================================================================
---
trunk/mashup/java/modules/integration/test/org/wso2/mashup/integration/E4XTest.java
(original)
+++
trunk/mashup/java/modules/integration/test/org/wso2/mashup/integration/E4XTest.java
Mon Apr 21 21:54:30 2008
@@ -228,4 +228,34 @@
"xsi:type=\"xs:anyType\"><name>Jim</name></return>",
result.getFirstElement().toString());
}
+
+ /**
+ * Tests the hasSimpleContent() method of the E4X Impl
+ * @throws Exception - Thrown in case an exception occurs
+ */
+ public void testHasSimpleContent1() throws Exception {
+ Options options = new Options();
+ options.setTo(endpointReference);
+ options.setAction(
+
"http://services.mashup.wso2.org/E4XTest/ServiceInterface/hasSimpleContent1Request");
+ sender.setOptions(options);
+ OMElement result = sender.sendReceive(null);
+ // Test weather the index of the element was returned correctly
+ TestCase.assertEquals("true", result.getFirstElement().getText());
+ }
+
+ /**
+ * Tests the hasSimpleContent() method of the E4X Impl
+ * @throws Exception - Thrown in case an exception occurs
+ */
+ public void testHasSimpleContent2() throws Exception {
+ Options options = new Options();
+ options.setTo(endpointReference);
+ options.setAction(
+
"http://services.mashup.wso2.org/E4XTest/ServiceInterface/hasSimpleContent2Request");
+ sender.setOptions(options);
+ OMElement result = sender.sendReceive(null);
+ // Test weather the index of the element was returned correctly
+ TestCase.assertEquals("false", result.getFirstElement().getText());
+ }
}
\ No newline at end of file
_______________________________________________
Mashup-dev mailing list
[email protected]
http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev