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

TestOptions

public class TestOptions extends junit.framework.TestCase

Fields Summary
static final String
HANDLER_NAME
static final String
PARAM_NAME
static final String
PARAM_VAL
static final String
doc
Constructors Summary
public TestOptions(String name)


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

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

    
public static junit.framework.Testsuite()

        return new TestSuite(TestOptions.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(doc);
        AxisServer server = new AxisServer(provider);
        
        Handler h1 = server.getHandler(HANDLER_NAME);
        assertNotNull("Couldn't get logger handler from engine!", h1);
        
        Object optVal = h1.getOption(PARAM_NAME);
        assertNotNull("Option value was null!", optVal);
        assertEquals("Option was not expected value", optVal, PARAM_VAL);

        optVal = server.getOption("someOptionWhichIsntSet");
        assertNull("Got value for bad option!", optVal);

        Handler h2 = server.getHandler("other");
        assertNotNull("Couldn't get second handler", h2);

        optVal = h1.getOption(PARAM_NAME);
        assertNotNull("Option value was null for 2nd handler!", optVal);
        assertEquals("Option was not expected value for 2nd handler",
                     optVal, PARAM_VAL);

        optVal = server.getOption("someOptionWhichIsntSet");
        assertNull("Got value for bad option on 2nd handler!", optVal);