ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components AbstractComponentTest.java
Date Thu, 27 Jun 2002 23:32:27 GMT
donaldp     2002/06/27 16:32:27

  Modified:    container/src/test/org/apache/myrmidon/components
                        AbstractComponentTest.java
  Log:
  Reuse ContainerUtil rather than doing own management
  
  Revision  Changes    Path
  1.49      +6 -30     jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/AbstractComponentTest.java
  
  Index: AbstractComponentTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/AbstractComponentTest.java,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- AbstractComponentTest.java	21 Jun 2002 08:05:35 -0000	1.48
  +++ AbstractComponentTest.java	27 Jun 2002 23:32:27 -0000	1.49
  @@ -13,15 +13,11 @@
   import java.util.Iterator;
   import java.util.List;
   import java.util.Map;
  -import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.container.ContainerUtil;
   import org.apache.avalon.framework.context.Context;
  -import org.apache.avalon.framework.context.Contextualizable;
   import org.apache.avalon.framework.context.DefaultContext;
  -import org.apache.avalon.framework.logger.LogEnabled;
   import org.apache.avalon.framework.logger.Logger;
   import org.apache.avalon.framework.service.DefaultServiceManager;
  -import org.apache.avalon.framework.service.Serviceable;
   import org.apache.excalibur.converter.Converter;
   import org.apache.excalibur.converter.ConverterFactory;
   import org.apache.excalibur.converter.lib.SimpleConverterFactory;
  @@ -32,6 +28,7 @@
   import org.apache.myrmidon.components.converter.DefaultMasterConverter;
   import org.apache.myrmidon.components.deployer.DefaultDeployer;
   import org.apache.myrmidon.components.event.DefaultTaskEventManager;
  +import org.apache.myrmidon.components.executor.DefaultExecutionFrame;
   import org.apache.myrmidon.components.executor.DefaultExecutor;
   import org.apache.myrmidon.components.extensions.DefaultExtensionManager;
   import org.apache.myrmidon.components.library.DefaultLibraryManager;
  @@ -45,7 +42,6 @@
   import org.apache.myrmidon.interfaces.converter.ConverterRegistry;
   import org.apache.myrmidon.interfaces.deployer.Deployer;
   import org.apache.myrmidon.interfaces.event.TaskEventManager;
  -import org.apache.myrmidon.components.executor.DefaultExecutionFrame;
   import org.apache.myrmidon.interfaces.executor.ExecutionFrame;
   import org.apache.myrmidon.interfaces.executor.Executor;
   import org.apache.myrmidon.interfaces.extensions.ExtensionManager;
  @@ -146,46 +142,26 @@
               // Log enable the components
               for( Iterator iterator = components.iterator(); iterator.hasNext(); )
               {
  -                Object obj = iterator.next();
  -                if( obj instanceof LogEnabled )
  -                {
  -                    final LogEnabled logEnabled = (LogEnabled)obj;
  -                    logEnabled.enableLogging( logger );
  -                }
  +                ContainerUtil.enableLogging( iterator.next(), logger );
               }
   
               // Contextualise the components
               final Context context = new DefaultContext( getParameters() );
               for( Iterator iterator = components.iterator(); iterator.hasNext(); )
               {
  -                Object obj = iterator.next();
  -                if( obj instanceof Contextualizable )
  -                {
  -                    final Contextualizable contextualizable = (Contextualizable)obj;
  -                    contextualizable.contextualize( context );
  -                }
  +                ContainerUtil.contextualize( iterator.next(), context );
               }
   
               // Compose the components
               for( Iterator iterator = components.iterator(); iterator.hasNext(); )
               {
  -                Object obj = iterator.next();
  -                if( obj instanceof Serviceable )
  -                {
  -                    final Serviceable serviceable = (Serviceable)obj;
  -                    serviceable.service( m_serviceManager );
  -                }
  +                ContainerUtil.service( iterator.next(), m_serviceManager );
               }
   
               // Initialise the components
               for( Iterator iterator = components.iterator(); iterator.hasNext(); )
               {
  -                Object obj = iterator.next();
  -                if( obj instanceof Initializable )
  -                {
  -                    final Initializable initializable = (Initializable)obj;
  -                    initializable.initialize();
  -                }
  +                ContainerUtil.initialize( iterator.next() );
               }
   
               // Register some standard roles
  
  
  

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


Mime
View raw message