avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/thread/src/test/org/apache/avalon/excalibur/thread/impl/test DefaultThreadPoolTestCase.java
Date Thu, 09 May 2002 06:23:17 GMT
colus       02/05/08 23:23:17

  Modified:    thread/src/test/org/apache/avalon/excalibur/thread/impl/test
                        DefaultThreadPoolTestCase.java
  Log:
  Test with ThreadContext.getThreadContext() and new ThreadContext.
  
  Revision  Changes    Path
  1.2       +15 -0     jakarta-avalon-excalibur/thread/src/test/org/apache/avalon/excalibur/thread/impl/test/DefaultThreadPoolTestCase.java
  
  Index: DefaultThreadPoolTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/thread/src/test/org/apache/avalon/excalibur/thread/impl/test/DefaultThreadPoolTestCase.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultThreadPoolTestCase.java	8 May 2002 11:02:34 -0000	1.1
  +++ DefaultThreadPoolTestCase.java	9 May 2002 06:23:17 -0000	1.2
  @@ -7,10 +7,12 @@
    */
   package org.apache.avalon.excalibur.thread.impl.test;
   
  +import java.util.HashMap;
   import org.apache.avalon.framework.logger.ConsoleLogger;
   import org.apache.avalon.excalibur.thread.ThreadPool;
   import org.apache.avalon.excalibur.thread.impl.DefaultThreadPool;
   import org.apache.excalibur.threadcontext.ThreadContext;
  +import org.apache.excalibur.threadcontext.impl.DefaultThreadContextPolicy;
   import junit.framework.TestCase;
   
   /**
  @@ -27,6 +29,19 @@
       }
   
       public void testWithThreadContext()
  +        throws Exception
  +    {
  +        final DefaultThreadContextPolicy policy = new DefaultThreadContextPolicy();
  +        final HashMap map = new HashMap( 1 );
  +        map.put( DefaultThreadContextPolicy.CLASSLOADER, getClass().getClassLoader() );
  +        final ThreadContext threadContext = new ThreadContext( policy, map );
  +        final DefaultThreadPool pool = new DefaultThreadPool( "default", 10, threadContext
);
  +        pool.setDaemon( false );
  +        pool.enableLogging( new ConsoleLogger() );
  +        pool.execute( new DummyRunnable() );
  +    }
  +
  +    public void testWithoutThreadContext()
           throws Exception
       {
           final ThreadContext threadContext = ThreadContext.getThreadContext();
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message