commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ep...@apache.org
Subject cvs commit: jakarta-commons/configuration/conf testDigesterConfiguration3.xml
Date Sat, 14 Feb 2004 20:06:23 GMT
epugh       2004/02/14 12:06:23

  Modified:    configuration/xdocs changes.xml
               configuration/src/test/org/apache/commons/configuration
                        TestJNDIConfiguration.java
                        TestJNDIEnvironmentValues.java
               configuration/src/java/org/apache/commons/configuration
                        JNDIConfiguration.java
  Added:       configuration/conf testDigesterConfiguration3.xml
  Log:
  Fixes for JNDI
  
  Revision  Changes    Path
  1.10      +5 -2      jakarta-commons/configuration/xdocs/changes.xml
  
  Index: changes.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/xdocs/changes.xml,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- changes.xml	14 Feb 2004 18:54:21 -0000	1.9
  +++ changes.xml	14 Feb 2004 20:06:23 -0000	1.10
  @@ -6,8 +6,11 @@
     </properties>
   
     <body>
  -    <release version="1.0-dev-4" date="">
  -	 <action dev="epugh" type="add">
  +    <release version="1.0-dev-4" date=""> 
  +	 <action dev="epugh" type="update">
  +      	Bugzilla 16504 Enhancement: Configuration Comparator
  +     </action>        
  +	 <action dev="epugh" type="update">
         	Bugzilla 26694 (BaseConfiguration: containsKey ignores default properties).  I have
changed it so that
         	now the defaults are paid attention to.   
        </action>        
  
  
  
  1.3       +9 -5      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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestJNDIConfiguration.java	12 Feb 2004 12:59:19 -0000	1.2
  +++ TestJNDIConfiguration.java	14 Feb 2004 20:06:23 -0000	1.3
  @@ -54,8 +54,6 @@
    * <http://www.apache.org/>.
    */
   
  -import javax.naming.InitialContext;
  -
   import junit.framework.TestCase;
   
   /**
  @@ -73,8 +71,8 @@
   
       public void setUp() throws Exception
       {
  -		InitialContext context = new InitialContext();
  -		assertNotNull(context);
  +		//InitialContext context = new InitialContext();
  +		//assertNotNull(context);
           
           JNDIConfiguration jndiConfiguration = new JNDIConfiguration();
   		jndiConfiguration.setPrefix("");
  @@ -159,6 +157,12 @@
   		//nonStringTestHolder.testSubset();
   	      
   	 }
  +	  
  +	  public void testProperties() throws Exception{
  +	      Object o = conf.getProperty("test.boolean");
  +	      assertNotNull(o);
  +	      
  +	  }
   
   
       
  
  
  
  1.2       +6 -6      jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestJNDIEnvironmentValues.java
  
  Index: TestJNDIEnvironmentValues.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/TestJNDIEnvironmentValues.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestJNDIEnvironmentValues.java	16 Jan 2004 17:32:36 -0000	1.1
  +++ TestJNDIEnvironmentValues.java	14 Feb 2004 20:06:23 -0000	1.2
  @@ -71,7 +71,7 @@
       {
           JNDIConfiguration conf = new JNDIConfiguration();
           conf.setPrefix("");
  -        String s = conf.getString("test/key");
  +        String s = conf.getString("test.key");
           assertEquals("jndivalue", s);
       }
   
  @@ -79,7 +79,7 @@
       {
           JNDIConfiguration conf = new JNDIConfiguration();
           conf.setPrefix("");
  -        String s = conf.getString("test/key");
  +        String s = conf.getString("test.key");
           assertEquals("jndivalue", s);
           assertEquals("jndivalue2", conf.getString("test.key2"));
           assertEquals(1, conf.getShort("test.short"));
  @@ -91,7 +91,7 @@
           conf.setPrefix("");
           try
           {
  -            conf.getString("test/imaginarykey");
  +            conf.getString("test.imaginarykey");
               fail("Should have thrown NoSuchElementException");
           }
           catch (NoSuchElementException nsee)
  @@ -105,7 +105,7 @@
           JNDIConfiguration conf = new JNDIConfiguration();
           conf.setPrefix("");
   
  -        String result = conf.getString("test/imaginarykey", "bob");
  +        String result = conf.getString("test.imaginarykey", "bob");
           assertEquals("bob", result);
   
       }
  @@ -114,9 +114,9 @@
           JNDIConfiguration conf = new JNDIConfiguration();
           conf.setPrefix("");
   
  -        assertTrue(conf.containsKey("test/key"));
  +        assertTrue(conf.containsKey("test.key"));
   
  -        assertTrue(!conf.containsKey("test/imaginerykey"));
  +        assertTrue(!conf.containsKey("test.imaginerykey"));
   
       }
   }
  
  
  
  1.4       +2 -2      jakarta-commons/configuration/src/java/org/apache/commons/configuration/JNDIConfiguration.java
  
  Index: JNDIConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/java/org/apache/commons/configuration/JNDIConfiguration.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JNDIConfiguration.java	16 Jan 2004 14:27:56 -0000	1.3
  +++ JNDIConfiguration.java	14 Feb 2004 20:06:23 -0000	1.4
  @@ -268,7 +268,7 @@
        */
       public Object getProperty(String key)
       {
  -        throw new Error("This operation is not supported");
  +        return getValueFromJNDI(key);
       }
       /**
        * Set a property, this will replace any previously
  
  
  
  1.1                  jakarta-commons/configuration/conf/testDigesterConfiguration3.xml
  
  Index: testDigesterConfiguration3.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1" ?>
  <!-- Configuration test file that checks all known configuration types -->
  
  <configuration>
    <additional>
      <dom4j fileName="test.xml"/>
      <hierarchicalDom4j fileName="testDigesterConfigurationInclude1.xml" at="tables"/>
      <properties fileName="testDigesterConfigurationInclude2.properties" at="mail"/>
      <jndi prefix=""/>
    </additional>
  </configuration>
  
    
  
  
  
  
  
  
  

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