Author: keith Date: Wed Jun 25 23:25:55 2008 New Revision: 18645 URL: http://wso2.org/svn/browse/wso2?view=rev&revision=18645
Log: More fixex for Mashup-886 Modified: trunk/mashup/java/modules/integration/test/org/wso2/mashup/integration/SchemaIntegrationTest.java Modified: trunk/mashup/java/modules/integration/test/org/wso2/mashup/integration/SchemaIntegrationTest.java URL: http://wso2.org/svn/browse/wso2/trunk/mashup/java/modules/integration/test/org/wso2/mashup/integration/SchemaIntegrationTest.java?rev=18645&r1=18644&r2=18645&view=diff ============================================================================== --- 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 Jun 25 23:25:55 2008 @@ -720,6 +720,39 @@ innerElement.detach(); TestCase.assertEquals(calendar.getTimeInMillis(), resultCalendar.getTimeInMillis()); + innerElement = result.getFirstChildWithName(new QName( + "http://services.mashup.wso2.org/schemaTest?xsd", + "echoComplexCompositionsResponseTypecomplex1Type")) + .getFirstChildWithName(new QName("", "nested3")); + innerElement.detach(); + + TestCase.assertTrue(innerElement.getAttribute(jsQName).equals( + omFactory.createOMAttribute("type", jsNamespace, "array"))); + innerElement = innerElement.getFirstElement(); + TestCase.assertTrue(innerElement.getAttribute(jsQName).equals( + omFactory.createOMAttribute("type", jsNamespace, "xml"))); + TestCase.assertTrue(innerElement.getAttribute(xsiQName).equals( + omFactory.createOMAttribute("type", xsiNamespace, "xs:anyType"))); + TestCase.assertEquals("<test>just some text</test>", + innerElement.getFirstElement().toString()); + + OMElement firstChildWithName = result.getFirstChildWithName(new QName( + "http://services.mashup.wso2.org/schemaTest?xsd", + "echoComplexCompositionsResponseTypecomplex2Type")); + innerElement = firstChildWithName + .getFirstChildWithName(new QName("", "anotherNested")); + firstChildWithName.detach(); + + TestCase.assertTrue(innerElement.getAttribute(jsQName).equals( + omFactory.createOMAttribute("type", jsNamespace, "array"))); + innerElement = innerElement.getFirstElement(); + TestCase.assertTrue(innerElement.getAttribute(jsQName).equals( + omFactory.createOMAttribute("type", jsNamespace, "xml"))); + TestCase.assertTrue(innerElement.getAttribute(xsiQName).equals( + omFactory.createOMAttribute("type", xsiNamespace, "xs:anyType"))); + TestCase.assertEquals("<test>just some text</test>", + innerElement.getFirstElement().toString()); + TestCase.assertEquals( "<ws:echoComplexCompositionsResponse xmlns:ws=\"http://services.mashup.wso2.org/schemaTest?xsd\">" + "<simple1>testParam</simple1>" + @@ -728,16 +761,8 @@ "<ws:echoComplexCompositionsResponseTypecomplex1Type>" + "<nested2>true</nested2>" + "<nested2>true</nested2>" + - "<nested3 xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:js=\"http://www.wso2.org/ns/jstype\" js:type=\"array\">" + - "<item js:type=\"xml\" xsi:type=\"xs:anyType\"><test>just some text</test></item>" + - "</nested3>" + "<nested1>10.0</nested1>" + "</ws:echoComplexCompositionsResponseTypecomplex1Type>" + - "<ws:echoComplexCompositionsResponseTypecomplex2Type>" + - "<anotherNested xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:js=\"http://www.wso2.org/ns/jstype\" js:type=\"array\">" + - "<item js:type=\"xml\" xsi:type=\"xs:anyType\"><test>just some text</test></item>" + - "</anotherNested>" + - "</ws:echoComplexCompositionsResponseTypecomplex2Type>" + "<simple4>true</simple4>" + "</ws:echoComplexCompositionsResponse>", result.toString()); @@ -878,9 +903,14 @@ options.setTimeOutInMilliSeconds(10000); sender.setOptions(options); OMElement result = sender.sendReceive(payload); - TestCase.assertEquals( - "<return xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:js=\"http://www.wso2.org/ns/jstype\" js:type=\"xmlList\" xsi:type=\"xs:anyType\"><successful /><excess /></return>", - result.getFirstElement().toString()); + OMElement element = result.getFirstElement(); + TestCase.assertTrue(element.getAttribute(jsQName).equals( + omFactory.createOMAttribute("type", jsNamespace, "xmlList"))); + TestCase.assertTrue(element.getAttribute(xsiQName).equals( + omFactory.createOMAttribute("type", xsiNamespace, "xs:anyType"))); + OMElement omElement = element.getFirstElement(); + TestCase.assertNotNull(omElement); + TestCase.assertNotNull(omElement.getNextOMSibling()); } public void testEchoXMLNodeList3() throws Exception { _______________________________________________ Mashup-dev mailing list [email protected] http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev
