axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bu...@apache.org
Subject cvs commit: xml-axis/java/test/wsdl/getPort GetPortTestCase.java getPort.wsdl
Date Thu, 21 Mar 2002 14:30:26 GMT
butek       02/03/21 06:30:26

  Modified:    java/test/wsdl Wsdl2javaTestSuite.xml
  Added:       java/test/wsdl/getPort GetPortTestCase.java getPort.wsdl
  Log:
  Test for new getPort(Class) methods.
  
  Revision  Changes    Path
  1.89      +7 -0      xml-axis/java/test/wsdl/Wsdl2javaTestSuite.xml
  
  Index: Wsdl2javaTestSuite.xml
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/Wsdl2javaTestSuite.xml,v
  retrieving revision 1.88
  retrieving revision 1.89
  diff -u -r1.88 -r1.89
  --- Wsdl2javaTestSuite.xml	19 Mar 2002 20:15:29 -0000	1.88
  +++ Wsdl2javaTestSuite.xml	21 Mar 2002 14:30:26 -0000	1.89
  @@ -716,6 +716,13 @@
                  testcase="yes">
       </wsdl2java>
   
  +    <!-- This tests the getPort method in generated services.  -->
  +    <wsdl2java url="test/wsdl/getPort/getPort.wsdl"
  +               output="build/work"
  +               serverSide="yes"
  +               testcase="no">
  +    </wsdl2java>
  +
       <!-- This tests .NET document/literal WSDL.
            We get this WSDL file from the internet on purpose,
            file is only for reference.
  
  
  
  1.1                  xml-axis/java/test/wsdl/getPort/GetPortTestCase.java
  
  Index: GetPortTestCase.java
  ===================================================================
  package test.wsdl.getPort;
  
  import javax.xml.rpc.ServiceException;
  
  // This test makes sure that the getPort method works in various service classes.
  
  public class GetPortTestCase extends junit.framework.TestCase {
      public GetPortTestCase(String name) {
          super(name);
      } // ctor
  
      public void testEmptyService() {
          Empty empty = new EmptyLocator();
          try {
              empty.getPort(null);
              fail("empty.getPort(null) should have failed.");
          }
          catch (ServiceException se) {
              assertTrue("Wrong exception!  " + se.getCause(), se.getCause() == null);
          }
      } // testEmptyService
  
      public void testNormalService() {
          ServiceA service = new ServiceALocator();
          try {
              One one = (One) service.getPort(One.class);
              Two two = (Two) service.getPort(Two.class);
              Three three = (Three) service.getPort(Three.class);
          }
          catch (Throwable t) {
              fail("Should not have gotten an exception:  " + t);
          }
          try {
              service.getPort(java.util.Vector.class);
              fail("service.getPort(Vector.class) should have failed.");
          }
          catch (ServiceException se) {
              assertTrue("Wrong exception!  " + se.getCause(), se.getCause() == null);
          }
      } // testNormalService
  
      public void testDoublePortService1() {
          ServiceB service = new ServiceBLocator();
          try {
              One one = (One) service.getPort(One.class);
              Two two = (Two) service.getPort(Two.class);
          }
          catch (Throwable t) {
              fail("Should not have gotten an exception:  " + t);
          }
          try {
              service.getPort(Three.class);
              fail("service.getPort(Three.class) should have failed.");
          }
          catch (ServiceException se) {
              assertTrue("Wrong exception!  " + se.getCause(), se.getCause() == null);
          }
      } // testDoublePortService1
  
      public void testDoublePortService2() {
          ServiceC service = new ServiceCLocator();
          try {
              One one = (One) service.getPort(One.class);
              Two two = (Two) service.getPort(Two.class);
          }
          catch (Throwable t) {
              fail("Should not have gotten an exception:  " + t);
          }
          try {
              service.getPort(Three.class);
              fail("service.getPort(Three.class) should have failed.");
          }
          catch (ServiceException se) {
              assertTrue("Wrong exception!  " + se.getCause(), se.getCause() == null);
          }
      } // testDoublePortService2
  
  } // class VerifyTestCase
  
  
  
  
  1.1                  xml-axis/java/test/wsdl/getPort/getPort.wsdl
  
  Index: getPort.wsdl
  ===================================================================
  <?xml version="1.0" ?>
  <definitions name="urn:getPort.wsdl.test"
               targetNamespace="urn:getPort.wsdl.test"
               xmlns:tns="urn:getPort.wsdl.test"
               xmlns:xsd="http://www.w3.org/1999/XMLSchema"
               xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
               xmlns="http://schemas.xmlsoap.org/wsdl/">
  
    <message name="empty"/>
  
    <portType name="one"/>
    <portType name="two"/>
    <portType name="three"/>
  
    <binding name="bindingOne" type="tns:one">
      <soap:binding style="rpc"
                    transport="http://schemas.xmlsoap.org/soap/http"/>
    </binding>
    <binding name="bindingTwo" type="tns:two">
      <soap:binding style="rpc"
                    transport="http://schemas.xmlsoap.org/soap/http"/>
    </binding>
    <binding name="bindingThree" type="tns:three">
      <soap:binding style="rpc"
                    transport="http://schemas.xmlsoap.org/soap/http"/>
    </binding>
    <binding name="bindingAnotherOne" type="tns:one">
      <soap:binding style="rpc"
                    transport="http://schemas.xmlsoap.org/soap/http"/>
    </binding>
  
    <service name="empty"/>
    <service name="serviceA">
      <documentation>
      Service with all ports unique.
      </documentation>
      <port name="portOne" binding="tns:bindingOne">
        <soap:address location="http://localhost:8080/axis/services/portOne"/>
      </port>
      <port name="portTwo" binding="tns:bindingTwo">
        <soap:address location="http://localhost:8080/axis/services/portTwo"/>
      </port>
      <port name="portThree" binding="tns:bindingThree">
        <soap:address location="http://localhost:8080/axis/services/portThree"/>
      </port>
    </service>
    <service name="serviceB">
      <documentation>
      Service with two ports (portTwo, portTwoA) that share the same portType via the same
binding.
      </documentation>
      <port name="portOne" binding="tns:bindingOne">
        <soap:address location="http://localhost:8080/axis/services/portOne"/>
      </port>
      <port name="portTwo" binding="tns:bindingTwo">
        <soap:address location="http://localhost:8080/axis/services/portTwo"/>
      </port>
      <port name="portTwoA" binding="tns:bindingTwo">
        <soap:address location="http://localhost:8080/axis/services/portTwo"/>
      </port>
    </service>
    <service name="serviceC">
      <documentation>
      Service with two ports (portTwo, portThree) that share the same portType via different
bindings.
      </documentation>
      <port name="portOne" binding="tns:bindingOne">
        <soap:address location="http://localhost:8080/axis/services/portOne"/>
      </port>
      <port name="portTwo" binding="tns:bindingTwo">
        <soap:address location="http://localhost:8080/axis/services/portTwo"/>
      </port>
      <port name="portThree" binding="tns:bindingAnotherOne">
        <soap:address location="http://localhost:8080/axis/services/portFour"/>
      </port>
    </service>
  
  </definitions>
  
  
  
  

Mime
View raw message