FileDocCategorySizeDatePackage
TestInheritance.javaAPI DocApache Axis 1.41953Sat Apr 22 18:57:28 BST 2006test.inheritance

TestInheritance

public class TestInheritance extends TestCase

Fields Summary
private org.apache.axis.server.AxisServer
server
private org.apache.axis.transport.local.LocalTransport
transport
Constructors Summary
public TestInheritance(String s)

        super(s);
    
Methods Summary
protected voidsetUp()

        SimpleProvider config = new SimpleProvider();

        SOAPService service = new SOAPService(new RPCProvider());
        service.setOption("className", "test.inheritance.Child");
        service.setOption("allowedMethods", "*");
        config.deployService("inheritanceTest", service);

        server = new AxisServer(config);
        transport = new LocalTransport(server);
        transport.setRemoteService("inheritanceTest");
    
public voidtestInheritance()

        Call call = new Call(new Service());
        call.setTransport(transport);

        String ret = (String)call.invoke("inherited", null);
        assertEquals("Inherited method returned bad result",
                Parent.HELLO_MSG, ret);

        ret = (String)call.invoke("normal", null);
        assertEquals("Child method returned bad result",
                Child.HELLO_MSG, ret);

        ret = (String)call.invoke("overloaded", new Object [] { "test" });
        assertTrue("Overloaded (String) method returned bad result",
                ret.startsWith(Parent.OVERLOAD_MSG));
        ret = (String)call.invoke("overloaded",
                                  new Object [] { new Integer(5) });
        assertTrue("Overloaded (int) method returned bad result",
                ret.startsWith(Child.OVERLOAD_MSG));