avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From blorit...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/fortress/src/test/org/apache/excalibur/fortress/test ContainerProfile.java
Date Tue, 24 Sep 2002 19:40:19 GMT
bloritsch    2002/09/24 12:40:19

  Modified:    fortress/src/test/org/apache/excalibur/fortress/test
                        ContainerProfile.java
  Log:
  adjust profile test to use ServiceManager instead of ComponentManager
  
  Revision  Changes    Path
  1.26      +14 -14    jakarta-avalon-excalibur/fortress/src/test/org/apache/excalibur/fortress/test/ContainerProfile.java
  
  Index: ContainerProfile.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/test/org/apache/excalibur/fortress/test/ContainerProfile.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- ContainerProfile.java	17 Sep 2002 17:39:59 -0000	1.25
  +++ ContainerProfile.java	24 Sep 2002 19:40:19 -0000	1.26
  @@ -53,14 +53,11 @@
   import junit.framework.TestCase;
   import junit.textui.TestRunner;
   import org.apache.avalon.excalibur.component.ExcaliburComponentManager;
  -import org.apache.avalon.excalibur.datasource.DataSourceComponent;
   import org.apache.avalon.excalibur.logger.DefaultLogKitManager;
   import org.apache.avalon.excalibur.monitor.Monitor;
   import org.apache.avalon.excalibur.testcase.CascadingAssertionFailedError;
   import org.apache.avalon.excalibur.testcase.LatchedThreadGroup;
   import org.apache.avalon.excalibur.xml.Parser;
  -import org.apache.avalon.framework.component.ComponentManager;
  -import org.apache.avalon.framework.component.Component;
   import org.apache.avalon.framework.configuration.Configuration;
   import org.apache.avalon.framework.configuration.DefaultConfigurationBuilder;
   import org.apache.avalon.framework.context.Context;
  @@ -68,11 +65,12 @@
   import org.apache.avalon.framework.logger.ConsoleLogger;
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.logger.NullLogger;
  +import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.excalibur.fortress.ContainerManager;
   import org.apache.excalibur.fortress.DefaultContainerManager;
   import org.apache.excalibur.fortress.util.ContextBuilder;
  -import org.apache.excalibur.fortress.util.ContextManager;
   import org.apache.excalibur.fortress.container.DefaultContainer;
  +import org.apache.excalibur.container.legacy.ComponentManager2ServiceManager;
   
   /**
    * Used as a basis for the PoolComparisonProfile Tests
  @@ -168,7 +166,7 @@
   
           resetMemory();
   
  -        lookupTest( "Test Case: ECM_ContainerManager_UseageTime", container.getComponentManager(),
manager );
  +        lookupTest( "Test Case: ECM_ContainerManager_UseageTime", container.getServiceManager(),
new ComponentManager2ServiceManager( manager ) );
   
           resetMemory();
   
  @@ -268,7 +266,7 @@
       /**
        * The guts of the various test cases.  Will dispose the pools
        */
  -    protected void lookupTest( String name, ComponentManager cmA, ComponentManager cmB
)
  +    protected void lookupTest( String name, ServiceManager cmA, ServiceManager cmB )
           throws Exception
       {
           m_logger.info( "Test Case: " + name );
  @@ -304,7 +302,7 @@
           }
       }
   
  -    protected long getLookupRunTime( ComponentManager manager )
  +    protected long getLookupRunTime( ServiceManager manager )
       {
           // Create the runnable
           LookupRunner runnable = new LookupRunner( manager, m_logger );
  @@ -340,11 +338,11 @@
       private static class LookupRunner implements Runnable
       {
           private Logger m_logger;
  -        private ComponentManager m_manager;
  +        private ServiceManager m_manager;
           private int m_getCount = 0;
           private Throwable m_throwable = null;
   
  -        public LookupRunner( ComponentManager manager, Logger logger )
  +        public LookupRunner( ServiceManager manager, Logger logger )
           {
               m_manager = manager;
               m_logger = logger;
  @@ -367,8 +365,6 @@
               for( int i = 0; i < loops; i++ )
               {
                   Parser parser = null;
  -                DataSourceComponent datasource = null;
  -                Monitor monitor = null;
   
                   try
                   {
  @@ -392,10 +388,12 @@
                   {
                       if( null != parser )
                       {
  -                        m_manager.release( (Component) parser );
  +                        m_manager.release( parser );
                       }
                   }
                   /*
  +                DataSourceComponent datasource = null;
  +
                   try
                   {
                       datasource = (DataSourceComponent) m_manager.lookup(DataSourceComponent.ROLE);
  @@ -421,6 +419,8 @@
                       }
                   }
                   */
  +                Monitor monitor = null;
  +
                   try
                   {
                       monitor = (Monitor)m_manager.lookup( Monitor.ROLE );
  @@ -443,7 +443,7 @@
                   {
                       if( null != monitor )
                       {
  -                        m_manager.release( (Component) monitor );
  +                        m_manager.release( monitor );
                       }
                   }
               }
  
  
  

--
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