axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: xml-axis/java/test/inout DetailedInoutTestCase.java
Date Wed, 24 Oct 2001 14:41:33 GMT
dims        01/10/24 07:41:33

  Modified:    java     build.xml
               java/src/org/apache/axis/client AdminClient.java
               java/src/org/apache/axis/wsdl/test Wsdl2javaAntTask.java
                        Wsdl2javaTestSuite.xml
               java/test build_functional_tests.xml
               java/test/functional FunctionalTests.java
               java/test/inout DetailedInoutTestCase.java
  Log:
  Cleanup building and running functional tests.
  
  Revision  Changes    Path
  1.67      +9 -83     xml-axis/java/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/build.xml,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- build.xml	2001/10/23 17:18:01	1.66
  +++ build.xml	2001/10/24 14:41:33	1.67
  @@ -148,18 +148,6 @@
         <srcfiles dir="${src.dir}" includes="**/*.java" />
       </uptodate>
   
  -    <uptodate property="addr.uptodate" 
  -              targetfile="${samples.dir}/addr/AddressBookService.java">
  -      <srcfiles dir="${samples.dir}/addr" includes="AddressBook.wsdl"/>
  -      <srcfiles dir="${src.dir}/org/apache/axis/wsdl" includes="**/*.java"/>
  -    </uptodate>
  -
  -    <uptodate property="inout.uptodate" 
  -              targetfile="${test.dir}/inout/InoutService.java">
  -      <srcfiles dir="${samples.dir}/addr" includes="inout.wsdl"/>
  -      <srcfiles dir="${src.dir}/org/apache/axis/wsdl" includes="**/*.java"/>
  -    </uptodate>
  -
     </target>
   
     <!-- =================================================================== -->
  @@ -206,7 +194,7 @@
     <!-- =================================================================== -->
     <!-- Compiles the samples                                                -->
     <!-- =================================================================== -->
  -  <target name="samples" depends="compile,buildAddrSample,buildInoutSample">
  +  <target name="samples" depends="compile">
       <javac srcdir="." destdir="${build.dest}"
              debug="${debug}">
         <classpath>
  @@ -217,70 +205,10 @@
         <exclude name="samples/**/*SMTP*.java" unless="smtp.present" />
         <exclude name="**/old/**/*.java" />
         <exclude name="samples/userguide/example2/Calculator.java"/>
  +      <exclude name="samples/addr/*.java" />
       </javac>
     </target>
   
  -  <target name="buildAddrSample" unless="addr.uptodate">
  -    <antcall target="cleanAddr"/>
  -    <java classname="org.apache.axis.wsdl.Wsdl2java" dir="."
  -          fork="true">
  -      <classpath refid="classpath"/>
  -      <classpath>
  -        <pathelement location="${build.dest}"/>
  -      </classpath>
  -      <arg value="-s"/>
  -      <arg value="samples/addr/AddressBook.wsdl"/>
  -      <arg value="-p"/>
  -      <arg value="samples.addr"/>
  -      <arg value="-d"/>
  -      <arg value="Session"/>
  -    </java>
  -  </target>
  -
  -  <target name="buildInoutSample" unless="inout.uptodate">
  -    <antcall target="cleanInout"/>
  -    <java classname="org.apache.axis.wsdl.Wsdl2java" dir="."
  -          fork="true">
  -      <classpath refid="classpath"/>
  -      <classpath>
  -        <pathelement location="${build.dest}"/>
  -      </classpath>
  -      <arg value="-s"/>
  -      <arg value="test/inout/inout.wsdl"/>
  -      <arg value="-p"/>
  -      <arg value="test.inout"/>
  -    </java>
  -  </target>
  -
  -  <target name="cleanAddr">
  -    <delete file="samples/addr/AddressBook.java" />
  -    <delete file="samples/addr/AddressBookService.java" />
  -    <delete file="samples/addr/AddressBookSOAPBindingSkeleton.java" />
  -    <delete file="samples/addr/AddressBookSOAPBindingStub.java" />
  -    <delete file="samples/addr/Address.java" />
  -    <delete file="samples/addr/AddressHolder.java" />
  -    <delete file="samples/addr/Phone.java" />
  -    <delete file="samples/addr/PhoneHolder.java" />
  -    <delete file="samples/addr/deploy.xml" />
  -    <delete file="samples/addr/undeploy.xml" />
  -    <delete dir="samples/addr/xml_soap_address_demo"/>
  -  </target>
  -
  -  <target name="cleanInout">
  -    <delete file="test/inout/Address.java"/>
  -    <delete file="test/inout/AddressHolder.java"/>
  -    <delete file="test/inout/Inout.java"/>
  -    <delete file="test/inout/InoutSOAPBindingSkeleton.java"/>
  -    <delete file="test/inout/InoutSOAPBindingStub.java"/>
  -    <delete file="test/inout/InoutService.java"/>
  -    <delete file="test/inout/Phone.java"/>
  -    <delete file="test/inout/PhoneHolder.java"/>
  -    <delete file="test/inout/TestFailed.java"/>
  -    <delete file="test/inout/deploy.xml"/>
  -    <delete file="test/inout/undeploy.xml"/>
  -    <delete dir="test/inout/xml_soap_address_demo"/>
  -  </target>
  -
     <!-- =================================================================== -->
     <!-- Compiles the JUnit testcases -->
     <!-- =================================================================== -->
  @@ -292,13 +220,6 @@
   
     <target name="buildTest" if="junit.present" depends="compile,samples">
       <echo message="junit package found ..."/>
  -  </target>
  -
  -
  -  <!-- =================================================================== -->
  -  <!-- Runs the JUnit package testcases -->
  -  <!-- =================================================================== -->
  -  <target name="junit" if="junit.present" depends="samples,buildTest">
       <!-- Start by building the testcases -->
       <javac srcdir="." destdir="${build.dest}"
              debug="${debug}">
  @@ -307,8 +228,15 @@
           <path refid="classpath"/>
         </classpath>
         <include name="test/**/*.java" />
  +      <exclude name="test/inout/*.java" />
       </javac>
  +  </target>
   
  +
  +  <!-- =================================================================== -->
  +  <!-- Runs the JUnit package testcases -->
  +  <!-- =================================================================== -->
  +  <target name="junit" if="junit.present" depends="samples,buildTest">
       <mkdir dir="${basedir}/test-reports" />
       <junit printsummary="yes" haltonfailure="yes" fork="yes">
         <classpath refid="test-classpath" />
  @@ -460,7 +388,5 @@
       <delete file="server-config.xml"/>
       <delete dir="test-reports"/>
       <delete file="TEST-test.functional.FunctionalTests.txt"/>
  -    <antcall target="cleanAddr"/>
  -    <antcall target="cleanInout"/>
     </target>
   </project>
  
  
  
  1.39      +43 -24    xml-axis/java/src/org/apache/axis/client/AdminClient.java
  
  Index: AdminClient.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/AdminClient.java,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- AdminClient.java	2001/10/18 14:36:55	1.38
  +++ AdminClient.java	2001/10/24 14:41:33	1.39
  @@ -176,10 +176,12 @@
                   log( "Doing a list" );
                   String str = "<m:list xmlns:m=\"AdminService\"/>" ;
                   input = new ByteArrayInputStream( str.getBytes() );
  +                sb.append( process(opts, input) );
               } else if (args[i].equals("quit")) {
                   log("Doing a quit");
                   String str = "<m:quit xmlns:m=\"AdminService\"/>";
                   input = new ByteArrayInputStream(str.getBytes());
  +                sb.append( process(opts, input) );
               } else if (args[i].equals("passwd")) {
                   log("Changing admin password");
                   if (args[i + 1] == null) {
  @@ -191,39 +193,56 @@
                   str += "</m:passwd>";
                   input = new ByteArrayInputStream(str.getBytes());
                   i++;
  +                sb.append( process(opts, input) );
               }
               else {
  -                log( "Processing file: " + args[i] );
  -                input = new FileInputStream( args[i] );
  +                if(args[i].indexOf(java.io.File.pathSeparatorChar)==-1){
  +                    log( "Processing file: " + args[i] );
  +                    input = new FileInputStream( args[i] );
  +                    sb.append( process(opts, input) );
  +                } else {
  +                    java.util.StringTokenizer tokenizer = new java.util.StringTokenizer(args[i],java.io.File.pathSeparator);
  +                    while(tokenizer.hasMoreTokens()) {
  +                        String file = tokenizer.nextToken();
  +                        log( "Processing file: " + file );
  +                        input = new FileInputStream( file );
  +                        sb.append( process(opts, input) );
  +                        if(tokenizer.hasMoreTokens())
  +                            sb.append("\n");
  +                    }
  +                }
               }
  -
  -            Service service = new Service();
  -            Call    call = (org.apache.axis.client.Call) service.createCall();
  +        }
   
  -            call.setTargetEndpointAddress( new URL(opts.getURL()) );
  -            call.setProperty( HTTPConstants.MC_HTTP_SOAPACTION, "AdminService");
  -            call.setProperty( Transport.USER, opts.getUser() );
  -            call.setProperty( Transport.PASSWORD, opts.getPassword() );
  -
  -            String tName = opts.isValueSet( 't' );
  -            if ( tName != null && !tName.equals("") )
  -                call.setProperty( Call.TRANSPORT_NAME, tName );
  -
  -            Vector result = null ;
  -            Object[]  params = new Object[] { new SOAPBodyElement(input) };
  -            result = (Vector) call.invoke( params );
  +        return sb.toString();
  +    }
   
  -            input.close();
  +    public static String process(Options opts, InputStream input)  throws Exception
  +    {
  +        Service service = new Service();
  +        Call    call = (org.apache.axis.client.Call) service.createCall();
  +
  +        call.setTargetEndpointAddress( new URL(opts.getURL()) );
  +        call.setProperty( HTTPConstants.MC_HTTP_SOAPACTION, "AdminService");
  +        call.setProperty( Transport.USER, opts.getUser() );
  +        call.setProperty( Transport.PASSWORD, opts.getPassword() );
  +
  +        String tName = opts.isValueSet( 't' );
  +        if ( tName != null && !tName.equals("") )
  +            call.setProperty( Call.TRANSPORT_NAME, tName );
  +
  +        Vector result = null ;
  +        Object[]  params = new Object[] { new SOAPBodyElement(input) };
  +        result = (Vector) call.invoke( params );
   
  -            if (result == null || result.isEmpty()) {
  -                throw new AxisFault("Null response message!");
  -            }
  +        input.close();
   
  -            SOAPBodyElement body = (SOAPBodyElement) result.elementAt(0);
  -            sb.append( body.toString() );
  +        if (result == null || result.isEmpty()) {
  +            throw new AxisFault("Null response message!");
           }
   
  -        return sb.toString();
  +        SOAPBodyElement body = (SOAPBodyElement) result.elementAt(0);
  +        return body.toString();
       }
   
       /**
  
  
  
  1.2       +3 -3      xml-axis/java/src/org/apache/axis/wsdl/test/Wsdl2javaAntTask.java
  
  Index: Wsdl2javaAntTask.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/test/Wsdl2javaAntTask.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Wsdl2javaAntTask.java	2001/10/23 13:05:02	1.1
  +++ Wsdl2javaAntTask.java	2001/10/24 14:41:33	1.2
  @@ -99,13 +99,13 @@
               
               // Instantiate the emitter
               Emitter emitter = new Emitter();
  -            if ("Application".equals(deployScope)) {
  +            if ("application".equalsIgnoreCase(deployScope)) {
                   emitter.setScope(Emitter.APPLICATION_SCOPE);
               }
  -            else if ("Request".equals(deployScope)) {
  +            else if ("request".equalsIgnoreCase(deployScope)) {
                   emitter.setScope(Emitter.REQUEST_SCOPE);
               }
  -            else if ("Session".equals(deployScope)) {
  +            else if ("session".equalsIgnoreCase(deployScope)) {
                   emitter.setScope(Emitter.SESSION_SCOPE);
               }
               else {
  
  
  
  1.2       +31 -6     xml-axis/java/src/org/apache/axis/wsdl/test/Wsdl2javaTestSuite.xml
  
  Index: Wsdl2javaTestSuite.xml
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/test/Wsdl2javaTestSuite.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Wsdl2javaTestSuite.xml	2001/10/23 13:05:02	1.1
  +++ Wsdl2javaTestSuite.xml	2001/10/24 14:41:33	1.2
  @@ -4,13 +4,38 @@
     <taskdef name="wsdl2java" classname="org.apache.axis.wsdl.test.Wsdl2javaAntTask"/>
   
     <target name="main">
  -    <wsdl2java url="samples/addr/AddressBook.wsdl" package="samples.addr"/>
  -    <wsdl2java url="test/inout/inout.wsdl" package="test.inout"/>
  -    <wsdl2java url="http://www.whitemesa.com/interop/InteropTest.wsdl" package="org.soapinterop"/>
  +    <wsdl2java url="samples/addr/AddressBook.wsdl" 
  +               deployscope="session"
  +               package="samples.addr" 
  +               output="build/work" 
  +               testcase="no">
  +    </wsdl2java>
  +    <wsdl2java url="test/inout/inout.wsdl" 
  +               package="test.inout" 
  +               output="build/work" 
  +               testcase="no">
  +    </wsdl2java>
  +    <wsdl2java url="http://www.whitemesa.com/interop/InteropTest.wsdl" 
  +               package="org.soapinterop" 
  +               output="build/work" 
  +               testcase="no">
  +    </wsdl2java>
       <!--
  -    <wsdl2java url="http://www.whitemesa.com/interop/InteropTestB.wsdl" package="org.soapinterop"/>
  -    <wsdl2java url="http://www.whitemesa.com/interop/InteropTestC.wsdl" package="org.soapinterop"/>
  -    <wsdl2java url="http://www.whitemesa.net/wsdl/std/echoheadersvc.wsdl" package="org.soapinterop"/>
  +    <wsdl2java url="http://www.whitemesa.com/interop/InteropTestB.wsdl" 
  +               package="org.soapinteropB" 
  +               output="build/work" 
  +               testcase="no">
  +    </wsdl2java>
  +    <wsdl2java url="http://www.whitemesa.com/interop/InteropTestC.wsdl"
  +               package="org.soapinteropC" 
  +               output="build/work" 
  +               testcase="no">
  +    </wsdl2java>
  +    <wsdl2java url="http://www.whitemesa.net/wsdl/std/echoheadersvc.wsdl"
  +               package="org.soapinterop.echo" 
  +               output="build/work" 
  +               testcase="no">
  +    </wsdl2java>
       -->
     </target>
   </project>
  
  
  
  1.14      +54 -1     xml-axis/java/test/build_functional_tests.xml
  
  Index: build_functional_tests.xml
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/build_functional_tests.xml,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- build_functional_tests.xml	2001/10/19 14:54:38	1.13
  +++ build_functional_tests.xml	2001/10/24 14:41:33	1.14
  @@ -71,6 +71,11 @@
       <!--...not to mention the sample user list -->
       <copy file="samples/stock/users.lst" todir="build"/>
   
  +    <java classname="org.apache.axis.client.AdminClient" fork="yes">
  +      <classpath refid="test-classpath" />
  +      <arg line="${deploy.xml.property}"/>
  +    </java>
  +
       <!-- now, run the actual test -->
       <junit dir="." printsummary="yes" haltonfailure="yes" fork="yes">
         <classpath refid="test-classpath" />
  @@ -80,9 +85,15 @@
             <!-- Convention: each package that's being tested
                   has its own test class collecting all the tests -->
             <include name="**/FunctionalTests.class" />
  +          <include name="**/*TestCase.class" />
           </fileset>
         </batchtest>
       </junit>
  +
  +    <java classname="org.apache.axis.client.AdminClient" fork="yes">
  +      <classpath refid="test-classpath" />
  +      <arg line="${undeploy.xml.property}"/>
  +    </java>
     </target>
   
     <!-- =================================================================== -->
  @@ -97,9 +108,51 @@
     </target>
   
     <!-- =================================================================== -->
  +  <!-- Generate code using Wsdl2java utility                               -->
  +  <!-- =================================================================== -->
  +  <target name="wsdl-setup" if="junit.present">
  +    <ant antfile="src/org/apache/axis/wsdl/test/Wsdl2javaTestSuite.xml">
  +    </ant>
  +    <copy todir="${build.dir}/work/test" overwrite="yes">
  +      <fileset dir="${test.dir}">
  +        <include name="**/*BindingImpl.java"/>
  +      </fileset>
  +      <fileset dir="${test.dir}">
  +        <include name="**/*TestCase.java"/>
  +      </fileset>
  +    </copy>
  +    <copy todir="${build.dir}/work/samples" overwrite="yes">
  +      <fileset dir="${samples.dir}">
  +        <include name="**/*BindingImpl.java"/>
  +      </fileset>
  +      <fileset dir="${samples.dir}">
  +        <include name="**/*TestCase.java"/>
  +      </fileset>
  +    </copy>
  +    <path id="deploy.xml.files">
  +        <fileset dir="${build.dir}/work">
  +          <include name="**/deploy.xml"/>
  +        </fileset>
  +    </path>
  +    <path id="undeploy.xml.files">
  +        <fileset dir="${build.dir}/work">
  +          <include name="**/undeploy.xml"/>
  +        </fileset>
  +    </path>
  +    <property name="deploy.xml.property" refid="deploy.xml.files"/>
  +    <property name="undeploy.xml.property" refid="undeploy.xml.files"/>
  +    <javac srcdir="${build.dir}/work" destdir="${build.dest}"
  +           debug="${debug}">
  +      <classpath refid="test-classpath" />
  +      <include name="**/*.java" />
  +    </javac>
  +  </target>
  +
  +  <!-- =================================================================== -->
     <!-- Run functional tests                                                -->
     <!-- =================================================================== -->
  -  <target name="functional-tests" if="junit.present">
  +  <target name="functional-tests" if="junit.present" depends="wsdl-setup">
  +
       <!-- This uses a custom Ant task.  See test/functional/ant/RunAxisFunctionalTests.java
-->
       <!-- This pattern taken from Cactus, http://jakarta.apache.org/commons/cactus -->
       <runaxisfunctionaltests
  
  
  
  1.12      +0 -8      xml-axis/java/test/functional/FunctionalTests.java
  
  Index: FunctionalTests.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/functional/FunctionalTests.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- FunctionalTests.java	2001/10/23 15:08:45	1.11
  +++ FunctionalTests.java	2001/10/24 14:41:33	1.12
  @@ -4,8 +4,6 @@
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
   
  -import test.inout.DetailedInoutTestCase;
  -
   /**
    * Axis's FunctionalTests test client/server interactions.
    */
  @@ -39,17 +37,11 @@
           // bid-buy test
           suite.addTestSuite(TestBidBuySample.class);
   
  -        // address book test
  -        suite.addTestSuite(TestAddressBookSample.class);
  -
           // "Raw" echo service test.
           suite.addTestSuite(TestMiscSample.class);
   
           // Proxy service test.
           suite.addTestSuite(TestProxySample.class);
  -
  -        // in/inout/out parameter tests
  -        suite.addTestSuite(DetailedInoutTestCase.class);
   
           return suite;
       }
  
  
  
  1.5       +0 -5      xml-axis/java/test/inout/DetailedInoutTestCase.java
  
  Index: DetailedInoutTestCase.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/inout/DetailedInoutTestCase.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- DetailedInoutTestCase.java	2001/10/23 15:08:25	1.4
  +++ DetailedInoutTestCase.java	2001/10/24 14:41:33	1.5
  @@ -81,11 +81,6 @@
       private Address returnAddress = new Address (555, "Monroe Street", "Madison", "WI",
54444, returnPhone);
       private int returnNumber = 66;
   
  -    public void testDeploy() {
  -        String[] args = {"test/inout/deploy.xml"};
  -        AdminClient.main(args);
  -    } // doTestDeploy
  -    
       public void testOut0_inout0_in0 ()
       {
           try
  
  
  

Mime
View raw message