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

TestUndeployment

public class TestUndeployment extends TestCase
Test WSDD undeployment.
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 TestUndeployment(String name)


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

        TestUndeployment tester = new TestUndeployment("foo");
        tester.testUndeployHandler();
    
protected voidsetup()

    
public static junit.framework.Testsuite()

        return new TestSuite(TestUndeployment.class);
    
public voidtestUndeployHandler()
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);

        InputStream is = new StringBufferInputStream(undeployDoc);
        WSDDDocument doc = new WSDDDocument(XMLUtils.newDocument(is));

        WSDDDeployment dep = provider.getDeployment();
        doc.deploy(dep);

        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);