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/src/scratchpad/org/apache/avalon/excalibur/util/test ComponentTestCase.java
Date Tue, 05 Feb 2002 19:40:28 GMT
bloritsch    02/02/05 11:40:28

  Modified:    src/scratchpad/org/apache/avalon/excalibur/system
                        ContainerManager.java
               src/scratchpad/org/apache/avalon/excalibur/util/test
                        ComponentTestCase.java
  Log:
  fix lifecycle management error and use NullLogger for ComponentTestCase
  
  Revision  Changes    Path
  1.16      +5 -5      jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system/ContainerManager.java
  
  Index: ContainerManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/system/ContainerManager.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ContainerManager.java	5 Feb 2002 19:08:05 -0000	1.15
  +++ ContainerManager.java	5 Feb 2002 19:40:28 -0000	1.16
  @@ -116,7 +116,7 @@
    * </table>
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.15 $ $Date: 2002/02/05 19:08:05 $
  + * @version CVS $Revision: 1.16 $ $Date: 2002/02/05 19:40:28 $
    */
   public class ContainerManager
   {
  @@ -307,14 +307,14 @@
   
           try
           {
  -            if ( instance instanceof Contextualizable )
  +            if ( instance instanceof LogEnabled )
               {
  -                ( (Contextualizable) instance ).contextualize( getContext() );
  +                ( (LogEnabled) instance ).enableLogging( getLogger() );
               }
   
  -            if ( instance instanceof LogEnabled )
  +            if ( instance instanceof Contextualizable )
               {
  -                ( (LogEnabled) instance ).enableLogging( getLogger() );
  +                ( (Contextualizable) instance ).contextualize( getContext() );
               }
   
               if ( instance instanceof Composable )
  
  
  
  1.4       +11 -12    jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/util/test/ComponentTestCase.java
  
  Index: ComponentTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/src/scratchpad/org/apache/avalon/excalibur/util/test/ComponentTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ComponentTestCase.java	17 Jan 2002 15:02:01 -0000	1.3
  +++ ComponentTestCase.java	5 Feb 2002 19:40:28 -0000	1.4
  @@ -14,17 +14,16 @@
   import org.apache.avalon.framework.configuration.DefaultConfiguration;
   import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.context.DefaultContext;
  -import org.apache.avalon.framework.logger.LogKitLogger;
  +import org.apache.avalon.framework.logger.NullLogger;
   import org.apache.avalon.framework.parameters.ParameterException;
   import org.apache.avalon.framework.parameters.Parameters;
  -import org.apache.log.Hierarchy;
   
   /**
    * This class provides basic facilities for enforcing Avalon's contracts
    * within your own code.
    *
    * @author <a href="bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.3 $ $Date: 2002/01/17 15:02:01 $
  + * @version CVS $Revision: 1.4 $ $Date: 2002/02/05 19:40:28 $
    */
   public final class ComponentTestCase
       extends TestCase
  @@ -39,7 +38,7 @@
       {
           FullLifecycleComponent component = new FullLifecycleComponent();
   
  -        component.enableLogging(new LogKitLogger(Hierarchy.getDefaultHierarchy().getLoggerFor("")));
  +        component.enableLogging( new NullLogger() );
           component.contextualize(new DefaultContext());
           component.compose(new DefaultComponentManager());
           component.configure(new DefaultConfiguration("", ""));
  @@ -73,7 +72,7 @@
       {
           FullLifecycleComponent component = new FullLifecycleComponent();
   
  -        component.enableLogging(new LogKitLogger(Hierarchy.getDefaultHierarchy().getLoggerFor("")));
  +        component.enableLogging( new NullLogger() );
           component.contextualize(new DefaultContext());
           component.compose(new DefaultComponentManager());
           try
  @@ -93,7 +92,7 @@
       {
           FullLifecycleComponent component = new FullLifecycleComponent();
   
  -        component.enableLogging(new LogKitLogger(Hierarchy.getDefaultHierarchy().getLoggerFor("")));
  +        component.enableLogging( new NullLogger() );
           component.contextualize(new DefaultContext());
           component.compose(new DefaultComponentManager());
           component.configure(new DefaultConfiguration("", ""));
  @@ -121,8 +120,8 @@
   
           try
           {
  -            component.enableLogging(new LogKitLogger(Hierarchy.getDefaultHierarchy().getLoggerFor("")));
  -            component.enableLogging(new LogKitLogger(Hierarchy.getDefaultHierarchy().getLoggerFor("")));
  +            component.enableLogging( new NullLogger() );
  +            component.enableLogging( new NullLogger() );
           }
           catch (Exception e)
           {
  @@ -137,7 +136,7 @@
       {
           FullLifecycleComponent component = new FullLifecycleComponent();
   
  -        component.enableLogging(new LogKitLogger(Hierarchy.getDefaultHierarchy().getLoggerFor("")));
  +        component.enableLogging( new NullLogger() );
           try
           {
               component.contextualize(new DefaultContext());
  @@ -157,7 +156,7 @@
       {
           FullLifecycleComponent component = new FullLifecycleComponent();
   
  -        component.enableLogging(new LogKitLogger(Hierarchy.getDefaultHierarchy().getLoggerFor("")));
  +        component.enableLogging( new NullLogger() );
           component.contextualize(new DefaultContext());
           component.compose(new DefaultComponentManager());
           component.configure(new DefaultConfiguration("", ""));
  @@ -180,7 +179,7 @@
       {
           FullLifecycleComponent component = new FullLifecycleComponent();
   
  -        component.enableLogging(new LogKitLogger(Hierarchy.getDefaultHierarchy().getLoggerFor("")));
  +        component.enableLogging( new NullLogger() );
           component.contextualize(new DefaultContext());
           component.compose(new DefaultComponentManager());
           try
  @@ -202,7 +201,7 @@
       {
           FullLifecycleComponent component = new FullLifecycleComponent();
   
  -        component.enableLogging(new LogKitLogger(Hierarchy.getDefaultHierarchy().getLoggerFor("")));
  +        component.enableLogging( new NullLogger() );
           component.contextualize(new DefaultContext());
           try
           {
  
  
  

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