You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by aj...@apache.org on 2005/11/29 11:55:44 UTC

svn commit: r349705 - in /webservices/axis2/trunk/java/modules: codegen/ codegen/test-resources/xsd/ codegen/test-resources/xsd/simple/ codegen/test/org/apache/axis2/databinding/schema/compile/simple/ codegen/test/org/apache/axis2/databinding/schema/po...

Author: ajith
Date: Tue Nov 29 02:55:04 2005
New Revision: 349705

URL: http://svn.apache.org/viewcvs?rev=349705&view=rev
Log:
1.Added some testcases and resources to test the ADB functionality (Need a whole lot of these to test ADB right)
2.Updated the maven.xml in the codegen module
3.Removed some of the unused WSDL resources in the WSDL module

Added:
    webservices/axis2/trunk/java/modules/codegen/test-resources/xsd/simple/
    webservices/axis2/trunk/java/modules/codegen/test-resources/xsd/simple/simpleType-Month.xsd
    webservices/axis2/trunk/java/modules/codegen/test-resources/xsd/simple/simpleType-Year.xsd
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/compile/simple/
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/compile/simple/SimpleTypegMonthTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/compile/simple/SimpleTypegYearTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/AbstractSimplePopulater.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypegMonthPopulateTest.java
    webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypegYearPopulateTest.java
Removed:
    webservices/axis2/trunk/java/modules/codegen/test-resources/xsd/import3.xsd
    webservices/axis2/trunk/java/modules/wsdl/test-resources/SalesRankNPrice.wsdl
    webservices/axis2/trunk/java/modules/wsdl/test-resources/complex-doc-literal.wsdl
    webservices/axis2/trunk/java/modules/wsdl/test-resources/compound1.wsdl
    webservices/axis2/trunk/java/modules/wsdl/test-resources/compound2.wsdl
    webservices/axis2/trunk/java/modules/wsdl/test-resources/dime-doc.wsdl
    webservices/axis2/trunk/java/modules/wsdl/test-resources/headers.wsdl
    webservices/axis2/trunk/java/modules/wsdl/test-resources/iotest.wsdl
    webservices/axis2/trunk/java/modules/wsdl/test-resources/mime-doc.wsdl
    webservices/axis2/trunk/java/modules/wsdl/test-resources/mtomecho.wsdl
    webservices/axis2/trunk/java/modules/wsdl/test-resources/no-service.wsdl
    webservices/axis2/trunk/java/modules/wsdl/test-resources/ping-mod.xsd
    webservices/axis2/trunk/java/modules/wsdl/test-resources/ping-modified.wsdl
    webservices/axis2/trunk/java/modules/wsdl/test-resources/ping-unbound.wsdl
    webservices/axis2/trunk/java/modules/wsdl/test-resources/ping.wsdl
    webservices/axis2/trunk/java/modules/wsdl/test-resources/simple-doc-literal.wsdl
    webservices/axis2/trunk/java/modules/wsdl/test-resources/wsat.wsdl
    webservices/axis2/trunk/java/modules/wsdl/test-resources/wsat.xsd
Modified:
    webservices/axis2/trunk/java/modules/codegen/maven.xml

Modified: webservices/axis2/trunk/java/modules/codegen/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/maven.xml?rev=349705&r1=349704&r2=349705&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/codegen/maven.xml Tue Nov 29 02:55:04 2005
@@ -3,22 +3,22 @@
 <!-- $Revision: 1.21 $ $Date: 2004-10-27 20:54:09 +0600 (Wed, 27 Oct 2004) $ -->
 
 <project default="jar"
-    xmlns:j="jelly:core"
-    xmlns:u="jelly:util"
-    xmlns:maven="jelly:maven"
-    xmlns:util="jelly:util"
-    xmlns:deploy="deploy"
-    xmlns:ant="jelly:ant">
+         xmlns:j="jelly:core"
+         xmlns:u="jelly:util"
+         xmlns:maven="jelly:maven"
+         xmlns:util="jelly:util"
+         xmlns:deploy="deploy"
+         xmlns:ant="jelly:ant">
 
     <postGoal name="java:jar-resources">
-      <tstamp>
-        <format property="build.time" pattern="MMM dd, yyyy (hh:mm:ss z)" locale="en"/>
-      </tstamp>
-      <replace dir="${maven.build.dest}/org/apache/axis2/wsdl/template/java/">
-        <include name="*.xsl"/>
-        <replacefilter token="#today#" value="${build.time}"/>
-        <replacefilter token="#axisVersion#" value="${pom.currentVersion}"/>
-      </replace>
+        <tstamp>
+            <format property="build.time" pattern="MMM dd, yyyy (hh:mm:ss z)" locale="en"/>
+        </tstamp>
+        <replace dir="${maven.build.dest}/org/apache/axis2/wsdl/template/java/">
+            <include name="*.xsl"/>
+            <replacefilter token="#today#" value="${build.time}"/>
+            <replacefilter token="#axisVersion#" value="${pom.currentVersion}"/>
+        </replace>
     </postGoal>
 
     <preGoal name="itest:compile">
@@ -28,9 +28,9 @@
         </j:if>
     </preGoal>
 
-     <!-- run the schema compiler -->
-   <postGoal name="test:compile">
-     <j:if test="context.getVariable('maven.test.skip') != 'true'}">
+    <!-- run the schema compiler -->
+    <postGoal name="test:compile">
+     <!--<j:if test="context.getVariable('maven.test.skip') != 'true'}">-->
 
         <j:set var="compiled.classes.dir" value="target/classes"/>   <!-- Theres got to be a better way to do this -->
         <j:set var="schema.source.dir" value="test-resources/xsd"/>
@@ -41,29 +41,47 @@
         <mkdir dir="${schema.output.base.dir}"/>
         <mkdir dir="${schema.generated.src.dir}"/>
         <mkdir dir="${schema.generated.classes.dir}"/>
-       <!-- Run schema compiler with designated schemas -->
-       <!-- simple max occurs 2 xsd -->
+        <!-- Run schema compiler with designated schemas -->
+        <!-- simple max occurs 2 xsd -->
         <java classname="org.apache.axis2.databinding.schema.XSD2Java" fork="true">
-			<classpath refid="maven.dependency.classpath"/>
-			<classpath location="${compiled.classes.dir}"/>
+            <classpath refid="maven.dependency.classpath"/>
+            <classpath location="${compiled.classes.dir}"/>
             <arg file="${schema.source.dir}/simple_maxOccurs2.xsd"/>
             <arg file="${schema.generated.src.dir}"/>
         </java>
-         <!-- anon complex type xsd -->
+        <!-- anon complex type xsd -->
         <java classname="org.apache.axis2.databinding.schema.XSD2Java" fork="true">
-			<classpath refid="maven.dependency.classpath"/>
-			<classpath location="${compiled.classes.dir}"/>
+            <classpath refid="maven.dependency.classpath"/>
+            <classpath location="${compiled.classes.dir}"/>
             <arg file="${schema.source.dir}/anonymous_complexType.xsd"/>
             <arg file="${schema.generated.src.dir}"/>
         </java>
         <!-- simple max occurs xsd -->
         <java classname="org.apache.axis2.databinding.schema.XSD2Java" fork="true">
-			<classpath refid="maven.dependency.classpath"/>
-			<classpath location="${compiled.classes.dir}"/>
+            <classpath refid="maven.dependency.classpath"/>
+            <classpath location="${compiled.classes.dir}"/>
             <arg file="${schema.source.dir}/simple_maxOccurs.xsd"/>
             <arg file="${schema.generated.src.dir}"/>
         </java>
-       <!-- Compile the generated classes -->
+
+        <!-- ################################################################### -->
+        <!-- simple gMonth xsd -->
+        <java classname="org.apache.axis2.databinding.schema.XSD2Java" fork="true">
+            <classpath refid="maven.dependency.classpath"/>
+            <classpath location="${compiled.classes.dir}"/>
+            <arg file="${schema.source.dir}/simple/simpleType-Month.xsd"/>
+            <arg file="${schema.generated.src.dir}"/>
+        </java>
+
+         <!-- simple gYear xsd -->
+        <java classname="org.apache.axis2.databinding.schema.XSD2Java" fork="true">
+            <classpath refid="maven.dependency.classpath"/>
+            <classpath location="${compiled.classes.dir}"/>
+            <arg file="${schema.source.dir}/simple/simpleType-Year.xsd"/>
+            <arg file="${schema.generated.src.dir}"/>
+        </java>
+        <!-- ################################################################### -->
+        <!-- Compile the generated classes -->
         <javac destdir="${schema.generated.classes.dir}" srcdir="${schema.generated.src.dir}">
             <classpath refid="maven.dependency.classpath"></classpath>
             <classpath location="${compiled.classes.dir}"></classpath>
@@ -71,7 +89,7 @@
 
         <ant:path id="schema.generated.classes.dir" location="${schema.generated.classes.dir}"/>
         <maven:addPath id="maven.dependency.classpath" refid="schema.generated.classes.dir"/>
-      </j:if>
+      <!--</j:if>-->
     </postGoal>
 
 </project>

Added: webservices/axis2/trunk/java/modules/codegen/test-resources/xsd/simple/simpleType-Month.xsd
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test-resources/xsd/simple/simpleType-Month.xsd?rev=349705&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test-resources/xsd/simple/simpleType-Month.xsd (added)
+++ webservices/axis2/trunk/java/modules/codegen/test-resources/xsd/simple/simpleType-Month.xsd Tue Nov 29 02:55:04 2005
@@ -0,0 +1,7 @@
+<schema targetNamespace="http://soapinterop.org/xsd"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd1="http://soapinterop.org/xsd"
+        elementFormDefault="qualified">
+    <element name="monthParam" type="xsd:gMonth"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/codegen/test-resources/xsd/simple/simpleType-Year.xsd
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test-resources/xsd/simple/simpleType-Year.xsd?rev=349705&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test-resources/xsd/simple/simpleType-Year.xsd (added)
+++ webservices/axis2/trunk/java/modules/codegen/test-resources/xsd/simple/simpleType-Year.xsd Tue Nov 29 02:55:04 2005
@@ -0,0 +1,7 @@
+<schema targetNamespace="http://soapinterop.org/xsd"
+        xmlns="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+        xmlns:xsd1="http://soapinterop.org/xsd"
+        elementFormDefault="qualified">
+    <element name="yearParam" type="xsd:gYear"/>
+</schema>
\ No newline at end of file

Added: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/compile/simple/SimpleTypegMonthTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/compile/simple/SimpleTypegMonthTest.java?rev=349705&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/compile/simple/SimpleTypegMonthTest.java (added)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/compile/simple/SimpleTypegMonthTest.java Tue Nov 29 02:55:04 2005
@@ -0,0 +1,26 @@
+package org.apache.axis2.databinding.schema.compile.simple;
+
+import org.apache.axis2.databinding.schema.compile.AbstractSchemaCompilerTester;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class SimpleTypegMonthTest extends AbstractSchemaCompilerTester {
+
+    protected void setUp() throws Exception {
+        this.fileName = "test-resources/xsd/simple/simpleType-Month.xsd";
+        super.setUp();
+    }
+}

Added: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/compile/simple/SimpleTypegYearTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/compile/simple/SimpleTypegYearTest.java?rev=349705&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/compile/simple/SimpleTypegYearTest.java (added)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/compile/simple/SimpleTypegYearTest.java Tue Nov 29 02:55:04 2005
@@ -0,0 +1,26 @@
+package org.apache.axis2.databinding.schema.compile.simple;
+
+import org.apache.axis2.databinding.schema.compile.AbstractSchemaCompilerTester;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class SimpleTypegYearTest extends AbstractSchemaCompilerTester {
+
+    protected void setUp() throws Exception {
+        this.fileName = "test-resources/xsd/simple/simpleType-Year.xsd";
+        super.setUp();
+    }
+}

Added: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/AbstractSimplePopulater.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/AbstractSimplePopulater.java?rev=349705&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/AbstractSimplePopulater.java (added)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/AbstractSimplePopulater.java Tue Nov 29 02:55:04 2005
@@ -0,0 +1,42 @@
+package org.apache.axis2.databinding.schema.populate.simple;
+
+import junit.framework.TestCase;
+
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLInputFactory;
+import java.io.ByteArrayInputStream;
+import java.lang.reflect.Method;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public abstract class AbstractSimplePopulater extends TestCase {
+
+    // force others to implement this method
+    public abstract void testPopulate() throws Exception;
+
+    // Simple reusable method to make object instances via reflection
+    protected Object process(String testString,String className) throws Exception{
+        XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new ByteArrayInputStream(testString.getBytes()));
+        Class clazz = Class.forName(className);
+        Method parseMethod = clazz.getMethod("parse",new Class[]{XMLStreamReader.class});
+        Object obj = parseMethod.invoke(null,new Object[]{reader});
+        assertNotNull(obj);
+
+        return obj;
+
+
+    }
+}

Added: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypegMonthPopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypegMonthPopulateTest.java?rev=349705&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypegMonthPopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypegMonthPopulateTest.java Tue Nov 29 02:55:04 2005
@@ -0,0 +1,43 @@
+package org.apache.axis2.databinding.schema.populate.simple;
+
+import junit.framework.TestCase;
+
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLInputFactory;
+import java.io.ByteArrayInputStream;
+import java.lang.reflect.Method;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class SimpleTypegMonthPopulateTest  extends AbstractSimplePopulater {
+    private String xmlString[] = {
+            "<monthParam>--01--</monthParam>",
+            "<monthParam>--12--+02:50</monthParam>",
+            "<monthParam>--03---03:00</monthParam>"
+    };
+
+    /**
+     *  test the poplate methos=d
+     */
+    public void testPopulate() throws Exception{
+       process(xmlString[0],"org.soapinterop.monthParam");
+       process(xmlString[1],"org.soapinterop.monthParam");
+       process(xmlString[2],"org.soapinterop.monthParam");
+
+    }
+
+
+}

Added: webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypegYearPopulateTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypegYearPopulateTest.java?rev=349705&view=auto
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypegYearPopulateTest.java (added)
+++ webservices/axis2/trunk/java/modules/codegen/test/org/apache/axis2/databinding/schema/populate/simple/SimpleTypegYearPopulateTest.java Tue Nov 29 02:55:04 2005
@@ -0,0 +1,30 @@
+package org.apache.axis2.databinding.schema.populate.simple;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+public class SimpleTypegYearPopulateTest extends AbstractSimplePopulater{
+    private String xmlString[] = {
+            "<yearParam>0001</yearParam>",
+            "<yearParam>-0234</yearParam>",
+            "<yearParam>1978</yearParam>"
+    };
+    // force others to implement this method
+    public void testPopulate() throws Exception {
+        process(xmlString[0],"org.soapinterop.yearParam");
+        process(xmlString[1],"org.soapinterop.yearParam");
+        process(xmlString[2],"org.soapinterop.yearParam");
+    }
+}