dims        2002/12/23 14:27:44

  Modified:    java/test/wsdl/interop4/groupG/mime/rpc build.xml
                        mime-rpc.wsdl
               java/src/org/apache/axis/utils JavaUtils.java
  Added:       java/test/wsdl/interop4/groupG/mime/rpc
                        AttachmentsBindingImpl.java
                        MimeRPCInteropTestCase.java
  Log:
  Fleshing GroupG mime-rpc test.
  
  Revision  Changes    Path
  1.3       +4 -6      xml-axis/java/test/wsdl/interop4/groupG/mime/rpc/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/interop4/groupG/mime/rpc/build.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- build.xml 29 Nov 2002 23:32:53 -0000      1.2
  +++ build.xml 23 Dec 2002 22:27:44 -0000      1.3
  @@ -70,14 +70,12 @@
       </wsdl2java>
   
       <mkdir dir="${build.dest}"/>
  -    <!--
  -    <copy file="BaseTypesInteropTestsTestCase.java"
  -         todir="${root.dir}/build/work/test/wsdl/interop5/basetype/"
  +    <copy 
file="${axis.home}/test/wsdl/interop4/groupG/mime/rpc/MimeRPCInteropTestCase.java"
  +         todir="${root.dir}/build/work/test/wsdl/interop4/groupG/mime/rpc"
            overwrite="yes"/>
  -    <copy file="InteropTestsBindingImpl.java"
  -         todir="${root.dir}/build/work/test/wsdl/interop5/basetype/"
  +    <copy 
file="${axis.home}/test/wsdl/interop4/groupG/mime/rpc/AttachmentsBindingImpl.java"
  +         todir="${root.dir}/build/work/test/wsdl/interop4/groupG/mime/rpc"
            overwrite="yes"/>
  -    -->
       <!-- compile the skeletons -->
       <javac srcdir="${build.dir}/work"
         destdir="${build.dest}" debug="on">
  
  
  
  1.2       +5 -0      xml-axis/java/test/wsdl/interop4/groupG/mime/rpc/mime-rpc.wsdl
  
  Index: mime-rpc.wsdl
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/interop4/groupG/mime/rpc/mime-rpc.wsdl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mime-rpc.wsdl     1 Nov 2002 21:43:04 -0000       1.1
  +++ mime-rpc.wsdl     23 Dec 2002 22:27:44 -0000      1.2
  @@ -143,4 +143,9 @@
                        </wsdl:output>
                </wsdl:operation>
        </wsdl:binding>
  +    <wsdl:service name="MimeRPCInterop">
  +         <wsdl:port name="MimeRPCSoapPort" binding="AttachmentsBinding">
  +            <soap:address 
location="http://localhost:8080/axis/services/MimeRPCSoapPort"/>
  +        </wsdl:port>
  +    </wsdl:service>
   </wsdl:definitions>
  
  
  
  1.1                  
xml-axis/java/test/wsdl/interop4/groupG/mime/rpc/AttachmentsBindingImpl.java
  
  Index: AttachmentsBindingImpl.java
  ===================================================================
  /**
   * AttachmentsBindingImpl.java
   *
   * This file was auto-generated from WSDL
   * by the Apache Axis WSDL2Java emitter.
   */
  
  package test.wsdl.interop4.groupG.mime.rpc;
  
  public class AttachmentsBindingImpl implements 
test.wsdl.interop4.groupG.mime.rpc.AttachmentsPortType{
      public byte[] echoAttachment(byte[] in) throws java.rmi.RemoteException {
          return in;
      }
  
      public byte[][] echoAttachments(byte[][] in) throws java.rmi.RemoteException {
          return in;
      }
  
      public byte[] echoAttachmentAsBase64(byte[] in) throws java.rmi.RemoteException {
          return in;
      }
  
      public byte[] echoBase64AsAttachment(byte[] in) throws java.rmi.RemoteException {
          return in;
      }
  
  }
  
  
  
  1.1                  
xml-axis/java/test/wsdl/interop4/groupG/mime/rpc/MimeRPCInteropTestCase.java
  
  Index: MimeRPCInteropTestCase.java
  ===================================================================
  /**
   * MimeRPCInteropTestCase.java
   *
   * This file was auto-generated from WSDL
   * by the Apache Axis WSDL2Java emitter.
   */
  
  package test.wsdl.interop4.groupG.mime.rpc;
  
  import java.util.Arrays;
  
  public class MimeRPCInteropTestCase extends junit.framework.TestCase {
      public MimeRPCInteropTestCase(java.lang.String name) {
          super(name);
      }
  
      public void test1MimeRPCSoapPortEchoAttachment() throws Exception {
          test.wsdl.interop4.groupG.mime.rpc.AttachmentsPortType binding;
          try {
              binding = new 
test.wsdl.interop4.groupG.mime.rpc.MimeRPCInteropLocator().getMimeRPCSoapPort();
          } catch (javax.xml.rpc.ServiceException jre) {
              if (jre.getLinkedCause() != null)
                  jre.getLinkedCause().printStackTrace();
              throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException 
caught: " + jre);
          }
          assertTrue("binding is null", binding != null);
  
          // Test operation
          byte[] input = "EchoAttachment".getBytes();
          byte[] output = null;
          output = binding.echoAttachment(input);
          // TBD - validate results
          assertTrue(Arrays.equals(input, output));
      }
  
      public void test2MimeRPCSoapPortEchoAttachments() throws Exception {
          test.wsdl.interop4.groupG.mime.rpc.AttachmentsPortType binding;
          try {
              binding = new 
test.wsdl.interop4.groupG.mime.rpc.MimeRPCInteropLocator().getMimeRPCSoapPort();
          } catch (javax.xml.rpc.ServiceException jre) {
              if (jre.getLinkedCause() != null)
                  jre.getLinkedCause().printStackTrace();
              throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException 
caught: " + jre);
          }
          assertTrue("binding is null", binding != null);
  
          byte[][] input = new byte[2][];
  
          input[0] = "EchoAttachments0".getBytes();
          input[1] = "EchoAttachments1".getBytes();
          
          // Test operation
          byte[][] output = null;
          output = binding.echoAttachments(input);
          // TBD - validate results
          assertTrue(Arrays.equals(input[0], output[0]));
          assertTrue(Arrays.equals(input[1], output[1]));
      }
  
      public void test3MimeRPCSoapPortEchoAttachmentAsBase64() throws Exception {
          test.wsdl.interop4.groupG.mime.rpc.AttachmentsPortType binding;
          try {
              binding = new 
test.wsdl.interop4.groupG.mime.rpc.MimeRPCInteropLocator().getMimeRPCSoapPort();
          } catch (javax.xml.rpc.ServiceException jre) {
              if (jre.getLinkedCause() != null)
                  jre.getLinkedCause().printStackTrace();
              throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException 
caught: " + jre);
          }
          assertTrue("binding is null", binding != null);
          byte[] input = "EchoAttachmentAsBase64".getBytes(); 
          // Test operation
          byte[] output = null;
          output = binding.echoAttachmentAsBase64(input);
          // TBD - validate results
          assertTrue(Arrays.equals(input, output));
      }
  
      public void test4MimeRPCSoapPortEchoBase64AsAttachment() throws Exception {
          test.wsdl.interop4.groupG.mime.rpc.AttachmentsPortType binding;
          try {
              binding = new 
test.wsdl.interop4.groupG.mime.rpc.MimeRPCInteropLocator().getMimeRPCSoapPort();
          } catch (javax.xml.rpc.ServiceException jre) {
              if (jre.getLinkedCause() != null)
                  jre.getLinkedCause().printStackTrace();
              throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException 
caught: " + jre);
          }
          assertTrue("binding is null", binding != null);
  
          byte[] input = "EchoBase64AsAttachment".getBytes(); 
          // Test operation
          byte[] output = null;
          output = binding.echoBase64AsAttachment(input);
          // TBD - validate results
          assertTrue(Arrays.equals(input, output));
      }
  
  }
  
  
  
  1.88      +14 -0     xml-axis/java/src/org/apache/axis/utils/JavaUtils.java
  
  Index: JavaUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/JavaUtils.java,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- JavaUtils.java    13 Dec 2002 20:38:04 -0000      1.87
  +++ JavaUtils.java    23 Dec 2002 22:27:44 -0000      1.88
  @@ -561,6 +561,20 @@
                   return true;
           }
   
  +        if (src.getName().equals("javax.activation.DataHandler")) {
  +            if (dest ==  byte[].class)
  +                return true;
  +            if (dest.isArray() && dest.getComponentType() == byte[].class)
  +                return true;
  +        }
  +
  +        if (dest.getName().equals("javax.activation.DataHandler")) {
  +            if (src ==  Object[].class)
  +                return true;
  +            if (src.isArray() && src.getComponentType() == Object[].class)
  +                return true;
  +        }
  +
           if (src.isPrimitive()) {
               return isConvertable(getWrapperClass(src),dest);
           }
  
  
  


Reply via email to