FileDocCategorySizeDatePackage
TestAllowedMethods.javaAPI DocApache Axis 1.42423Sat Apr 22 18:57:28 BST 2006test.wsdd

TestAllowedMethods

public class TestAllowedMethods extends TestCase

Fields Summary
static final String
SERVICE_NAME
private static final String
MESSAGE
org.apache.axis.server.AxisServer
server
org.apache.axis.transport.local.LocalTransport
transport
static final String
doc1
Constructors Summary
public TestAllowedMethods()


      
        super("test");
    
public TestAllowedMethods(String s)

        super(s);
    
Methods Summary
public java.lang.Stringallowed()

        return MESSAGE;
    
public java.lang.Stringdisallowed()

        return "You shouldn't have called me!";
    
protected voidsetUp()

        XMLStringProvider config = new XMLStringProvider(doc1);
        server = new AxisServer(config);
        transport = new LocalTransport(server);
        transport.setRemoteService(SERVICE_NAME);
    
public voidtestAllowedMethods()

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

        String ret = (String)call.invoke("allowed", null);
        assertEquals("Return didn't match", MESSAGE, ret);

        try {
            ret = (String)call.invoke("disallowed", null);
        } catch (Exception e) {
            // Success, we shouldn't have been allowed to call that.
            return;
        }

        fail("Successfully called disallowed method!");