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

TestRoles

public class TestRoles extends junit.framework.TestCase

Fields Summary
static final String
GLOBAL_ROLE
static final String
SERVICE_ROLE
static final String
SERVICE_NAME
static final String
doc
Constructors Summary
public TestRoles(String name)


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

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

    
public static junit.framework.Testsuite()

        return new TestSuite(TestRoles.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);

        SOAPService service = server.getService(SERVICE_NAME);
        assertNotNull("Couldn't get service from engine!", service);

        List roles = service.getRoles();
        assertTrue("Service role not accessible",
                   roles.contains(SERVICE_ROLE));
        assertTrue("Global role not accessible",
                   roles.contains(GLOBAL_ROLE));

        roles = service.getServiceActors();
        assertTrue("Service role not accessible from specific list",
                   roles.contains(SERVICE_ROLE));
        assertFalse("Global role is accessible from specific list",
                   roles.contains(GLOBAL_ROLE));