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

TestBadWSDD

public class TestBadWSDD extends TestCase
Try various bad deployments, and make sure that we get back reasonable errors and don't screw up the engine's configuration.
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
goodWSDD
static final String
header
static final String
footer
static final String
badHandler
Constructors Summary
public TestBadWSDD(String name)


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

        TestBadWSDD tester = new TestBadWSDD("foo");
        tester.testOptions();
    
protected voidsetup()

    
public static junit.framework.Testsuite()

        return new TestSuite(TestBadWSDD.class);
    
public voidtestOptions()
Initialize an engine with a single handler with a parameter set, and another reference to that same handler with a different name. Make sure the param is set for both the original and the reference handler.

        XMLStringProvider provider = new XMLStringProvider(goodWSDD);
        AxisServer server = new AxisServer(provider);
        
        Handler h1 = server.getHandler(HANDLER_NAME);
        assertNotNull("Couldn't get logger handler from engine!", h1);

        AdminClient client = new AdminClient(true);
        String doc = header + badHandler + footer;
        ByteArrayInputStream stream = new ByteArrayInputStream(doc.getBytes());
        
        LocalTransport transport = new LocalTransport(server);
        transport.setUrl("local:///AdminService");
        client.getCall().setTransport(transport);
        try {
            client.process(stream);
        } catch (Exception e) {
             return;
        }
        
        fail("Successfully processed bad WSDD!");