commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ebo...@apache.org
Subject cvs commit: jakarta-commons/configuration/src/test/org/apache/commons/configuration TestJNDIConfiguration.java
Date Thu, 08 Jul 2004 15:29:51 GMT
ebourg      2004/07/08 08:29:51

  Modified:    configuration/src/test/org/apache/commons/configuration
                        TestJNDIConfiguration.java
  Log:
  added testContainsKey()
  
  Revision  Changes    Path
  1.8       +15 -11    jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestJNDIConfiguration.java
  
  Index: TestJNDIConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestJNDIConfiguration.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TestJNDIConfiguration.java	4 May 2004 22:14:29 -0000	1.7
  +++ TestJNDIConfiguration.java	8 Jul 2004 15:29:50 -0000	1.8
  @@ -20,25 +20,26 @@
   
   /**
    * Test to see if the JNDIConfiguration works properly.  Currently excluded
  - * in the project.xml unitTest section as our JNDI provider doesn't 
  + * in the project.xml unitTest section as our JNDI provider doesn't
    * properly support the listBindings() method.
  - * 
  + *
    * This does work fine with Tomcat's JNDI provider however.
    *
    * @version $Id$
    */
   public class TestJNDIConfiguration extends TestCase {
   
  +    public static final String CONTEXT_FACTORY =
  +            "org.apache.commons.configuration.MockStaticMemoryInitialContextFactory";
  +
       private JNDIConfiguration conf;
       private NonStringTestHolder nonStringTestHolder;
   
       public void setUp() throws Exception {
  -        
  -        System.setProperty("java.naming.factory.initial","org.apache.commons.configuration.MockStaticMemoryInitialContextFactory");
  -        
  +
  +        System.setProperty("java.naming.factory.initial", CONTEXT_FACTORY);
   
           conf = new JNDIConfiguration();
  -        conf.setPrefix("");
   
           nonStringTestHolder = new NonStringTestHolder();
           nonStringTestHolder.setConfiguration(conf);
  @@ -110,10 +111,13 @@
           assertEquals("true", o.toString());
       }
   
  +    public void testContainsKey()
  +    {
  +        String key = "test.boolean";
  +        assertTrue("'" + key + "' not found", conf.containsKey(key));
   
  -
  -   
  -
  - 
  +        conf.clearProperty(key);
  +        assertFalse("'" + key + "' still found", conf.containsKey(key));
  +    }
   
   }
  
  
  

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


Mime
View raw message