Methods Summary |
---|
public static void | main(java.lang.String[] args)
TestScopeOption tester = new TestScopeOption("foo");
tester.testPerAccessScope();
|
protected void | setup()
|
public static junit.framework.Test | suite()
return new TestSuite(TestScopeOption.class);
|
public void | testPerAccessScope()Initialize an engine with a single handler with per-access scope.
Then get the handler from the engine twice, and confirm that we get
two different objects.
String doc = doc1 + "per-access" + doc2;
XMLStringProvider provider = new XMLStringProvider(doc);
AxisServer server = new AxisServer(provider);
Handler h1 = server.getHandler(HANDLER_NAME);
assertNotNull("Couldn't get first logger handler from engine!", h1);
Handler h2 = server.getHandler(HANDLER_NAME);
assertNotNull("Couldn't get second logger handler from engine!", h2);
assertTrue("Per-access Handlers were identical!", (h1 != h2));
|
public void | testSingletonScope()Initialize an engine with a single handler of singleton scope.
Then get the handler from the engine twice, and confirm that we
get the same object both times.
String doc = doc1 + "singleton" + doc2;
XMLStringProvider provider = new XMLStringProvider(doc);
AxisServer server = new AxisServer(provider);
Handler h1 = server.getHandler(HANDLER_NAME);
assertNotNull("Couldn't get first logger handler from engine!", h1);
Handler h2 = server.getHandler(HANDLER_NAME);
assertNotNull("Couldn't get second logger handler from engine!", h2);
assertTrue("Singleton Handlers were different!", (h1 == h2));
|