FileDocCategorySizeDatePackage
TestAdminService.javaAPI DocApache Axis 1.43283Sat Apr 22 18:57:26 BST 2006test.wsdd

TestAdminService

public class TestAdminService extends TestCase
Test WSDD functions via the AdminService.
author
Glen Daniels (gdaniels@apache.org)

Fields Summary
static final String
HANDLER_NAME
static final String
PARAM_NAME
static final String
PARAM_VAL
static final String
deployDoc
static final String
undeployDoc
Constructors Summary
public TestAdminService(String name)


        
        super(name);
    
Methods Summary
public static voidmain(java.lang.String[] args)

        TestAdminService tester = new TestAdminService("foo");
        tester.testUndeployHandlerViaAdmin();
    
protected voidsetup()

    
public static junit.framework.Testsuite()

        return new TestSuite(TestAdminService.class);
    
public voidtestUndeployHandlerViaAdmin()
Load up a server with a couple of handlers as spec'ed above, then undeploy one of them. Confirm that all looks reasonable throughout.

        XMLStringProvider provider = new XMLStringProvider(deployDoc);
        AxisServer server = new AxisServer(provider);
        
        Handler handler = server.getHandler("other");
        assertNotNull("Couldn't get handler", handler);

        AdminClient client = new AdminClient(true);
        Call call = client.getCall();
        LocalTransport transport = new LocalTransport(server);
        transport.setRemoteService("AdminService");

        call.setTransport(transport);
        client.process(new ByteArrayInputStream(undeployDoc.getBytes()));

        server.refreshGlobalOptions();
        
        handler = server.getHandler("other");
        assertNull("Undeployed handler is still available", handler);
        
        handler = server.getHandler(HANDLER_NAME);
        assertNotNull("Couldn't get handler (2nd time)", handler);