commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsi...@apache.org
Subject cvs commit: jakarta-commons/discovery/src/test/org/apache/commons/discovery TestAll.java
Date Fri, 09 Aug 2002 19:42:15 GMT
rsitze      2002/08/09 12:42:15

  Modified:    discovery/src/test/org/apache/commons/discovery TestAll.java
  Log:
  New test case.
  
  Revision  Changes    Path
  1.7       +25 -5     jakarta-commons/discovery/src/test/org/apache/commons/discovery/TestAll.java
  
  Index: TestAll.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/discovery/src/test/org/apache/commons/discovery/TestAll.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestAll.java	9 Aug 2002 14:58:00 -0000	1.6
  +++ TestAll.java	9 Aug 2002 19:42:15 -0000	1.7
  @@ -97,7 +97,7 @@
           
           try {
               factory = (LogFactory)DiscoverSingleton.find(LogFactory.class,
  -                                                 LogFactoryImpl.class.getName());
  +                                                         LogFactoryImpl.class.getName());
   
               assertTrue(factory.getClass().getName() + "!=" + LogFactoryImpl.class.getName(),
                          factory.getClass().getName().equals(LogFactoryImpl.class.getName()));
  @@ -114,7 +114,7 @@
   
           try {
               factory = (LogFactory)DiscoverSingleton.find(LogFactory.class,
  -                                                 MyFactory.class.getName());
  +                                                         MyFactory.class.getName());
   
               assertTrue(factory.getClass().getName() + "!=" + MyFactory.class.getName(),
                          factory.getClass().getName().equals(MyFactory.class.getName()));
  @@ -131,7 +131,7 @@
           
           try {
               factory = (LogFactory)DiscoverSingleton.find(LogFactory.class,
  -                                                 LogFactoryImpl.class.getName());
  +                                                         LogFactoryImpl.class.getName());
   
               assertTrue("1. " + factory.getClass().getName() + "!=" + LogFactoryImpl.class.getName(),
                          factory.getClass().getName().equals(LogFactoryImpl.class.getName()));
  @@ -157,7 +157,7 @@
           
           try {
               factory = (LogFactory)DiscoverSingleton.find(LogFactory.class,
  -                                                 LogFactoryImpl.class.getName());
  +                                                         LogFactoryImpl.class.getName());
   
               assertTrue("1. " + factory.getClass().getName() + "!=" + LogFactoryImpl.class.getName(),
                          factory.getClass().getName().equals(LogFactoryImpl.class.getName()));
  @@ -165,7 +165,7 @@
               DiscoverSingleton.release();
               
               factory = (LogFactory)DiscoverSingleton.find(LogFactory.class,
  -                                                 MyFactory.class.getName());
  +                                                         MyFactory.class.getName());
   
               // Cache flushed, get new factory:
               assertTrue("2. " + factory.getClass().getName() + "!=" + MyFactory.class.getName(),
  @@ -227,6 +227,26 @@
                */
               ManagedProperties.setProperty(LogFactory.class.getName(), null);
               ManagedProperties.setProperty(Log.class.getName(), null);
  +        }
  +    }
  +    
  +
  +    public void testFindGroupLogFactoryImplPropFileDefault() {
  +        LogFactory factory = null;
  +        
  +        try {
  +            factory = (LogFactory)DiscoverSingleton.find((String)null /* groupContext */,
  +                                   LogFactory.class,
  +                                   LogFactory.FACTORY_PROPERTIES,
  +                                   LogFactory.FACTORY_DEFAULT);
  +
  +            assertTrue(factory.getClass().getName() + "!=" + LogFactoryImpl.class.getName(),
  +                       factory.getClass().getName().equals(LogFactoryImpl.class.getName()));
  +        } finally {
  +            if (factory != null)
  +                factory.releaseAll();
  +
  +            DiscoverSingleton.release();
           }
       }
   
  
  
  

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


Mime
View raw message