FileDocCategorySizeDatePackage
PolymorphismTest_ServiceTestCase.javaAPI DocApache Axis 1.43289Sat Apr 22 18:57:26 BST 2006test.wsdl.polymorphism

PolymorphismTest_ServiceTestCase

public class PolymorphismTest_ServiceTestCase extends TestCase
PolymorphismTest_ServiceTestCase.java This file was auto-generated from WSDL by the Apache Axis WSDL2Java emitter.

Fields Summary
Constructors Summary
public PolymorphismTest_ServiceTestCase(String name)

        super(name);
    
Methods Summary
public voidtest1PolymorphismTestGetBAsA()

        test.wsdl.polymorphism.PolymorphismTest_PortType binding;
        try {
            binding = new test.wsdl.polymorphism.PolymorphismTest_ServiceLocator().getPolymorphismTest();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }
        assertTrue("binding is null", binding != null);

        try {
            test.wsdl.polymorphism.A value = null;

            // Passing false here gets us a "B"
            value = binding.getBAsA(false);

            // Check out the return value for correctness.
            assertTrue("Return value wasn't a 'B'!", value instanceof B);
            B myB = (B)value;
            assertEquals("B field didn't match",
                         PolymorphismTestSoapImpl.B_TEXT,
                         myB.getB());
            assertEquals("A field didn't match",
                         PolymorphismTestSoapImpl.A_TEXT,
                         myB.getA());
        }
        catch (java.rmi.RemoteException re) {
            throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
        }
    
public voidtest1PolymorphismTestGetCAsA()

        test.wsdl.polymorphism.PolymorphismTest_PortType binding;
        try {
            binding = new test.wsdl.polymorphism.PolymorphismTest_ServiceLocator().getPolymorphismTest();
        }
        catch (javax.xml.rpc.ServiceException jre) {
            throw new junit.framework.AssertionFailedError("JAX-RPC ServiceException caught: " + jre);
        }
        assertTrue("binding is null", binding != null);

        try {
            test.wsdl.polymorphism.A value = null;

            // Passing true here gets us a "C" on the server side, but since
            // there's no type mapping for that we should just get the "A"
            // part.
            value = binding.getBAsA(true);

            // Check out the return value for correctness.
            assertTrue("Return value wasn't an 'A'!", value instanceof A);
            assertEquals("A field didn't match",
                         PolymorphismTestSoapImpl.A_TEXT,
                         value.getA());
        }
        catch (java.rmi.RemoteException re) {
            throw new junit.framework.AssertionFailedError("Remote Exception caught: " + re);
        }
    
public voidtestPolymorphismTestWSDL()

        javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
        java.net.URL url = new java.net.URL(new test.wsdl.polymorphism.PolymorphismTest_ServiceLocator().getPolymorphismTestAddress() + "?WSDL");
        javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.polymorphism.PolymorphismTest_ServiceLocator().getServiceName());
        assertTrue(service != null);