Package org.codehaus.spice.netserve.connection.impl

Source Code of org.codehaus.spice.netserve.connection.impl.DNAAcceptorManagerTestCase

package org.codehaus.spice.netserve.connection.impl;

import junit.framework.TestCase;
import org.codehaus.dna.impl.DefaultConfiguration;
import org.codehaus.dna.impl.ConsoleLogger;

public class DNAAcceptorManagerTestCase
   extends TestCase
{
   public void testDNAAcceptorManager()
      throws Exception
   {
      final DNAAcceptorManager manager = new DNAAcceptorManager();
      final DefaultConfiguration root = new DefaultConfiguration( "root", "", "" );
      final DefaultConfiguration configuration = new DefaultConfiguration( "shutdownTimeout", "", "" );
      configuration.setValue( "22" );
      root.addChild( configuration );

      final ConsoleLogger logger = new ConsoleLogger( ConsoleLogger.LEVEL_NONE );
      manager.enableLogging( logger );
      final AcceptorMonitor monitor = manager.getMonitor();
      assertTrue( "getMonitor() instanceof DNAAcceptorMonitor", monitor instanceof DNAAcceptorMonitor );
      final DNAAcceptorMonitor dnaMonitor = (DNAAcceptorMonitor) monitor;
      assertEquals( "logger", logger, dnaMonitor.getLogger() );
      manager.configure( root );
      assertEquals( "getShutdownTimeout()", 22, manager.getShutdownTimeout() );
      manager.initialize();
      manager.dispose();
   }
}
TOP

Related Classes of org.codehaus.spice.netserve.connection.impl.DNAAcceptorManagerTestCase

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.