01: package org.codehaus.spice.netserve.connection.impl;
02:
03: import junit.framework.TestCase;
04: import org.codehaus.dna.impl.DefaultConfiguration;
05: import org.codehaus.dna.impl.ConsoleLogger;
06:
07: public class DNAAcceptorManagerTestCase extends TestCase {
08: public void testDNAAcceptorManager() throws Exception {
09: final DNAAcceptorManager manager = new DNAAcceptorManager();
10: final DefaultConfiguration root = new DefaultConfiguration(
11: "root", "", "");
12: final DefaultConfiguration configuration = new DefaultConfiguration(
13: "shutdownTimeout", "", "");
14: configuration.setValue("22");
15: root.addChild(configuration);
16:
17: final ConsoleLogger logger = new ConsoleLogger(
18: ConsoleLogger.LEVEL_NONE);
19: manager.enableLogging(logger);
20: final AcceptorMonitor monitor = manager.getMonitor();
21: assertTrue("getMonitor() instanceof DNAAcceptorMonitor",
22: monitor instanceof DNAAcceptorMonitor);
23: final DNAAcceptorMonitor dnaMonitor = (DNAAcceptorMonitor) monitor;
24: assertEquals("logger", logger, dnaMonitor.getLogger());
25: manager.configure(root);
26: assertEquals("getShutdownTimeout()", 22, manager
27: .getShutdownTimeout());
28: manager.initialize();
29: manager.dispose();
30: }
31: }
|