Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient5.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient5.java?view=diff&rev=462701&r1=462700&r2=462701 ============================================================================== --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient5.java (original) +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/type_test/AbstractTypeTestClient5.java Tue Oct 10 22:36:24 2006 @@ -48,6 +48,8 @@ ComplexRestriction ret; if (testDocLiteral) { ret = docClient.testComplexRestriction(x, y, z); + } else if (testXMLBinding) { + ret = xmlClient.testComplexRestriction(x, y, z); } else { ret = rpcClient.testComplexRestriction(x, y, z); } @@ -61,7 +63,7 @@ } // abnormal case - if (testDocLiteral) { + if (testDocLiteral || testXMLBinding) { try { x = new ComplexRestriction(); x.setValue("string_x"); @@ -70,12 +72,13 @@ y = new Holder<ComplexRestriction>(yOrig); z = new Holder<ComplexRestriction>(); - ret = docClient.testComplexRestriction(x, y, z); + ret = testDocLiteral ? docClient.testComplexRestriction(x, y, z) + : xmlClient.testComplexRestriction(x, y, z); //fail("maxLength=10 restriction is violated."); } catch (Exception ex) { //ex.printStackTrace(); } - } + } } //org.apache.type_test.types1.ComplexRestriction2 @@ -92,6 +95,8 @@ ComplexRestriction2 ret; if (testDocLiteral) { ret = docClient.testComplexRestriction2(x, y, z); + } else if (testXMLBinding) { + ret = xmlClient.testComplexRestriction2(x, y, z); } else { ret = rpcClient.testComplexRestriction2(x, y, z); } @@ -105,7 +110,7 @@ } // abnormal case - if (testDocLiteral) { + if (testDocLiteral || testXMLBinding) { try { x = new ComplexRestriction2(); x.setValue("str_x"); @@ -114,7 +119,8 @@ y = new Holder<ComplexRestriction2>(yOrig); z = new Holder<ComplexRestriction2>(); - ret = docClient.testComplexRestriction2(x, y, z); + ret = testDocLiteral ? docClient.testComplexRestriction2(x, y, z) + : xmlClient.testComplexRestriction2(x, y, z); //fail("length=10 restriction is violated."); } catch (Exception ex) { //ex.printStackTrace(); @@ -137,6 +143,8 @@ ComplexRestriction3 ret; if (testDocLiteral) { ret = docClient.testComplexRestriction3(x, y, z); + } else if (testXMLBinding) { + ret = xmlClient.testComplexRestriction3(x, y, z); } else { ret = rpcClient.testComplexRestriction3(x, y, z); } @@ -150,18 +158,18 @@ } // abnormal cases - if (testDocLiteral) { + if (testDocLiteral || testXMLBinding) { try { x = new ComplexRestriction3(); x.setValue("str"); y = new Holder<ComplexRestriction3>(yOrig); z = new Holder<ComplexRestriction3>(); - ret = docClient.testComplexRestriction3(x, y, z); + ret = testDocLiteral ? docClient.testComplexRestriction3(x, y, z) + : xmlClient.testComplexRestriction3(x, y, z); //fail("maxLength=10 && minLength=5 restriction is violated."); } catch (Exception ex) { //ex.printStackTrace(); } - try { x = new ComplexRestriction3(); x.setValue("string_x"); @@ -169,13 +177,13 @@ yOrig.setValue("string_yyyyyy"); y = new Holder<ComplexRestriction3>(yOrig); z = new Holder<ComplexRestriction3>(); - - ret = docClient.testComplexRestriction3(x, y, z); + ret = testDocLiteral ? docClient.testComplexRestriction3(x, y, z) + : xmlClient.testComplexRestriction3(x, y, z); //fail("maxLength=10 && minLength=5 restriction is violated."); } catch (Exception ex) { //ex.printStackTrace(); } - } + } } //org.apache.type_test.types1.ComplexRestriction4 @@ -193,6 +201,8 @@ ComplexRestriction4 ret; if (testDocLiteral) { ret = docClient.testComplexRestriction4(x, y, z); + } else if (testXMLBinding) { + ret = xmlClient.testComplexRestriction4(x, y, z); } else { ret = rpcClient.testComplexRestriction4(x, y, z); } @@ -206,14 +216,14 @@ } // abnormal case - if (testDocLiteral) { + if (testDocLiteral || testXMLBinding) { try { x = new ComplexRestriction4(); x.setValue("str_xxx"); y = new Holder<ComplexRestriction4>(yOrig); z = new Holder<ComplexRestriction4>(); - - ret = docClient.testComplexRestriction4(x, y, z); + ret = testDocLiteral ? docClient.testComplexRestriction4(x, y, z) + : xmlClient.testComplexRestriction4(x, y, z); //fail("maxLength=5 restriction is violated."); } catch (Exception ex) { //ex.printStackTrace(); @@ -235,6 +245,8 @@ ComplexRestriction5 ret; if (testDocLiteral) { ret = docClient.testComplexRestriction5(x, y, z); + } else if (testXMLBinding) { + ret = xmlClient.testComplexRestriction5(x, y, z); } else { ret = rpcClient.testComplexRestriction5(x, y, z); } @@ -248,7 +260,7 @@ } // abnormal cases - if (testDocLiteral) { + if (testDocLiteral || testXMLBinding) { try { x = new ComplexRestriction5(); x.setValue("uri"); @@ -267,7 +279,8 @@ yOrig.setValue("http://www.iona.com/info/services/oss/info_services_oss_train.html"); y = new Holder<ComplexRestriction5>(yOrig); z = new Holder<ComplexRestriction5>(); - ret = docClient.testComplexRestriction5(x, y, z); + ret = testDocLiteral ? docClient.testComplexRestriction5(x, y, z) + : xmlClient.testComplexRestriction5(x, y, z); //fail("maxLength=50 && minLength=5 restriction is violated."); } catch (Exception ex) { //ex.printStackTrace();
Modified: incubator/cxf/trunk/testutils/pom.xml URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/pom.xml?view=diff&rev=462701&r1=462700&r2=462701 ============================================================================== --- incubator/cxf/trunk/testutils/pom.xml (original) +++ incubator/cxf/trunk/testutils/pom.xml Tue Oct 10 22:36:24 2006 @@ -102,12 +102,21 @@ out="${generated.resources.test}/wsdl/type_test/type_test_doclit.wsdl"> <param name="inc_xsd_path" expression="."/> <param name="use_style" expression="document"/> + <param name="tns_suffix" expression="doc"/> </xslt> <xslt style="${test.resources.dir}/wsdl/type_test/type_test_wsdl.xsl" in="${test.resources.dir}/wsdl/type_test/type_test.xsd" out="${generated.resources.test}/wsdl/type_test/type_test_rpclit.wsdl"> <param name="inc_xsd_path" expression="."/> <param name="use_style" expression="rpc"/> + <param name="tns_suffix" expression="rpc"/> + </xslt> + <xslt style="${test.resources.dir}/wsdl/type_test/type_test_wsdl.xsl" + in="${test.resources.dir}/wsdl/type_test/type_test.xsd" + out="${generated.resources.test}/wsdl/type_test/type_test_xml_inc.wsdl"> + <param name="inc_xsd_path" expression="."/> + <param name="use_style" expression="document"/> + <param name="tns_suffix" expression="xml"/> </xslt> <xslt style="${test.resources.dir}/wsdl/type_test/type_test_xml_wsdl.xsl" in="${test.resources.dir}/wsdl/type_test/type_test.xsd" @@ -219,7 +228,7 @@ <wsdlOption> <wsdl>${basedir}/target/generated/src/main/resources/wsdl/type_test/type_test_xml.wsdl</wsdl> <dependencies> - <dependency>${basedir}/target/generated/src/main/resources/wsdl/type_test/type_test_doclit.wsdl</dependency> + <dependency>${basedir}/target/generated/src/main/resources/wsdl/type_test/type_test_xml_inc.wsdl</dependency> <dependency>${basedir}/target/generated/src/main/resources/wsdl/type_test/type_test_1.xsd</dependency> <dependency>${basedir}/target/generated/src/main/resources/wsdl/type_test/type_test_2.xsd</dependency> <dependency>${basedir}/target/generated/src/main/resources/wsdl/type_test/type_test_3.xsd</dependency> Modified: incubator/cxf/trunk/testutils/src/main/resources/wsdl/type_test/type_test_wsdl.xsl URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/resources/wsdl/type_test/type_test_wsdl.xsl?view=diff&rev=462701&r1=462700&r2=462701 ============================================================================== --- incubator/cxf/trunk/testutils/src/main/resources/wsdl/type_test/type_test_wsdl.xsl (original) +++ incubator/cxf/trunk/testutils/src/main/resources/wsdl/type_test/type_test_wsdl.xsl Tue Oct 10 22:36:24 2006 @@ -12,9 +12,13 @@ <!-- Parameter: Path to the generated XSDs to include --> <xsl:param name="inc_xsd_path"/> + <!-- Parameter: Use document-literal 'document' or rpc-literal 'rpc' style --> <xsl:param name="use_style"/> + <!-- Parameter: Target name space suffix --> + <xsl:param name="tns_suffix"/> + <!-- copy attributes from any node --> <xsl:template match="@*" mode="attribute_copy"> <xsl:attribute name="{name(.)}"> @@ -24,7 +28,7 @@ <!-- 0 - root schema node --> <xsl:template match="/xsd:schema"> - <xsl:if test="$use_style='document'"> + <xsl:if test="$tns_suffix='doc'"> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://apache.org/type_test/doc" @@ -36,7 +40,7 @@ <xsl:apply-templates select="." mode="test_portType"/> </definitions> </xsl:if> - <xsl:if test="$use_style='rpc'"> + <xsl:if test="$tns_suffix='rpc'"> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:x1="http://apache.org/type_test/types1" @@ -51,6 +55,21 @@ <xsl:apply-templates select="." mode="test_portType"/> </definitions> </xsl:if> + <xsl:if test="$tns_suffix='xml'"> + <definitions + xmlns="http://schemas.xmlsoap.org/wsdl/" + xmlns:x1="http://apache.org/type_test/types1" + xmlns:x2="http://apache.org/type_test/types2" + xmlns:x3="http://apache.org/type_test/types3" + xmlns:tns="http://apache.org/type_test/xml" + targetNamespace="http://apache.org/type_test/xml" + name="type_test"> + <xsl:apply-templates select="@*[name(.)!='elementFormDefault']" mode="attribute_copy"/> + <xsl:apply-templates select="." mode="schema"/> + <xsl:apply-templates select="." mode="test_messages"/> + <xsl:apply-templates select="." mode="test_portType"/> + </definitions> + </xsl:if> </xsl:template> <!-- 1 - schema --> @@ -64,11 +83,14 @@ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"> <xsl:attribute name="targetNamespace"> - <xsl:if test="$use_style='document'"> + <xsl:if test="$tns_suffix='doc'"> <xsl:value-of select="'http://apache.org/type_test/doc'"/> </xsl:if> - <xsl:if test="$use_style='rpc'"> + <xsl:if test="$tns_suffix='rpc'"> <xsl:value-of select="'http://apache.org/type_test/rpc'"/> + </xsl:if> + <xsl:if test="$tns_suffix='xml'"> + <xsl:value-of select="'http://apache.org/type_test/xml'"/> </xsl:if> </xsl:attribute> <!-- Modified: incubator/cxf/trunk/testutils/src/main/resources/wsdl/type_test/type_test_xml_wsdl.xsl URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/resources/wsdl/type_test/type_test_xml_wsdl.xsl?view=diff&rev=462701&r1=462700&r2=462701 ============================================================================== --- incubator/cxf/trunk/testutils/src/main/resources/wsdl/type_test/type_test_xml_wsdl.xsl (original) +++ incubator/cxf/trunk/testutils/src/main/resources/wsdl/type_test/type_test_xml_wsdl.xsl Tue Oct 10 22:36:24 2006 @@ -32,8 +32,8 @@ <xsl:template match="/xsd:schema"> <wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/" - xmlns:tns="http://apache.org/type_test/doc" - targetNamespace="http://apache.org/type_test/doc" + xmlns:tns="http://apache.org/type_test/xml" + targetNamespace="http://apache.org/type_test/xml" name="type_test_xml"> <xsl:apply-templates select="@*[name(.)!='elementFormDefault']" mode="attribute_copy"/> <xsl:apply-templates select="." mode="test_binding"/> @@ -43,7 +43,7 @@ <!-- 1 - test binding and service --> <xsl:template match="/xsd:schema" mode="test_binding" xmlns="http://schemas.xmlsoap.org/wsdl/"> - <wsdl:import namespace="http://apache.org/type_test/doc" location="type_test_doclit.wsdl"/> + <wsdl:import namespace="http://apache.org/type_test/xml" location="./type_test_xml_inc.wsdl"/> <wsdl:binding type="tns:TypeTestPortType" name="TypeTestXML"> <xformat:binding/> @@ -51,7 +51,7 @@ <xsl:apply-templates select="itst:it_test_group" mode="test_operations_group"/> </wsdl:binding> <wsdl:service name="XMLService"> - <wsdl:port name="XMLPPort"> + <wsdl:port name="XMLPort"> <xsl:attribute name="binding" xmlns="http://schemas.xmlsoap.org/"> <xsl:value-of select="'tns:TypeTestXML'"/> </xsl:attribute>
