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 to...@apache.org on 2005/06/16 16:55:54 UTC

cvs commit: ws-axis/java/test/wsdl/query deploy.wsdd QueryBean.java QueryTest.java QueryTestSoapBindingImpl.java undeploy.wsdd build.xml FileGenWrappedTestCase.java QueryTestServiceTestCase.java QueryTest.wsdl QueryTestBindingImpl.java

tomj        2005/06/16 07:55:54

  Modified:    java/test/wsdl/query build.xml FileGenWrappedTestCase.java
                        QueryTestServiceTestCase.java
  Added:       java/test/wsdl/query deploy.wsdd QueryBean.java
                        QueryTest.java QueryTestSoapBindingImpl.java
                        undeploy.wsdd
  Removed:     java/test/wsdl/query QueryTest.wsdl
                        QueryTestBindingImpl.java
  Log:
  Update the Query test to more closely match the problems we are checking for:
  - Generate the WSDL from Java code, including the QueryBean
  - Do not include array mappings in deploy.wsdd (use a static one).
  - Use my QueryBean, not the generated one on the client.
  
  This still passes, so life is good.
  
  Revision  Changes    Path
  1.2       +42 -8     ws-axis/java/test/wsdl/query/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/query/build.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- build.xml	7 Jun 2005 18:31:32 -0000	1.1
  +++ build.xml	16 Jun 2005 14:55:54 -0000	1.2
  @@ -50,35 +50,69 @@
   
       <target name="compile">
           <echo message="Compiling test.wsdl.query"/>
  -        <!-- QueryTest Test -->
  -        <wsdl2java url="${axis.home}/test/wsdl/query/QueryTest.wsdl"
  +
  +        <!-- Query Test -->
  +        <!-- Copy Service and QueryBean  -->
  +        <copy todir="${build.dir}/work/${componentName}" overwrite="yes">
  +            <fileset dir="${test.dir}/wsdl/query">
  +                <include name="QueryTest.java"/>
  +                <include name="QueryBean.java"/>
  +            </fileset>
  +        </copy>
  +
  +        <!-- Compile the Web Service -->
  +        <javac srcdir="${build.dir}/work" destdir="${build.dest}" debug="${debug}" nowarn="${nowarn}" source="${source}" fork="${javac.fork}">
  +            <classpath refid="classpath" />
  +            <include name="test/wsdl/query/**.java" />
  +            <exclude name="test/wsdl/query/*TestCase.java" />
  +            <exclude name="test/wsdl/query/*Impl.java" />
  +            <exclude name="test/wsdl/query/*Stub.java" />
  +            <exclude name="test/wsdl/query/*Locator.java" />
  +        </javac>
  +
  +        <!-- Now create the real WSDL file -->
  +        <java2wsdl output="${axis.home}/build/work/${componentName}/QueryTest.wsdl"
  +            className= "test.wsdl.query.QueryTest"
  +            style="wrapped"
  +            useInheritedMethods="false"
  +            namespace="http://query.wsdl.test"
  +            location="http://localhost:8080/axis/services/QueryTest">
  +        </java2wsdl>
  +
  +        <!-- Delete the intermediate class files so we recreate over a clean slate -->
  +        <delete dir="${build.dir}/classes/test/wsdl/query"/>
  +
  +        <wsdl2java url="${axis.home}/build/work/${componentName}/QueryTest.wsdl"
               output="${axis.home}/build/work"
               deployscope="session"
               serverSide="yes"
               skeletonDeploy="no"
               verbose="no"
               testcase="no">
  -            <mapping namespace="urn:QueryTest" package="test.wsdl.query"/>
  -            <mapping namespace="http://rpc.xml.coldfusion" package="test.wsdl.query"/>
           </wsdl2java>
   
  +        <!-- copy test files over to work directory, including a static deploy
  +             file that does not have arrayMapings in it -->
           <copy todir="${build.dir}/work/test/wsdl/query" overwrite="yes">
               <fileset dir="${axis.home}/test/wsdl/query">
  -                <include name="QueryBean.java"/>
  -                <include name="*TestCase.java"/>
                   <include name="*Impl.java"/>
  +                <include name="*TestCase.java"/>
  +                <include name="**.wsdd"/>
               </fileset>
           </copy>
  +
  +        <!-- copy the file generation test files -->
           <copy todir="${build.dir}/work/test/" overwrite="yes">
               <fileset dir="${axis.home}/test/">
  -                <include name="*.java"/>
  +                <include name="*Impl.java"/>
  +                <include name="*TestCase.java"/>
               </fileset>
           </copy>
   
           <javac srcdir="${build.dir}/work" destdir="${build.dest}" nowarn="${nowarn}" source="${source}" fork="${javac.fork}"
               debug="${debug}">
               <classpath refid="classpath"/>
  - 		    <include name="test/*.java" />
  +            <include name="test/*.java" />
               <include name="test/wsdl/query/*.java"/>
           </javac>
   
  
  
  
  1.3       +3 -2      ws-axis/java/test/wsdl/query/FileGenWrappedTestCase.java
  
  Index: FileGenWrappedTestCase.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/query/FileGenWrappedTestCase.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FileGenWrappedTestCase.java	8 Jun 2005 03:02:45 -0000	1.2
  +++ FileGenWrappedTestCase.java	16 Jun 2005 14:55:54 -0000	1.3
  @@ -40,12 +40,13 @@
           HashSet set = new HashSet();
           set.add("QueryBean.java");
           set.add("QueryTest.java");
  -        set.add("QueryTestBindingImpl.java");
  -        set.add("QueryTestBindingStub.java");
  +        set.add("QueryTestSoapBindingImpl.java");
  +        set.add("QueryTestSoapBindingStub.java");
           set.add("QueryTestService.java");
           set.add("QueryTestServiceLocator.java");
           set.add("QueryTestServiceTestCase.java");
           set.add("FileGenWrappedTestCase.java");
  +        set.add("QueryTest.wsdl");
           set.add("deploy.wsdd");
           set.add("undeploy.wsdd");
           return set;
  
  
  
  1.2       +9 -29     ws-axis/java/test/wsdl/query/QueryTestServiceTestCase.java
  
  Index: QueryTestServiceTestCase.java
  ===================================================================
  RCS file: /home/cvs/ws-axis/java/test/wsdl/query/QueryTestServiceTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- QueryTestServiceTestCase.java	7 Jun 2005 18:31:32 -0000	1.1
  +++ QueryTestServiceTestCase.java	16 Jun 2005 14:55:54 -0000	1.2
  @@ -21,9 +21,9 @@
   
   
       public void test2QueryTestEchoQuery() throws Exception {
  -        test.wsdl.query.QueryTestBindingStub binding;
  +        test.wsdl.query.QueryTestSoapBindingStub binding;
           try {
  -            binding = (test.wsdl.query.QueryTestBindingStub)
  +            binding = (test.wsdl.query.QueryTestSoapBindingStub)
                             new test.wsdl.query.QueryTestServiceLocator().getQueryTest();
           }
           catch (javax.xml.rpc.ServiceException jre) {
  @@ -36,7 +36,7 @@
           // Time out after a minute
           binding.setTimeout(60000);
   
  -        // Test operation
  +        // Set up input data
           test.wsdl.query.QueryBean inQuery = new QueryBean();
           String[] columns = new String[] {"first", "last", "number"};
           Object[][] data = new Object[][] { {new String("Joe"), new String("Blow"), new Integer(3)},
  @@ -44,15 +44,18 @@
           inQuery.setColumnList(columns);
           inQuery.setData(data);
   
  +        // Do the operation
           QueryBean outQuery = binding.echoQuery(inQuery);
  -        assertNotNull("return value is null", outQuery);
  +
  +        // Check the results
  +        assertNotNull("return value from echoQuery is null", outQuery);
           String[] outCols = outQuery.getColumnList();
  -        assertNotNull("column list is null", outCols);
  +        assertNotNull("column list in the returned Query is null, should have string array in it", outCols);
           assertEquals("column value #1 doesn't match", columns[0], outCols[0]);
           assertEquals("column value #2 doesn't match", columns[1], outCols[1]);
           assertEquals("column value #3 doesn't match", columns[2], outCols[2]);
           Object[][] outData = outQuery.getData();
  -        assertNotNull("data arrayt is null", outData);
  +        assertNotNull("data array in the returned Query is null, should have Query data in it", outData);
           assertEquals("data value 0,0 doesn't match", data[0][0], outData[0][0]);
           assertEquals("data value 0,1 doesn't match", data[0][1], outData[0][1]);
           assertEquals("data value 0,2 doesn't match", data[0][2], outData[0][2]);
  @@ -61,28 +64,5 @@
           assertEquals("data value 1,2 doesn't match", data[1][2], outData[1][2]);
       }
   
  -/*
  -    public void test3QueryTestEchoArray() throws Exception {
  -        test.wsdl.query.QueryTestBindingStub binding;
  -        try {
  -            binding = (test.wsdl.query.QueryTestBindingStub)
  -                          new test.wsdl.query.QueryTestServiceLocator().getQueryTest();
  -        }
  -        catch (javax.xml.rpc.ServiceException jre) {
  -            if(jre.getLinkedCause()!=null)
  -                jre.getLinkedCause().printStackTrace();
  -            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
  -        }
  -        assertNotNull("binding is null", binding);
  -
  -        // Time out after a minute
  -        binding.setTimeout(60000);
  -
  -        // Test operation
  -        java.lang.Object[] value = null;
  -        value = binding.echoArray(new java.lang.Object[0]);
  -        // TBD - validate results
  -    }
  -*/
   
   }
  
  
  
  1.1                  ws-axis/java/test/wsdl/query/deploy.wsdd
  
  Index: deploy.wsdd
  ===================================================================
  <!-- Test deploy.wsdd not autogenerated -->
  
  <deployment
      xmlns="http://xml.apache.org/axis/wsdd/"
      xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
  
    <!-- The service -->
    <service name="QueryTest" provider="java:RPC" style="wrapped" use="literal">
        <parameter name="className" value="test.wsdl.query.QueryTestSoapBindingImpl"/>
        <parameter name="wsdlTargetNamespace" value="http://query.wsdl.test"/>
        <parameter name="wsdlServiceElement" value="QueryTestService"/>
        <parameter name="schemaQualified" value="http://query.wsdl.test"/>
        <parameter name="wsdlServicePort" value="QueryTest"/>
        <parameter name="wsdlPortType" value="QueryTest"/>
        <parameter name="typeMappingVersion" value="1.2"/>
        <parameter name="allowedMethods" value="*"/>
  
        <!-- No array mappings, just the simple type mapping for the bean -->
        <!-- We should be able to figure it all out -->
        <typeMapping
          xmlns:ns="http://rpc.xml.coldfusion"
          qname="ns:QueryBean"
          type="java:test.wsdl.query.QueryBean"
          serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
          deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
          encodingStyle=""
        />
    </service>
  </deployment>
  
  
  
  1.3       +12 -13    ws-axis/java/test/wsdl/query/QueryBean.java
  
  
  
  
  1.1                  ws-axis/java/test/wsdl/query/QueryTest.java
  
  Index: QueryTest.java
  ===================================================================
  /**
   * QueryTestImpl.java
   *
   * Service that echos a ColdFusion MX query object.
   *
   */
  
  package test.wsdl.query;
  
  public class QueryTest  {
  
      /* echo query */
      public test.wsdl.query.QueryBean echoQuery(test.wsdl.query.QueryBean argQuery) throws java.rmi.RemoteException {
          return argQuery;
      }
  }
  
  
  
  1.1                  ws-axis/java/test/wsdl/query/QueryTestSoapBindingImpl.java
  
  Index: QueryTestSoapBindingImpl.java
  ===================================================================
  /**
   * QueryTestBindingImpl.java
   *
   * Implementation for Query test.
   * 
   */
  
  package test.wsdl.query;
  
  public class QueryTestSoapBindingImpl implements test.wsdl.query.QueryTest {
      public test.wsdl.query.QueryBean echoQuery(test.wsdl.query.QueryBean argQuery) throws java.rmi.RemoteException {
          return argQuery;
      }
  
  }
  
  
  
  1.1                  ws-axis/java/test/wsdl/query/undeploy.wsdd
  
  Index: undeploy.wsdd
  ===================================================================
  <!-- static file is part of the test -->
  
  <undeployment xmlns="http://xml.apache.org/axis/wsdd/">
    <!-- Undeploy the service -->
    <service name="QueryTest"/>
  </undeployment>