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/util/test ConfigurableRoleManagerTestCase.java ExcaliburRoleManagerTestCase.java
Date Thu, 02 May 2002 17:33:02 GMT
bloritsch    02/05/02 10:33:02

  Modified:    fortress/src/java/org/apache/excalibur/fortress
                        AbstractContainer.java DefaultContainerManager.java
               fortress/src/java/org/apache/excalibur/fortress/util
                        ContextBuilder.java ContextManager.java
               fortress/src/test/org/apache/excalibur/fortress/util/test
                        ConfigurableRoleManagerTestCase.java
                        ExcaliburRoleManagerTestCase.java
  Log:
  make the tests work again
  
  Revision  Changes    Path
  1.32      +6 -6      jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/AbstractContainer.java
  
  Index: AbstractContainer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/AbstractContainer.java,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- AbstractContainer.java	24 Apr 2002 18:31:14 -0000	1.31
  +++ AbstractContainer.java	2 May 2002 17:33:02 -0000	1.32
  @@ -11,15 +11,15 @@
   import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.List;
  +import org.apache.excalibur.event.command.Command;
  +import org.apache.excalibur.event.Queue;
  +import org.apache.excalibur.fortress.handler.ComponentHandler;
  +import org.apache.excalibur.fortress.util.ExcaliburRoleManager;
  +import org.apache.excalibur.fortress.util.RoleManager;
   import org.apache.avalon.excalibur.collections.BucketMap;
   import org.apache.avalon.excalibur.collections.FixedSizeBuffer;
  -import org.apache.avalon.excalibur.event.command.Command;
  -import org.apache.avalon.excalibur.event.Queue;
   import org.apache.avalon.excalibur.logger.LoggerManager;
   import org.apache.avalon.excalibur.mpool.PoolManager;
  -import org.apache.excalibur.fortress.handler.ComponentHandler;
  -import org.apache.excalibur.fortress.util.ExcaliburRoleManager;
  -import org.apache.excalibur.fortress.util.RoleManager;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.component.Component;
  @@ -44,7 +44,7 @@
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:proyal@apache.org">Peter Royal</a>
  - * @version CVS $Revision: 1.31 $ $Date: 2002/04/24 18:31:14 $
  + * @version CVS $Revision: 1.32 $ $Date: 2002/05/02 17:33:02 $
    */
   public abstract class AbstractContainer
       extends AbstractLogEnabled
  
  
  
  1.8       +2 -2      jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/DefaultContainerManager.java
  
  Index: DefaultContainerManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/DefaultContainerManager.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DefaultContainerManager.java	4 Apr 2002 16:04:28 -0000	1.7
  +++ DefaultContainerManager.java	2 May 2002 17:33:02 -0000	1.8
  @@ -9,7 +9,7 @@
   
   import org.apache.avalon.excalibur.logger.LoggerManager;
   import org.apache.excalibur.fortress.util.ContextManager;
  -import org.apache.avalon.excalibur.util.ComponentStateValidator;
  +import org.apache.excalibur.util.ComponentStateValidator;
   import org.apache.avalon.framework.activity.Disposable;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.activity.Startable;
  @@ -40,7 +40,7 @@
    * </p>
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.7 $ $Date: 2002/04/04 16:04:28 $
  + * @version CVS $Revision: 1.8 $ $Date: 2002/05/02 17:33:02 $
    */
   public class DefaultContainerManager implements ContainerManager, ContainerManagerConstants
   {
  
  
  
  1.9       +1 -1      jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/util/ContextBuilder.java
  
  Index: ContextBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/util/ContextBuilder.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ContextBuilder.java	13 Apr 2002 01:39:57 -0000	1.8
  +++ ContextBuilder.java	2 May 2002 17:33:02 -0000	1.9
  @@ -2,7 +2,7 @@
   
   import java.io.File;
   import org.apache.avalon.excalibur.instrument.InstrumentManager;
  -import org.apache.avalon.excalibur.event.Queue;
  +import org.apache.excalibur.event.Queue;
   import org.apache.avalon.excalibur.logger.LoggerManager;
   import org.apache.avalon.excalibur.mpool.PoolManager;
   import org.apache.avalon.framework.component.ComponentManager;
  
  
  
  1.17      +3 -3      jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/util/ContextManager.java
  
  Index: ContextManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/util/ContextManager.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ContextManager.java	24 Apr 2002 18:33:18 -0000	1.16
  +++ ContextManager.java	2 May 2002 17:33:02 -0000	1.17
  @@ -10,8 +10,8 @@
   import java.util.ArrayList;
   import java.util.Iterator;
   import org.apache.avalon.excalibur.instrument.manager.DefaultInstrumentManager;
  -import org.apache.avalon.excalibur.event.Queue;
  -import org.apache.avalon.excalibur.event.command.CommandManager;
  +import org.apache.excalibur.event.Queue;
  +import org.apache.excalibur.event.command.CommandManager;
   import org.apache.avalon.excalibur.logger.LogKitLoggerManager;
   import org.apache.avalon.excalibur.logger.LoggerManager;
   import org.apache.avalon.excalibur.mpool.DefaultPoolManager;
  @@ -61,7 +61,7 @@
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
    * @author <a href="mailto:leo.sutic@inspireinfrastructure.com">Leo Sutic</a>
    * @author <a href="mailto:proyal@apache.org">Peter Royal</a>
  - * @version CVS $Revision: 1.16 $ $Date: 2002/04/24 18:33:18 $
  + * @version CVS $Revision: 1.17 $ $Date: 2002/05/02 17:33:02 $
    * @since 4.1
    */
   public class ContextManager implements ContextManagerConstants
  
  
  
  1.8       +6 -6      jakarta-avalon-excalibur/fortress/src/test/org/apache/excalibur/fortress/util/test/ConfigurableRoleManagerTestCase.java
  
  Index: ConfigurableRoleManagerTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/test/org/apache/excalibur/fortress/util/test/ConfigurableRoleManagerTestCase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ConfigurableRoleManagerTestCase.java	13 Apr 2002 01:39:57 -0000	1.7
  +++ ConfigurableRoleManagerTestCase.java	2 May 2002 17:33:02 -0000	1.8
  @@ -17,7 +17,7 @@
    * in the org.apache.avalon.component package.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.7 $ $Date: 2002/04/13 01:39:57 $
  + * @version CVS $Revision: 1.8 $ $Date: 2002/05/02 17:33:02 $
    * @since 4.1
    */
   public class ConfigurableRoleManagerTestCase
  @@ -40,7 +40,7 @@
           DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
           ConfigurableRoleManager roles = new ConfigurableRoleManager( null, this.getClass().getClassLoader()
);
           roles.configure( builder.build( this.getClass().getClassLoader()
  -                                        .getResourceAsStream( "org.apache.excalibur.fortress/test/ContainerProfile.roles"
) ) );
  +                                        .getResourceAsStream( "org/apache/excalibur/fortress/test/ContainerProfile.roles"
) ) );
   
           assertEquals(
               roles.getClassForName( "datasource" ),
  @@ -65,7 +65,7 @@
           DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
           ConfigurableRoleManager roles = new ConfigurableRoleManager( null, this.getClass().getClassLoader()
);
           roles.configure( builder.build( this.getClass().getClassLoader()
  -                                        .getResourceAsStream( "org.apache.excalibur.fortress/test/ContainerProfile.roles"
) ) );
  +                                        .getResourceAsStream( "org/apache/excalibur/fortress/test/ContainerProfile.roles"
) ) );
   
           assertEquals(
               roles.getNameForClass( Class.forName( "org.apache.avalon.excalibur.datasource.JdbcDataSource"
) ),
  @@ -90,7 +90,7 @@
           DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
           ConfigurableRoleManager roles = new ConfigurableRoleManager( null, this.getClass().getClassLoader()
);
           roles.configure( builder.build( this.getClass().getClassLoader()
  -                                        .getResourceAsStream( "org.apache.excalibur.fortress/test/ContainerProfile.roles"
) ) );
  +                                        .getResourceAsStream( "org/apache/excalibur/fortress/test/ContainerProfile.roles"
) ) );
   
           assertEquals(
               roles.getRoleForClass( Class.forName( "org.apache.avalon.excalibur.datasource.JdbcDataSource"
) ),
  @@ -115,7 +115,7 @@
           DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
           ConfigurableRoleManager roles = new ConfigurableRoleManager( null, this.getClass().getClassLoader()
);
           roles.configure( builder.build( this.getClass().getClassLoader()
  -                                        .getResourceAsStream( "org.apache.excalibur.fortress/test/ContainerProfile.roles"
) ) );
  +                                        .getResourceAsStream( "org/apache/excalibur/fortress/test/ContainerProfile.roles"
) ) );
   
           Class[] classes = roles.getClassesForRole( "org.apache.avalon.excalibur.datasource.DataSourceComponent"
);
   
  @@ -148,7 +148,7 @@
           DefaultConfigurationBuilder builder = new DefaultConfigurationBuilder();
           ConfigurableRoleManager roles = new ConfigurableRoleManager( null, this.getClass().getClassLoader()
);
           roles.configure( builder.build( this.getClass().getClassLoader()
  -                                        .getResourceAsStream( "org.apache.excalibur.fortress/test/ContainerProfile.roles"
) ) );
  +                                        .getResourceAsStream( "org/apache/excalibur/fortress/test/ContainerProfile.roles"
) ) );
   
           assertEquals(
               roles.getHandlerClassForClass( Class.forName( "org.apache.avalon.excalibur.datasource.JdbcDataSource"
) ),
  
  
  
  1.8       +55 -28    jakarta-avalon-excalibur/fortress/src/test/org/apache/excalibur/fortress/util/test/ExcaliburRoleManagerTestCase.java
  
  Index: ExcaliburRoleManagerTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/fortress/src/test/org/apache/excalibur/fortress/util/test/ExcaliburRoleManagerTestCase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ExcaliburRoleManagerTestCase.java	1 May 2002 04:12:39 -0000	1.7
  +++ ExcaliburRoleManagerTestCase.java	2 May 2002 17:33:02 -0000	1.8
  @@ -16,18 +16,30 @@
    * in the org.apache.avalon.component package.
    *
    * @author <a href="mailto:bloritsch@apache.org">Berin Loritsch</a>
  - * @version CVS $Revision: 1.7 $ $Date: 2002/05/01 04:12:39 $
  + * @version CVS $Revision: 1.8 $ $Date: 2002/05/02 17:33:02 $
    * @since 4.1
    */
   public class ExcaliburRoleManagerTestCase
       extends TestCase
   {
  +    boolean m_informixClassExists = false;
  +
       /**
        * Default constructor--this RoleManager has no parent.
        */
       public ExcaliburRoleManagerTestCase( String name )
       {
           super( name );
  +
  +        try
  +        {
  +            Class.forName( "org.apache.avalon.excalibur.datasource.InformixDataSource"
);
  +            m_informixClassExists = true;
  +        }
  +        catch (Exception e)
  +        {
  +            m_informixClassExists = false;
  +        }
       }
   
       /**
  @@ -54,10 +66,13 @@
               roles.getClassForName( "j2ee-datasource" ),
               Class.forName( "org.apache.avalon.excalibur.datasource.J2eeDataSource" )
           );
  -        assertEquals(
  -            roles.getClassForName( "informix-datasource" ),
  -            Class.forName( "org.apache.avalon.excalibur.datasource.InformixDataSource"
)
  -        );
  +        if ( m_informixClassExists )
  +        {
  +            assertEquals(
  +                roles.getClassForName( "informix-datasource" ),
  +                Class.forName( "org.apache.avalon.excalibur.datasource.InformixDataSource"
)
  +            );
  +        }
           assertEquals(
               roles.getClassForName( "i18n" ),
               Class.forName( "org.apache.avalon.excalibur.i18n.BundleSelector" )
  @@ -80,7 +95,7 @@
           );
           assertEquals(
               roles.getClassForName( "resolver" ),
  -            Class.forName( "org.apache.avalon.excalibur.source.SourceResolverImpl" )
  +            Class.forName( "org.apache.excalibur.source.impl.SourceResolverImpl" )
           );
           assertEquals(
               roles.getClassForName( "parser" ),
  @@ -116,10 +131,13 @@
               roles.getNameForClass( Class.forName( "org.apache.avalon.excalibur.datasource.J2eeDataSource"
) ),
               "j2ee-datasource"
           );
  -        assertEquals(
  -            roles.getNameForClass( Class.forName( "org.apache.avalon.excalibur.datasource.InformixDataSource"
) ),
  -            "informix-datasource"
  -        );
  +        if ( m_informixClassExists )
  +        {
  +            assertEquals(
  +                roles.getNameForClass( Class.forName( "org.apache.avalon.excalibur.datasource.InformixDataSource"
) ),
  +                "informix-datasource"
  +            );
  +        }
           assertEquals(
               roles.getNameForClass( Class.forName( "org.apache.avalon.excalibur.i18n.BundleSelector"
) ),
               "i18n"
  @@ -141,7 +159,7 @@
               "jaxpath"
           );
           assertEquals(
  -            roles.getNameForClass( Class.forName( "org.apache.avalon.excalibur.source.SourceResolverImpl"
) ),
  +            roles.getNameForClass( Class.forName( "org.apache.excalibur.source.impl.SourceResolverImpl"
) ),
               "resolver"
           );
           assertEquals(
  @@ -178,10 +196,13 @@
               roles.getRoleForClass( Class.forName( "org.apache.avalon.excalibur.datasource.J2eeDataSource"
) ),
               "org.apache.avalon.excalibur.datasource.DataSourceComponent"
           );
  -        assertEquals(
  -            roles.getRoleForClass( Class.forName( "org.apache.avalon.excalibur.datasource.InformixDataSource"
) ),
  -            "org.apache.avalon.excalibur.datasource.DataSourceComponent"
  -        );
  +        if ( m_informixClassExists )
  +        {
  +            assertEquals(
  +                roles.getRoleForClass( Class.forName( "org.apache.avalon.excalibur.datasource.InformixDataSource"
) ),
  +                "org.apache.avalon.excalibur.datasource.DataSourceComponent"
  +            );
  +        }
           assertEquals(
               roles.getRoleForClass( Class.forName( "org.apache.avalon.excalibur.i18n.BundleSelector"
) ),
               "org.apache.avalon.excalibur.i18n.BundleSelector"
  @@ -203,8 +224,8 @@
               "org.apache.avalon.excalibur.xml.xpath.XPathProcessor"
           );
           assertEquals(
  -            roles.getRoleForClass( Class.forName( "org.apache.avalon.excalibur.source.SourceResolverImpl"
) ),
  -            "org.apache.avalon.excalibur.source.SourceResolver"
  +            roles.getRoleForClass( Class.forName( "org.apache.excalibur.source.impl.SourceResolverImpl"
) ),
  +            "org.apache.excalibur.source.SourceResolver"
           );
           assertEquals(
               roles.getRoleForClass( Class.forName( "org.apache.avalon.excalibur.xml.JaxpParser"
) ),
  @@ -245,10 +266,13 @@
               classes[ 1 ],
               Class.forName( "org.apache.avalon.excalibur.datasource.J2eeDataSource" )
           );
  -        assertEquals(
  -            classes[ 2 ],
  -            Class.forName( "org.apache.avalon.excalibur.datasource.InformixDataSource"
)
  -        );
  +        if ( m_informixClassExists )
  +        {
  +            assertEquals(
  +                classes[ 2 ],
  +                Class.forName( "org.apache.avalon.excalibur.datasource.InformixDataSource"
)
  +            );
  +        }
   
           classes = roles.getClassesForRole( "org.apache.avalon.excalibur.i18n.BundleSelector"
);
   
  @@ -279,11 +303,11 @@
               Class.forName( "org.apache.avalon.excalibur.xml.xpath.JaxenProcessorImpl" )
           );
   
  -        classes = roles.getClassesForRole( "org.apache.avalon.excalibur.source.SourceResolver"
);
  +        classes = roles.getClassesForRole( "org.apache.excalibur.source.SourceResolver"
);
   
           assertEquals(
               classes[ 0 ],
  -            Class.forName( "org.apache.avalon.excalibur.source.SourceResolverImpl" )
  +            Class.forName( "org.apache.excalibur.source.impl.SourceResolverImpl" )
           );
   
           classes = roles.getClassesForRole( "org.apache.avalon.excalibur.xml.Parser" );
  @@ -322,10 +346,13 @@
               roles.getHandlerClassForClass( Class.forName( "org.apache.avalon.excalibur.datasource.J2eeDataSource"
) ),
               Class.forName( "org.apache.excalibur.fortress.handler.ThreadSafeComponentHandler"
)
           );
  -        assertEquals(
  -            roles.getHandlerClassForClass( Class.forName( "org.apache.avalon.excalibur.datasource.InformixDataSource"
) ),
  -            Class.forName( "org.apache.excalibur.fortress.handler.ThreadSafeComponentHandler"
)
  -        );
  +        if ( m_informixClassExists )
  +        {
  +            assertEquals(
  +                roles.getHandlerClassForClass( Class.forName( "org.apache.avalon.excalibur.datasource.InformixDataSource"
) ),
  +                Class.forName( "org.apache.excalibur.fortress.handler.ThreadSafeComponentHandler"
)
  +            );
  +        }
           assertEquals(
               roles.getHandlerClassForClass( Class.forName( "org.apache.avalon.excalibur.i18n.BundleSelector"
) ),
               Class.forName( "org.apache.excalibur.fortress.handler.ThreadSafeComponentHandler"
)
  @@ -347,7 +374,7 @@
               Class.forName( "org.apache.excalibur.fortress.handler.ThreadSafeComponentHandler"
)
           );
           assertEquals(
  -            roles.getHandlerClassForClass( Class.forName( "org.apache.avalon.excalibur.source.SourceResolverImpl"
) ),
  +            roles.getHandlerClassForClass( Class.forName( "org.apache.excalibur.source.impl.SourceResolverImpl"
) ),
               Class.forName( "org.apache.excalibur.fortress.handler.ThreadSafeComponentHandler"
)
           );
           assertEquals(
  
  
  

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