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-sandbox/configuration project.xml
Date Fri, 20 Jun 2003 07:50:48 GMT
epugh       2003/06/20 00:50:48

  Modified:    configuration/src/test/org/apache/commons/configuration
                        BaseNonStringProperties.java
                        TestNonStringProperties.java
                        TestCompositeConfigurationNonStringProperties.java
               configuration/src/test-cactus/org/apache/commons/configuration
                        TestJNDIAndCompositeConfiguration.java
                        TestJNDIEnvironmentValues.java
                        TestConfigurationFactoryWithJNDI.java
               configuration/src/test-cactus/testapp/WEB-INF web.xml
               configuration/src/java/org/apache/commons/configuration
                        JNDIConfiguration.java CompositeConfiguration.java
                        ConfigurationFactory.java
               configuration/conf test.properties
               configuration project.xml
  Added:       configuration/src/test/org/apache/commons/configuration
                        NonStringTestHolder.java
               configuration/src/test-cactus/org/apache/commons/configuration
                        TestJNDIConfiguration.java
  Log:
  Added new testcase for JNDIConfiguration methods.  Refactored existing
  tests so they could be used with both Cactus and Junit tests.
  Added in many methods to JNDIConfiguration that were missing.
  
  Revision  Changes    Path
  1.5       +136 -157  jakarta-commons-sandbox/configuration/src/test/org/apache/commons/configuration/BaseNonStringProperties.java
  
  Index: BaseNonStringProperties.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/configuration/src/test/org/apache/commons/configuration/BaseNonStringProperties.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BaseNonStringProperties.java	24 Mar 2003 07:23:47 -0000	1.4
  +++ BaseNonStringProperties.java	20 Jun 2003 07:50:47 -0000	1.5
  @@ -65,165 +65,144 @@
   public abstract class BaseNonStringProperties extends TestCase
   {
   
  -	public abstract void setUp() throws Exception;
  +    protected NonStringTestHolder nonStringTestHolder =
  +        new NonStringTestHolder();
  +    public abstract void setUp() throws Exception;
   
  -	public Configuration conf = null;
  +    public Configuration conf = null;
  +
  +    public BaseNonStringProperties(String s) throws Exception
  +    {
  +        super(s);
  +
  +    }
  +
  +    public void testBoolean() throws Exception
  +    {
  +        nonStringTestHolder.testBoolean();
  +    }
  +
  +    public void testBooleanDefaultValue() throws Exception
  +    {
  +        nonStringTestHolder.testBooleanDefaultValue();
  +    }
  +
  +    public void testBooleanArrayValue() throws Exception
  +    {
  +        boolean booleanValue = conf.getBoolean("test.boolean.array");
  +        assertEquals(false, booleanValue);
  +        assertEquals(2, conf.getVector("test.boolean.array").size());
  +    }
  +
  +    public void testByte() throws Exception
  +    {
  +        nonStringTestHolder.testByte();
  +    }
  +
  +    public void testByteArrayValue() throws Exception
  +    {
  +        byte testValue = 20;
  +        byte byteValue = conf.getByte("test.byte.array");
  +        assertEquals(testValue, byteValue);
  +        assertEquals(2, conf.getVector("test.byte.array").size());
  +    }
  +
  +    public void testDouble() throws Exception
  +    {
  +        nonStringTestHolder.testDouble();
  +    }
  +
  +    public void testDoubleDefaultValue() throws Exception
  +    {
  +        nonStringTestHolder.testDoubleDefaultValue();
  +    }
  +
  +    public void testDoubleArrayValue() throws Exception
  +    {
  +        double testValue = 20.35;
  +        double doubleValue = conf.getDouble("test.double.array");
  +        assertEquals(testValue, doubleValue, 0.01);
  +        assertEquals(2, conf.getVector("test.double.array").size());
  +    }
  +
  +    public void testFloat() throws Exception
  +    {
  +        nonStringTestHolder.testFloat();
  +    }
  +
  +    public void testFloatDefaultValue() throws Exception
  +    {
  +        nonStringTestHolder.testFloatDefaultValue();
  +
  +    }
  +
  +    public void testFloatArrayValue() throws Exception
  +    {
  +        float testValue = (float) 30.35;
  +        float floatValue = conf.getFloat("test.float.array");
  +        assertEquals(testValue, floatValue, 0.01);
  +        assertEquals(2, conf.getVector("test.float.array").size());
  +    }
  +
  +    public void testInteger() throws Exception
  +    {
  +        nonStringTestHolder.testInteger();
  +    }
  +
  +    public void testIntegerDefaultValue() throws Exception
  +    {
  +        nonStringTestHolder.testIntegerDefaultValue();
  +    }
  +
  +    public void testIntegerArrayValue() throws Exception
  +    {
  +        int intValue = conf.getInt("test.integer.array");
  +        assertEquals(20, intValue);
  +        assertEquals(2, conf.getVector("test.integer.array").size());
  +    }
  +
  +    public void testLong() throws Exception
  +    {
  +        nonStringTestHolder.testLong();
  +    }
  +    public void testLongDefaultValue() throws Exception
  +    {
  +        nonStringTestHolder.testLongDefaultValue();
  +    }
  +    public void testLongArrayValue() throws Exception
  +    {
  +        long longValue = conf.getLong("test.long.array");
  +        assertEquals(2000000, longValue);
  +        assertEquals(2, conf.getVector("test.long.array").size());
  +    }
  +
  +    public void testShort() throws Exception
  +    {
  +        nonStringTestHolder.testShort();
  +    }
  +
  +    public void testShortDefaultValue() throws Exception
  +    {
  +        nonStringTestHolder.testShortDefaultValue();
  +    }
  +    public void testShortArrayValue() throws Exception
  +    {
  +        short shortValue = conf.getShort("test.short.array");
  +        assertEquals(2, shortValue);
  +        assertEquals(2, conf.getVector("test.short.array").size());
  +    }
   
  -	public BaseNonStringProperties(String s) throws Exception
  -	{
  -		super(s);
  -
  -	}
  -
  -	public void testBoolean() throws Exception
  -	{
  -		boolean booleanValue = conf.getBoolean("test.boolean");
  -		assertEquals(true, booleanValue);
  -		assertEquals(1, conf.getVector("test.boolean").size());
  -	}
  -
  -	public void testBooleanDefaultValue() throws Exception
  -	{
  -		boolean booleanValue = conf.getBoolean("test.boolean.missing", true);
  -		assertEquals(true, booleanValue);
  -
  -		Boolean booleanObject =
  -			conf.getBoolean("test.boolean.missing", new Boolean(true));
  -		assertEquals(new Boolean(true), booleanObject);
  -	}
  -
  -	public void testBooleanArrayValue() throws Exception
  -	{
  -		boolean booleanValue = conf.getBoolean("test.boolean.array");
  -		assertEquals(false, booleanValue);
  -		assertEquals(2, conf.getVector("test.boolean.array").size());
  -	}
  -
  -	public void testByte() throws Exception
  -	{
  -		byte testValue = 10;
  -		byte byteValue = conf.getByte("test.byte");
  -		assertEquals(testValue, byteValue);
  -		assertEquals(1, conf.getVector("test.byte").size());
  -	}
  -
  -	public void testByteArrayValue() throws Exception
  -	{
  -		byte testValue = 20;
  -		byte byteValue = conf.getByte("test.byte.array");
  -		assertEquals(testValue, byteValue);
  -		assertEquals(2, conf.getVector("test.byte.array").size());
  -	}
  -
  -	public void testDouble() throws Exception
  -	{
  -		double testValue = 10.25;
  -		double doubleValue = conf.getDouble("test.double");
  -		assertEquals(testValue, doubleValue, 0.01);
  -		assertEquals(1, conf.getVector("test.double").size());
  -	}
  -
  -	public void testDoubleDefaultValue() throws Exception
  -		{
  -			double testValue = 10.25;
  -			double doubleValue = conf.getDouble("test.double.missing",10.25);
  -					
  -			
  -			assertEquals(testValue, doubleValue, 0.01);
  -		}
  -		
  -	public void testDoubleArrayValue() throws Exception
  -	{
  -		double testValue = 20.35;
  -		double doubleValue = conf.getDouble("test.double.array");
  -		assertEquals(testValue, doubleValue, 0.01);
  -		assertEquals(2, conf.getVector("test.double.array").size());
  -	}
  -
  -	public void testFloat() throws Exception
  -	{
  -		float testValue = (float) 20.25;
  -		float floatValue = conf.getFloat("test.float");
  -		assertEquals(testValue, floatValue, 0.01);
  -		assertEquals(1, conf.getVector("test.float").size());
  -	}
  -	
  -	public void testFloatDefualtFalue() throws Exception
  -	{
  -		float testValue = (float) 20.25;
  -		float floatValue = conf.getFloat("test.float.missing",testValue);
  -		assertEquals(testValue, floatValue, 0.01);
  -
  -	}
  -
  -	public void testFloatArrayValue() throws Exception
  -	{
  -		float testValue = (float) 30.35;
  -		float floatValue = conf.getFloat("test.float.array");
  -		assertEquals(testValue, floatValue, 0.01);
  -		assertEquals(2, conf.getVector("test.float.array").size());
  -	}
  -
  -	public void testInteger() throws Exception
  -	{
  -		int intValue = conf.getInt("test.integer");
  -		assertEquals(10, intValue);
  -		assertEquals(1, conf.getVector("test.integer").size());
  -	}
  -	
  -	public void testIntegerDefaultValue() throws Exception
  -	{
  -		int intValue = conf.getInt("test.integer.missing",10);
  -		assertEquals(10, intValue);
  -	}	
  -
  -	public void testIntegerArrayValue() throws Exception
  -	{
  -		int intValue = conf.getInt("test.integer.array");
  -		assertEquals(20, intValue);
  -		assertEquals(2, conf.getVector("test.integer.array").size());
  -	}
  -
  -	public void testLong() throws Exception
  -	{
  -		long longValue = conf.getLong("test.long");
  -		assertEquals(1000000, longValue);
  -		assertEquals(1, conf.getVector("test.long").size());
  -	}
  -	public void testLongDefaultValue() throws Exception
  -	{
  -		long longValue = conf.getLong("test.long.missing",1000000);
  -		assertEquals(1000000, longValue);
  -	}
  -	public void testLongArrayValue() throws Exception
  -	{
  -		long longValue = conf.getLong("test.long.array");
  -		assertEquals(2000000, longValue);
  -		assertEquals(2, conf.getVector("test.long.array").size());
  -	}
  -
  -	public void testShort() throws Exception
  -	{
  -		short shortValue = conf.getShort("test.short");
  -		assertEquals(1, shortValue);
  -		assertEquals(1, conf.getVector("test.short").size());
  -	}
  -
  -	public void testShortDefaultValue() throws Exception
  -	{
  -		short shortValue = conf.getShort("test.short.missing",(short)1);
  -		assertEquals(1, shortValue);
  -	}
  -	public void testShortArrayValue() throws Exception
  -	{
  -		short shortValue = conf.getShort("test.short.array");
  -		assertEquals(2, shortValue);
  -		assertEquals(2, conf.getVector("test.short.array").size());
  -	}
  -	
       public void testVectorMissing() throws Exception
       {
  -        
  -        assertEquals(0, conf.getVector("missing.vector").size());
  +        nonStringTestHolder.testVectorMissing();
  +    }
  +
  +    public void testSubset() throws Exception
  +    {
  +        nonStringTestHolder.testSubset();
  +    }
  +    public void testIsEmpty() throws Exception
  +    {
  +        nonStringTestHolder.testIsEmpty();
       }
   }
  
  
  
  1.5       +2 -1      jakarta-commons-sandbox/configuration/src/test/org/apache/commons/configuration/TestNonStringProperties.java
  
  Index: TestNonStringProperties.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/configuration/src/test/org/apache/commons/configuration/TestNonStringProperties.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestNonStringProperties.java	11 Mar 2003 18:04:20 -0000	1.4
  +++ TestNonStringProperties.java	20 Jun 2003 07:50:47 -0000	1.5
  @@ -80,6 +80,7 @@
       
       public void setUp() throws Exception{
   		conf = new PropertiesConfiguration(testProperties);
  +		nonStringTestHolder.setConfiguration(conf);
       }
   
      
  
  
  
  1.2       +2 -1      jakarta-commons-sandbox/configuration/src/test/org/apache/commons/configuration/TestCompositeConfigurationNonStringProperties.java
  
  Index: TestCompositeConfigurationNonStringProperties.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/configuration/src/test/org/apache/commons/configuration/TestCompositeConfigurationNonStringProperties.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestCompositeConfigurationNonStringProperties.java	11 Mar 2003 17:40:20 -0000	1.1
  +++ TestCompositeConfigurationNonStringProperties.java	20 Jun 2003 07:50:47 -0000	1.2
  @@ -84,6 +84,7 @@
   		CompositeConfiguration cc = new CompositeConfiguration();
   		cc.addConfiguration(pc);
   		conf = (Configuration) cc;
  +		nonStringTestHolder.setConfiguration(conf);
   	}
   
   }
  
  
  
  1.1                  jakarta-commons-sandbox/configuration/src/test/org/apache/commons/configuration/NonStringTestHolder.java
  
  Index: NonStringTestHolder.java
  ===================================================================
  /*
   * Created on Jun 20, 2003
   *
   */
  package org.apache.commons.configuration;
  import java.util.Iterator;
  
  import org.apache.commons.collections.IteratorUtils;
  
  import junit.framework.Assert;
  /**
   * @author Eric Pugh
   *
   * Pulling out the calls to do the tests so both JUnit and Cactus tests can share.
   */
  public class NonStringTestHolder
  {
      private Configuration configuration;
      public void testBoolean() throws Exception
      {
          boolean booleanValue = configuration.getBoolean("test.boolean");
          Assert.assertEquals(true, booleanValue);
          Assert.assertEquals(1, configuration.getVector("test.boolean").size());
      }
  
      public void testBooleanDefaultValue() throws Exception
      {
          boolean booleanValue =
              configuration.getBoolean("test.boolean.missing", true);
          Assert.assertEquals(true, booleanValue);
  
          Boolean booleanObject =
              configuration.getBoolean("test.boolean.missing", new Boolean(true));
          Assert.assertEquals(new Boolean(true), booleanObject);
      }
  
      public void testByte() throws Exception
      {
          byte testValue = 10;
          byte byteValue = configuration.getByte("test.byte");
          Assert.assertEquals(testValue, byteValue);
          Assert.assertEquals(1, configuration.getVector("test.byte").size());
      }
  
      public void testDouble() throws Exception
      {
          double testValue = 10.25;
          double doubleValue = configuration.getDouble("test.double");
          Assert.assertEquals(testValue, doubleValue, 0.01);
          Assert.assertEquals(1, configuration.getVector("test.double").size());
      }
  
      public void testDoubleDefaultValue() throws Exception
      {
          double testValue = 10.25;
          double doubleValue =
              configuration.getDouble("test.double.missing", 10.25);
  
          Assert.assertEquals(testValue, doubleValue, 0.01);
      }
  
      public void testFloat() throws Exception
      {
          float testValue = (float) 20.25;
          float floatValue = configuration.getFloat("test.float");
          Assert.assertEquals(testValue, floatValue, 0.01);
          Assert.assertEquals(1, configuration.getVector("test.float").size());
      }
  
      public void testFloatDefaultValue() throws Exception
      {
          float testValue = (float) 20.25;
          float floatValue =
              configuration.getFloat("test.float.missing", testValue);
          Assert.assertEquals(testValue, floatValue, 0.01);
  
      }
  
      public void testInteger() throws Exception
      {
          int intValue = configuration.getInt("test.integer");
          Assert.assertEquals(10, intValue);
          Assert.assertEquals(1, configuration.getVector("test.integer").size());
      }
  
      public void testIntegerDefaultValue() throws Exception
      {
          int intValue = configuration.getInt("test.integer.missing", 10);
          Assert.assertEquals(10, intValue);
      }
  
      public void testLong() throws Exception
      {
          long longValue = configuration.getLong("test.long");
          Assert.assertEquals(1000000, longValue);
          Assert.assertEquals(1, configuration.getVector("test.long").size());
      }
      public void testLongDefaultValue() throws Exception
      {
          long longValue = configuration.getLong("test.long.missing", 1000000);
          Assert.assertEquals(1000000, longValue);
      }
  
      public void testShort() throws Exception
      {
          short shortValue = configuration.getShort("test.short");
          Assert.assertEquals(1, shortValue);
          Assert.assertEquals(1, configuration.getVector("test.short").size());
      }
  
      public void testShortDefaultValue() throws Exception
      {
          short shortValue =
              configuration.getShort("test.short.missing", (short) 1);
          Assert.assertEquals(1, shortValue);
      }
  
      public void testVectorMissing() throws Exception
      {
  
          Assert.assertEquals(
              0,
              configuration.getVector("missing.vector").size());
      }
  
      public void testSubset() throws Exception
      {
          String KEY_VALUE = "test.short";
          Configuration subset = configuration.subset(KEY_VALUE);
  		boolean foundKeyValue = false;
          for (Iterator i = subset.getKeys(); i.hasNext();)
          {
              String key = (String) i.next();
              if (!key.equals(KEY_VALUE))
              {
  
                  Assert.assertTrue(
                      "Key is:" + key,
                      !key.startsWith("test.short"));
              }
              else {
              	foundKeyValue=true;
              }
          }
          Assert.assertTrue("Make sure test.short did show up.  It is valid.",foundKeyValue);
      }
  
      public void testIsEmpty() throws Exception
      {
          Assert.assertTrue(!configuration.isEmpty());
  
      }
      /**
       * @return
       */
      public Configuration getConfiguration()
      {
          return configuration;
      }
  
      /**
       * @param configuration
       */
      public void setConfiguration(Configuration configuration)
      {
          this.configuration = configuration;
      }
  
  }
  
  
  
  1.4       +2 -2      jakarta-commons-sandbox/configuration/src/test-cactus/org/apache/commons/configuration/TestJNDIAndCompositeConfiguration.java
  
  Index: TestJNDIAndCompositeConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/configuration/src/test-cactus/org/apache/commons/configuration/TestJNDIAndCompositeConfiguration.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestJNDIAndCompositeConfiguration.java	7 Jun 2003 19:30:43 -0000	1.3
  +++ TestJNDIAndCompositeConfiguration.java	20 Jun 2003 07:50:47 -0000	1.4
  @@ -87,13 +87,13 @@
   
       public void testSimpleGet() throws Exception
       {
  -        String s = cc.getString("test.short");
  +        String s = cc.getString("test.overwrite");
           assertEquals("80", s);
   
           cc.clear();
           cc.addConfiguration(conf1);
           cc.addConfiguration(jndiConf);
  -        assertEquals("1", cc.getString("test.short"));
  +        assertEquals("1", cc.getString("test.overwrite"));
   
       }
   
  
  
  
  1.4       +2 -2      jakarta-commons-sandbox/configuration/src/test-cactus/org/apache/commons/configuration/TestJNDIEnvironmentValues.java
  
  Index: TestJNDIEnvironmentValues.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/configuration/src/test-cactus/org/apache/commons/configuration/TestJNDIEnvironmentValues.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestJNDIEnvironmentValues.java	24 Mar 2003 07:23:48 -0000	1.3
  +++ TestJNDIEnvironmentValues.java	20 Jun 2003 07:50:47 -0000	1.4
  @@ -88,7 +88,7 @@
           String s = conf.getString("test/key");
           assertEquals("jndivalue", s);
           assertEquals("jndivalue2", conf.getString("test.key2"));
  -        assertEquals("80", conf.getString("test.short"));
  +        assertEquals(1, conf.getShort("test.short"));
       }
   
       public void testGetMissingKey() throws Exception
  @@ -106,7 +106,7 @@
   
           assertTrue(conf.containsKey("test/key"));
   
  -        assertFalse(conf.containsKey("test/imaginerykey"));
  +        assertTrue(!conf.containsKey("test/imaginerykey"));
   
       }
   }
  
  
  
  1.4       +1 -1      jakarta-commons-sandbox/configuration/src/test-cactus/org/apache/commons/configuration/TestConfigurationFactoryWithJNDI.java
  
  Index: TestConfigurationFactoryWithJNDI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/configuration/src/test-cactus/org/apache/commons/configuration/TestConfigurationFactoryWithJNDI.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestConfigurationFactoryWithJNDI.java	20 Jun 2003 01:12:49 -0000	1.3
  +++ TestConfigurationFactoryWithJNDI.java	20 Jun 2003 07:50:47 -0000	1.4
  @@ -93,7 +93,7 @@
   		assertTrue("Make sure we have loaded our key", compositeConfiguration.getBoolean("test.boolean"));
   		assertEquals("I'm complex!", compositeConfiguration.getProperty("element2.subelement.subsubelement"));
   
  -		assertEquals("Make sure the JNDI config overwrites everything else!","80", compositeConfiguration.getString("test.short"));
  +		assertEquals("Make sure the JNDI config overwrites everything else!","80", compositeConfiguration.getString("test.overwrite"));
   	}
   	
   	/**
  
  
  
  1.1                  jakarta-commons-sandbox/configuration/src/test-cactus/org/apache/commons/configuration/TestJNDIConfiguration.java
  
  Index: TestJNDIConfiguration.java
  ===================================================================
  package org.apache.commons.configuration;
  
  /* ====================================================================
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 1999-2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Commons", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  import org.apache.cactus.ServletTestCase;
  import org.apache.commons.configuration.JNDIConfiguration;
  
  /**
   * test if non-string properties are handled correctly
   *
   * @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
   * @version $Id: TestJNDIConfiguration.java,v 1.1 2003/06/20 07:50:47 epugh Exp $
   */
  public class TestJNDIConfiguration extends ServletTestCase
  {
      private Configuration conf;
      private NonStringTestHolder nonStringTestHolder;
  
      public TestJNDIConfiguration(String s) throws Exception
      {
          super(s);
  
      }
  
      public void setUp() throws Exception
      {
  
          JNDIConfiguration jndiConfiguration = new JNDIConfiguration();
          jndiConfiguration.setPrefix("java:comp/env");
          conf = jndiConfiguration;
          nonStringTestHolder = new NonStringTestHolder();
          nonStringTestHolder.setConfiguration(conf);
  
      }
  
      public void testBoolean() throws Exception
      {
          nonStringTestHolder.testBoolean();
      }
  
      public void testBooleanDefaultValue() throws Exception
      {
          nonStringTestHolder.testBooleanDefaultValue();
      }
  
      public void testByte() throws Exception
      {
          nonStringTestHolder.testByte();
      }
  
      public void testDouble() throws Exception
      {
          nonStringTestHolder.testDouble();
      }
  
      public void testDoubleDefaultValue() throws Exception
      {
          nonStringTestHolder.testDoubleDefaultValue();
      }
  
      public void testFloat() throws Exception
      {
          nonStringTestHolder.testFloat();
      }
  
      public void testFloatDefaultValue() throws Exception
      {
          nonStringTestHolder.testFloatDefaultValue();
  
      }
  
      public void testInteger() throws Exception
      {
          nonStringTestHolder.testInteger();
      }
  
      public void testIntegerDefaultValue() throws Exception
      {
          nonStringTestHolder.testIntegerDefaultValue();
      }
  
      public void testLong() throws Exception
      {
          nonStringTestHolder.testLong();
      }
      public void testLongDefaultValue() throws Exception
      {
          nonStringTestHolder.testLongDefaultValue();
      }
  
      public void testShort() throws Exception
      {
          nonStringTestHolder.testShort();
      }
  
      public void testShortDefaultValue() throws Exception
      {
          nonStringTestHolder.testShortDefaultValue();
      }
  
      public void testVectorMissing() throws Exception
      {
          //assertEquals(0, conf.getVector("missing.vector").size());
          nonStringTestHolder.testVectorMissing();
      }
  	public void testSubset() throws Exception
     {
  	  nonStringTestHolder.testSubset();
     }
  public void testIsEmpty() throws Exception
  {
      nonStringTestHolder.testIsEmpty();
  }
     
      public void tearDown() throws Exception
      {
          super.tearDown();
  
      }
  
  }
  
  
  1.3       +36 -2     jakarta-commons-sandbox/configuration/src/test-cactus/testapp/WEB-INF/web.xml
  
  Index: web.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/configuration/src/test-cactus/testapp/WEB-INF/web.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- web.xml	20 Jun 2003 01:12:49 -0000	1.2
  +++ web.xml	20 Jun 2003 07:50:47 -0000	1.3
  @@ -75,7 +75,7 @@
     </security-role>
   
      <env-entry>
  -        <env-entry-name>test/short</env-entry-name>
  +        <env-entry-name>test/overwrite</env-entry-name>
           <env-entry-value>80</env-entry-value>
           <env-entry-type>java.lang.String</env-entry-type>
       </env-entry>
  @@ -104,5 +104,39 @@
           <env-entry-value>averydeepvalue</env-entry-value>
           <env-entry-type>java.lang.String</env-entry-type>
       </env-entry>  
  -    
  +    <env-entry>
  +        <env-entry-name>test/boolean</env-entry-name>
  +        <env-entry-value>true</env-entry-value>
  +        <env-entry-type>java.lang.Boolean</env-entry-type>
  +    </env-entry>    
  +    <env-entry>
  +        <env-entry-name>test/byte</env-entry-name>
  +        <env-entry-value>10</env-entry-value>
  +        <env-entry-type>java.lang.Byte</env-entry-type>
  +    </env-entry>   
  +    <env-entry>
  +        <env-entry-name>test/double</env-entry-name>
  +        <env-entry-value>10.25</env-entry-value>
  +        <env-entry-type>java.lang.Double</env-entry-type>
  +    </env-entry>     
  +    <env-entry>
  +        <env-entry-name>test/float</env-entry-name>
  +        <env-entry-value>20.25</env-entry-value>
  +        <env-entry-type>java.lang.Float</env-entry-type>
  +    </env-entry>               
  +    <env-entry>
  +        <env-entry-name>test/integer</env-entry-name>
  +        <env-entry-value>10</env-entry-value>
  +        <env-entry-type>java.lang.Integer</env-entry-type>
  +    </env-entry> 
  +    <env-entry>
  +        <env-entry-name>test/long</env-entry-name>
  +        <env-entry-value>1000000</env-entry-value>
  +        <env-entry-type>java.lang.Long</env-entry-type>
  +    </env-entry> 
  +    <env-entry>
  +        <env-entry-name>test/short</env-entry-name>
  +        <env-entry-value>1</env-entry-value>
  +        <env-entry-type>java.lang.Short</env-entry-type>
  +    </env-entry>    
   </web-app>
  
  
  
  1.8       +293 -339  jakarta-commons-sandbox/configuration/src/java/org/apache/commons/configuration/JNDIConfiguration.java
  
  Index: JNDIConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/configuration/src/java/org/apache/commons/configuration/JNDIConfiguration.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- JNDIConfiguration.java	20 Jun 2003 01:12:49 -0000	1.7
  +++ JNDIConfiguration.java	20 Jun 2003 07:50:47 -0000	1.8
  @@ -1,5 +1,4 @@
   package org.apache.commons.configuration;
  -
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  @@ -53,37 +52,34 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    */
  -
   import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.List;
   import java.util.NoSuchElementException;
   import java.util.Properties;
   import java.util.Vector;
  -
   import javax.naming.Binding;
   import javax.naming.Context;
   import javax.naming.InitialContext;
   import javax.naming.NamingEnumeration;
   import javax.naming.NamingException;
  -
   import org.apache.commons.lang.StringUtils;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -
   /**
    * This Configuration class allows you to interface with a JNDI datasource.
    * 
    * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
    * @version $Id$
    */
  -public class JNDIConfiguration implements Configuration
  +public class JNDIConfiguration
  +    extends BaseConfiguration
  +    implements Configuration
   {
       private static Log log = LogFactory.getLog(JNDIConfiguration.class);
       private String prefix;
       private Context envCtx;
       private List clearedProperties = new ArrayList();
  -
       /**
        * Creates an empty JNDIConfiguration object which can then
        * be added some other Configuration files
  @@ -91,7 +87,6 @@
       public JNDIConfiguration()
       {
       }
  -
       /**
        * JNDIConfigurations can not be added to
        *
  @@ -102,7 +97,6 @@
       {
           throw new Error("This operation is not supported");
       }
  -
       /**
        * This method recursive traverse the JNDI tree, looking for Context objects.
        * When it finds them, it traverses them as well.  Otherwise it just adds the
  @@ -120,9 +114,7 @@
       {
           while (enum.hasMoreElements())
           {
  -
               Binding binding = (Binding) enum.next();
  -
               StringBuffer newKey = new StringBuffer();
               newKey.append(key);
               if (newKey.length() > 0)
  @@ -130,26 +122,21 @@
                   newKey.append(".");
               }
               newKey.append(binding.getName());
  -
               if (binding.getObject() instanceof Context)
               {
                   Context c = (Context) binding.getObject();
                   NamingEnumeration enum2 = c.listBindings("");
  -
                   recursiveGetKeys(keys, enum2, newKey.toString());
  -            } else
  +            }
  +            else
               {
                   if (!keys.contains(newKey.toString()))
                   {
                       keys.add(newKey.toString());
                   }
  -
               }
  -
           }
  -
       }
  -
       /**
        * Get the list of the keys contained in the configuration
        * repository.
  @@ -159,9 +146,7 @@
       public Iterator getKeys()
       {
           return getKeys("");
  -
       }
  -
       /**
        * Get the list of the keys contained in the configuration
        * repository that match a passed in beginning pattern.
  @@ -172,7 +157,6 @@
       public Iterator getKeys(String key)
       {
           List keys = new ArrayList();
  -
           try
           {
               String[] splitKeys = StringUtils.split(key, ".");
  @@ -180,32 +164,30 @@
               {
                   keys.add(splitKeys[i]);
               }
  -
               Context context = null;
               if (keys.size() == 0)
               {
                   context = getContext();
  -            } else
  +            }
  +            else
               {
                   context =
                       getStartingContextPoint(
                           keys,
                           getContext().listBindings(""));
               }
  -
               if (context != null)
               {
                   NamingEnumeration enum = context.listBindings("");
                   recursiveGetKeys(keys, enum, key);
               }
  -
  -        } catch (NamingException ne)
  +        }
  +        catch (NamingException ne)
           {
               log.warn(ne);
           }
           return keys.iterator();
       }
  -
       /**
        * Because JNDI is based on a tree configuration, we need to filter down the
        * tree, till we find the Context specified by the key to start from.  
  @@ -218,7 +200,6 @@
       private Context getStartingContextPoint(List keys, NamingEnumeration enum)
           throws NamingException
       {
  -
           String keyToSearchFor = (String) keys.get(0);
           log.debug("Key to search for is " + keyToSearchFor);
           while (enum.hasMoreElements())
  @@ -239,18 +220,15 @@
                   if (keys.size() > 0)
                   {
                       return getStartingContextPoint(keys, c.listBindings(""));
  -                } else
  +                }
  +                else
                   {
                       return c;
                   }
  -
               }
  -
           }
           return null;
  -
       }
  -
       /**
        * Get a list of properties associated with the given
        * configuration key.
  @@ -267,13 +245,19 @@
       {
           throw new Error("This operation is not supported");
       }
  -
       public boolean isEmpty()
       {
  -        throw new Error("This operation is not supported");
  -
  +        try
  +        {
  +            NamingEnumeration enum = getContext().listBindings("");
  +            return !enum.hasMore();
  +        }
  +        catch (NamingException ne)
  +        {
  +            log.warn(ne);
  +            return true;
  +        }
       }
  -
       /**
        *  Gets a property from the configuration.
        *
  @@ -285,7 +269,6 @@
       {
           throw new Error("This operation is not supported");
       }
  -
       /**
        * Set a property, this will replace any previously
        * set values. Set values is implicitly a call
  @@ -297,9 +280,7 @@
       public void setProperty(String key, Object value)
       {
           throw new Error("This operation is not supported");
  -
       }
  -
       /**
        * Clear a property in the configuration.  Just marks it as cleared, 
        * doesn't change the underlying JNDI data source.
  @@ -313,7 +294,6 @@
               clearedProperties.add(key);
           }
       }
  -
       /**
        * check if the configuration contains the key, or the key 
        * has been removed.
  @@ -324,20 +304,17 @@
           {
               return false;
           }
  -
           key = StringUtils.replace(key, ".", "/");
           try
           {
  -
  -            String value = (String) getContext().lookup(key);
  +            Object object = getContext().lookup(key);
               return true;
  -        } catch (javax.naming.NamingException ne)
  +        }
  +        catch (javax.naming.NamingException ne)
           {
               return false;
           }
  -
       }
  -
       /**
        * Create an ExtendedProperties object that is a subset
        * of this one. Take into account duplicate keys
  @@ -347,56 +324,57 @@
        */
       public Configuration subset(String prefix)
       {
  -        throw new Error("This operation is not supported");
  -    }
  -
  -    /**
  -    * Get a float associated with the given configuration key.
  -    * 
  -    * @ param key The configuration key.
  -    * @ return The associated float.
  -    * @ exception NoSuchElementException is thrown if the key doesn 't
  -    * map to an existing object.
  -    * @ exception ClassCastException is thrown if the key maps to an
  -    * object that is not a Float.
  -    * @ exception NumberFormatException is thrown if the value mapped
  -    * by the key has not a valid number format.
  -     */
  -    public float getFloat(String key)
  -    {
  -        throw new Error("This operation is not supported");
  -    }
  -
  -    /**
  -     * Get a boolean associated with the given configuration key.
  -     *
  -     * @param key The configuration key.
  -     * @return The associated boolean.
  -     * @throws NoSuchElementException is thrown if the key doesn't
  -     * map to an existing object.
  -     * @throws ClassCastException is thrown if the key maps to an
  -     * object that is not a Boolean.
  -     */
  -    public boolean getBoolean(String key)
  -    {
  -        throw new Error("This operation is not supported");
  -    }
  -
  -    /**
  -     * Get a boolean associated with the given configuration key.
  -     *
  -     * @param key The configuration key.
  -     * @param defaultValue The default value.
  -     * @return The associated boolean.
  -     * @throws ClassCastException is thrown if the key maps to an
  -     * object that is not a Boolean.
  -     */
  -    public boolean getBoolean(String key, boolean defaultValue)
  -    {
  -        throw new Error("This operation is not supported");
  -
  +        BaseConfiguration c = new BaseConfiguration();
  +        Iterator keys = this.getKeys();
  +        boolean validSubset = false;
  +        while (keys.hasNext())
  +        {
  +            Object key = keys.next();
  +            if (key instanceof String && ((String) key).startsWith(prefix))
  +            {
  +                if (!validSubset)
  +                {
  +                    validSubset = true;
  +                }
  +                String newKey = null;
  +                /*
  +                 * Check to make sure that c.subset(prefix) doesn't blow up when
  +                 * there is only a single property with the key prefix. This is
  +                 * not a useful subset but it is a valid subset.
  +                 */
  +                if (((String) key).length() == prefix.length())
  +                {
  +                    newKey = prefix;
  +                }
  +                else
  +                {
  +                    newKey = ((String) key).substring(prefix.length() + 1);
  +                }
  +                /*
  +                 * use addPropertyDirect() - this will plug the data as is into
  +                 * the Map, but will also do the right thing re key accounting
  +                 */
  +                Object value = getValueFromJNDI(key.toString());
  +                if (value instanceof String)
  +                {
  +                    c.addPropertyDirect(newKey, interpolate((String) value));
  +                }
  +                else
  +                {
  +                    c.addPropertyDirect(newKey, value);
  +                }
  +            }
  +        }
  +        if (validSubset)
  +        {
  +            return (Configuration) c;
  +        }
  +        else
  +        {
  +            return null;
  +        }
       }
  -
  +    
       /**
        * Get a boolean associated with the given configuration key.
        *
  @@ -409,42 +387,35 @@
        */
       public Boolean getBoolean(String key, Boolean defaultValue)
       {
  -        throw new Error("This operation is not supported");
  -    }
  -
  -    /**
  -     * Get a byte associated with the given configuration key.
  -     *
  -     * @param key The configuration key.
  -     * @return The associated byte.
  -     * @throws NoSuchElementException is thrown if the key doesn't
  -     * map to an existing object.
  -     * @throws ClassCastException is thrown if the key maps to an
  -     * object that is not a Byte.
  -     * @throws NumberFormatException is thrown if the value mapped
  -     * by the key has not a valid number format.
  -     */
  -    public byte getByte(String key)
  -    {
  -        throw new Error("This operation is not supported");
  -    }
  -
  -    /**
  -     * Get a byte associated with the given configuration key.
  -     *
  -     * @param key The configuration key.
  -     * @param defaultValue The default value.
  -     * @return The associated byte.
  -     * @throws ClassCastException is thrown if the key maps to an
  -     * object that is not a Byte.
  -     * @throws NumberFormatException is thrown if the value mapped
  -     * by the key has not a valid number format.
  -     */
  -    public byte getByte(String key, byte defaultValue)
  -    {
  -        throw new Error("This operation is not supported");
  +        Object value = getValueFromJNDI(key);
  +        if (value instanceof Boolean)
  +        {
  +            return (Boolean) value;
  +        }
  +        else if (value instanceof String)
  +        {
  +            String s = testBoolean((String) value);
  +            Boolean b = new Boolean(s);
  +            return b;
  +        }
  +        else if (value == null)
  +        {
  +            if (defaults != null)
  +            {
  +                return defaults.getBoolean(key, defaultValue);
  +            }
  +            else
  +            {
  +                return defaultValue;
  +            }
  +        }
  +        else
  +        {
  +            throw new ClassCastException(
  +                '\'' + key + "' doesn't map to a Boolean object");
  +        }
       }
  -
  +    
       /**
        * Get a byte associated with the given configuration key.
        *
  @@ -459,42 +430,27 @@
        */
       public Byte getByte(String key, Byte defaultValue)
       {
  -        throw new Error("This operation is not supported");
  -    }
  -
  -    /**
  -     * Get a double associated with the given configuration key.
  -     *
  -     * @param key The configuration key.
  -     * @return The associated double.
  -     * @throws NoSuchElementException is thrown if the key doesn't
  -     * map to an existing object.
  -     * @throws ClassCastException is thrown if the key maps to an
  -     * object that is not a Double.
  -     * @throws NumberFormatException is thrown if the value mapped
  -     * by the key has not a valid number format.
  -     */
  -    public double getDouble(String key)
  -    {
  -        throw new Error("This operation is not supported");
  -    }
  -
  -    /**
  -     * Get a double associated with the given configuration key.
  -     *
  -     * @param key The configuration key.
  -     * @param defaultValue The default value.
  -     * @return The associated double.
  -     * @throws ClassCastException is thrown if the key maps to an
  -     * object that is not a Double.
  -     * @throws NumberFormatException is thrown if the value mapped
  -     * by the key has not a valid number format.
  -     */
  -    public double getDouble(String key, double defaultValue)
  -    {
  -        throw new Error("This operation is not supported");
  +        Object value = getValueFromJNDI(key);
  +        if (value instanceof Byte)
  +        {
  +            return (Byte) value;
  +        }
  +        else if (value instanceof String)
  +        {
  +            Byte b = new Byte((String) value);
  +            return b;
  +        }
  +        else if (value == null)
  +        {
  +            return defaultValue;
  +        }
  +        else
  +        {
  +            throw new ClassCastException(
  +                '\'' + key + "' doesn't map to a Byte object");
  +        }
       }
  -
  +    
       /**
        * Get a double associated with the given configuration key.
        *
  @@ -509,25 +465,27 @@
        */
       public Double getDouble(String key, Double defaultValue)
       {
  -        throw new Error("This operation is not supported");
  -    }
  -
  -    /**
  -     * Get a float associated with the given configuration key.
  -     *
  -     * @param key The configuration key.
  -     * @param defaultValue The default value.
  -     * @return The associated float.
  -     * @throws ClassCastException is thrown if the key maps to an
  -     * object that is not a Float.
  -     * @throws NumberFormatException is thrown if the value mapped
  -     * by the key has not a valid number format.
  -     */
  -    public float getFloat(String key, float defaultValue)
  -    {
  -        throw new Error("This operation is not supported");
  +        Object value = this.getValueFromJNDI(key);
  +        if (value instanceof Double)
  +        {
  +            return (Double) value;
  +        }
  +        else if (value instanceof String)
  +        {
  +            Double d = new Double((String) value);
  +            return d;
  +        }
  +        else if (value == null)
  +        {
  +            return defaultValue;
  +        }
  +        else
  +        {
  +            throw new ClassCastException(
  +                '\'' + key + "' doesn't map to a Double object");
  +        }
       }
  -
  +    
       /**
        * Get a float associated with the given configuration key.
        *
  @@ -542,42 +500,27 @@
        */
       public Float getFloat(String key, Float defaultValue)
       {
  -        throw new Error("This operation is not supported");
  -    }
  -
  -    /**
  -     * Get a int associated with the given configuration key.
  -     *
  -     * @param key The configuration key.
  -     * @return The associated int.
  -     * @throws NoSuchElementException is thrown if the key doesn't
  -     * map to an existing object.
  -     * @throws ClassCastException is thrown if the key maps to an
  -     * object that is not a Integer.
  -     * @throws NumberFormatException is thrown if the value mapped
  -     * by the key has not a valid number format.
  -     */
  -    public int getInt(String key)
  -    {
  -        throw new Error("This operation is not supported");
  -    }
  -
  -    /**
  -     * Get a int associated with the given configuration key.
  -     *
  -     * @param key The configuration key.
  -     * @param defaultValue The default value.
  -     * @return The associated int.
  -     * @throws ClassCastException is thrown if the key maps to an
  -     * object that is not a Integer.
  -     * @throws NumberFormatException is thrown if the value mapped
  -     * by the key has not a valid number format.
  -     */
  -    public int getInt(String key, int defaultValue)
  -    {
  -        throw new Error("This operation is not supported");
  +        Object value = getValueFromJNDI(key);
  +        if (value instanceof Float)
  +        {
  +            return (Float) value;
  +        }
  +        else if (value instanceof String)
  +        {
  +            Float f = new Float((String) value);
  +            return f;
  +        }
  +        else if (value == null)
  +        {
  +            return defaultValue;
  +        }
  +        else
  +        {
  +            throw new ClassCastException(
  +                '\'' + key + "' doesn't map to a Float object");
  +        }
       }
  -
  +    
       /**
        * Get a int associated with the given configuration key.
        *
  @@ -592,42 +535,27 @@
        */
       public Integer getInteger(String key, Integer defaultValue)
       {
  -        throw new Error("This operation is not supported");
  -    }
  -
  -    /**
  -     * Get a long associated with the given configuration key.
  -     *
  -     * @param key The configuration key.
  -     * @return The associated long.
  -     * @throws NoSuchElementException is thrown if the key doesn't
  -     * map to an existing object.
  -     * @throws ClassCastException is thrown if the key maps to an
  -     * object that is not a Long.
  -     * @throws NumberFormatException is thrown if the value mapped
  -     * by the key has not a valid number format.
  -     */
  -    public long getLong(String key)
  -    {
  -        throw new Error("This operation is not supported");
  -    }
  -
  -    /**
  -     * Get a long associated with the given configuration key.
  -     *
  -     * @param key The configuration key.
  -     * @param defaultValue The default value.
  -     * @return The associated long.
  -     * @throws ClassCastException is thrown if the key maps to an
  -     * object that is not a Long.
  -     * @throws NumberFormatException is thrown if the value mapped
  -     * by the key has not a valid number format.
  -     */
  -    public long getLong(String key, long defaultValue)
  -    {
  -        throw new Error("This operation is not supported");
  +        Object value = getValueFromJNDI(key);
  +        if (value instanceof Integer)
  +        {
  +            return (Integer) value;
  +        }
  +        else if (value instanceof String)
  +        {
  +            Integer i = new Integer((String) value);
  +            return i;
  +        }
  +        else if (value == null)
  +        {
  +            return defaultValue;
  +        }
  +        else
  +        {
  +            throw new ClassCastException(
  +                '\'' + key + "' doesn't map to a Integer object");
  +        }
       }
  -
  +    
       /**
        * Get a long associated with the given configuration key.
        *
  @@ -642,42 +570,27 @@
        */
       public Long getLong(String key, Long defaultValue)
       {
  -        throw new Error("This operation is not supported");
  -    }
  -
  -    /**
  -     * Get a short associated with the given configuration key.
  -     *
  -     * @param key The configuration key.
  -     * @return The associated short.
  -     * @throws NoSuchElementException is thrown if the key doesn't
  -     * map to an existing object.
  -     * @throws ClassCastException is thrown if the key maps to an
  -     * object that is not a Short.
  -     * @throws NumberFormatException is thrown if the value mapped
  -     * by the key has not a valid number format.
  -     */
  -    public short getShort(String key)
  -    {
  -        throw new Error("This operation is not supported");
  -    }
  -
  -    /**
  -     * Get a short associated with the given configuration key.
  -     *
  -     * @param key The configuration key.
  -     * @param defaultValue The default value.
  -     * @return The associated short.
  -     * @throws ClassCastException is thrown if the key maps to an
  -     * object that is not a Short.
  -     * @throws NumberFormatException is thrown if the value mapped
  -     * by the key has not a valid number format.
  -     */
  -    public short getShort(String key, short defaultValue)
  -    {
  -        throw new Error("This operation is not supported");
  +        Object value = getValueFromJNDI(key);
  +        if (value instanceof Long)
  +        {
  +            return (Long) value;
  +        }
  +        else if (value instanceof String)
  +        {
  +            Long l = new Long((String) value);
  +            return l;
  +        }
  +        else if (value == null)
  +        {
  +            return defaultValue;
  +        }
  +        else
  +        {
  +            throw new ClassCastException(
  +                '\'' + key + "' doesn't map to a Long object");
  +        }
       }
  -
  +    
       /**
        * Get a short associated with the given configuration key.
        *
  @@ -692,22 +605,27 @@
        */
       public Short getShort(String key, Short defaultValue)
       {
  -        throw new Error("This operation is not supported");
  -    }
  -
  -    /**
  -     * Get a string associated with the given configuration key.
  -     *
  -     * @param key The configuration key.
  -     * @return The associated string.
  -     * @throws ClassCastException is thrown if the key maps to an object that
  -     *            is not a String.
  -     */
  -    public String getString(String key)
  -    {
  -        return getString(key, null);
  +        Object value = getValueFromJNDI(key);
  +        if (value instanceof Short)
  +        {
  +            return (Short) value;
  +        }
  +        else if (value instanceof String)
  +        {
  +            Short s = new Short((String) value);
  +            return s;
  +        }
  +        else if (value == null)
  +        {
  +            return defaultValue;
  +        }
  +        else
  +        {
  +            throw new ClassCastException(
  +                '\'' + key + "' doesn't map to a Short object");
  +        }
       }
  -
  +    
       /**
        * Get a string associated with the given configuration key.
        *
  @@ -721,13 +639,21 @@
       {
           try
           {
  -            return getValueFromJNDI(key);
  -        } catch (NoSuchElementException nsee)
  +            Object o = getValueFromJNDI(key);
  +            if (o == null)
  +            {
  +                return defaultValue;
  +            }
  +            else
  +            {
  +                return (String) o;
  +            }
  +        }
  +        catch (NoSuchElementException nsee)
           {
               return defaultValue;
           }
       }
  -
       /**
        * Get an array of strings associated with the given configuration
        * key.
  @@ -739,36 +665,67 @@
        */
       public String[] getStringArray(String key)
       {
  -        throw new Error("This operation is not supported");
  -    }
  -
  -    /**
  -     * Get a Vector of strings associated with the given configuration key.
  -     *
  -     * @param key The configuration key.
  -     * @return The associated Vector.
  -     * @throws ClassCastException is thrown if the key maps to an
  -     * object that is not a Vector.
  -     */
  -    public Vector getVector(String key)
  -    {
  -        throw new Error("This operation is not supported");
  +        Object value = getValueFromJNDI(key);
  +        String[] tokens;
  +        if (value instanceof String)
  +        {
  +            tokens = new String[1];
  +            tokens[0] = interpolate((String) value);
  +        }
  +        else if (value instanceof Container)
  +        {
  +            tokens = new String[((Container) value).size()];
  +            for (int i = 0; i < tokens.length; i++)
  +            {
  +                tokens[i] = interpolate((String) ((Container) value).get(i));
  +            }
  +        }
  +        else if (value == null)
  +        {
  +            tokens = new String[0];
  +        }
  +        else
  +        {
  +            throw new ClassCastException(
  +                '\'' + key + "' doesn't map to a String/Vector object");
  +        }
  +        return tokens;
       }
  -
  +    
       /**
        * Get a Vector of strings associated with the given configuration key.
  +     * Typically this will be just a single item, as you can't have multiple
  +     * properties with the same name.
        *
        * @param key The configuration key.
        * @param defaultValue The default value.
        * @return The associated Vector.
  -     * @throws ClassCastException is thrown if the key maps to an
  -     * object that is not a Vector.
        */
       public Vector getVector(String key, Vector defaultValue)
       {
  -        throw new Error("This operation is not supported");
  +        try
  +        {
  +            Object value = this.getValueFromJNDI(key);
  +            if (value != null)
  +            {
  +                Vector v = new Vector(1);
  +                v.add(value.toString());
  +                return v;
  +            }
  +            else
  +            {
  +                if (defaultValue == null)
  +                {
  +                    defaultValue = new Vector();
  +                }
  +                return defaultValue;
  +            }
  +        }
  +        catch (NoSuchElementException nsse)
  +        {
  +            return defaultValue;
  +        }
       }
  -
       /**
        * @return String
        */
  @@ -776,7 +733,6 @@
       {
           return prefix;
       }
  -
       /**
        * Sets the prefix.
        * @param prefix The prefix to set
  @@ -785,8 +741,7 @@
       {
           this.prefix = prefix;
       }
  -
  -    private String getValueFromJNDI(String key)
  +    private Object getValueFromJNDI(String key)
       {
           if (clearedProperties.contains(key))
           {
  @@ -795,17 +750,17 @@
           try
           {
               key = StringUtils.replace(key, ".", "/");
  -
  -            String value = (String) getContext().lookup(key);
  -            return value;
  -        } catch (Exception e)
  +            return getContext().lookup(key);
  +        }
  +        catch (java.util.NoSuchElementException nsse)
           {
  -
  -            throw new NoSuchElementException(
  -                '\'' + key + "' doesn't map to an existing object");
  +            return null;
  +        }
  +        catch (NamingException ne)
  +        {
  +            return null;
           }
       }
  -
       private Context getContext() throws NamingException
       {
           if (envCtx == null)
  @@ -815,5 +770,4 @@
           }
           return envCtx;
       }
  -
   }
  
  
  
  1.13      +23 -80    jakarta-commons-sandbox/configuration/src/java/org/apache/commons/configuration/CompositeConfiguration.java
  
  Index: CompositeConfiguration.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/configuration/src/java/org/apache/commons/configuration/CompositeConfiguration.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- CompositeConfiguration.java	20 Jun 2003 01:12:49 -0000	1.12
  +++ CompositeConfiguration.java	20 Jun 2003 07:50:47 -0000	1.13
  @@ -1,5 +1,4 @@
   package org.apache.commons.configuration;
  -
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  @@ -53,7 +52,6 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    */
  -
   import java.util.ArrayList;
   import java.util.Iterator;
   import java.util.List;
  @@ -61,7 +59,6 @@
   import java.util.NoSuchElementException;
   import java.util.Properties;
   import java.util.Vector;
  -
   /**
    * This Configuration class allows you to add multiple different types of Configuration
    * to this CompositeConfiguration.  If you add Configuration1, and then Configuration2, 
  @@ -76,12 +73,10 @@
   {
       /** Array holding all the configuration */
       private ArrayList configList = new ArrayList();
  -
       /** Configuration that holds in memory stuff.  Inserted as first so any
        * setProperty() override anything else added.
        */
       private BaseConfiguration inMemoryConfiguration;
  -
       /**
        * Creates an empty CompositeConfiguration object which can then
        * be added some other Configuration files
  @@ -91,7 +86,6 @@
           inMemoryConfiguration = new BaseConfiguration();
           addConfiguration(inMemoryConfiguration);
       }
  -
       public void addConfiguration(Configuration config)
       {
           if (!configList.contains(config))
  @@ -99,26 +93,21 @@
               configList.add(config);
           }
       }
  -
       public void removeConfiguration(Configuration config)
       {
           configList.remove(config);
       }
  -
       public int getNumberOfConfigurations()
       {
           return configList.size();
       }
  -
       public void clear()
       {
           configList.clear();
           // recreate the in memory configuration
           inMemoryConfiguration = new BaseConfiguration();
           addConfiguration(inMemoryConfiguration);
  -
       }
  -
       /**
        * CompositeConfigurations can not be added to
        *
  @@ -129,7 +118,6 @@
       {
           inMemoryConfiguration.addProperty(key, token);
       }
  -
       /**
        * Get the list of the keys contained in the configuration
        * repository.
  @@ -192,7 +180,6 @@
       {
           return getFirstMatchingConfig(key).getProperties(key);
       }
  -
       public boolean isEmpty()
       {
           boolean isEmpty = true;
  @@ -205,9 +192,7 @@
               }
           }
           return isEmpty;
  -
       }
  -
       /**
        *  Gets a property from the configuration.
        *
  @@ -219,7 +204,6 @@
       {
           return getFirstMatchingConfig(key).getProperty(key);
       }
  -
       /**
        * Set a property, this will replace any previously
        * set values. Set values is implicitly a call
  @@ -233,7 +217,6 @@
           clearProperty(key);
           addProperty(key, value);
       }
  -
       /**
        * Clear a property in the configuration.
        *
  @@ -247,7 +230,6 @@
               config.clearProperty(key);
           }
       }
  -
       /**
        * check if the configuration contains the key
        */
  @@ -262,9 +244,7 @@
               }
           }
           return false;
  -
       }
  -
       /**
        * Create a CompositeConfiguration object that is a subset
        * of this one. Cycles over all the config objects, and calls
  @@ -274,10 +254,8 @@
        */
       public Configuration subset(String prefix)
       {
  -
           CompositeConfiguration subsetCompositeConfiguration =
               new CompositeConfiguration();
  -
           for (ListIterator i = configList.listIterator(); i.hasNext();)
           {
               Configuration config = (Configuration) i.next();
  @@ -288,9 +266,7 @@
               }
           }
           return subsetCompositeConfiguration;
  -
       }
  -
       /**
       * Get a float associated with the given configuration key.
       * 
  @@ -307,7 +283,6 @@
       {
           return getFirstMatchingConfig(key).getFloat(key);
       }
  -
       /**
        * Get a boolean associated with the given configuration key.
        *
  @@ -322,7 +297,6 @@
       {
           return getFirstMatchingConfig(key).getBoolean(key);
       }
  -
       /**
        * Get a boolean associated with the given configuration key.
        *
  @@ -335,9 +309,7 @@
       public boolean getBoolean(String key, boolean defaultValue)
       {
           return getBoolean(key, new Boolean(defaultValue)).booleanValue();
  -
       }
  -
       /**
        * Get a boolean associated with the given configuration key.
        *
  @@ -352,14 +324,13 @@
       {
           try
           {
  -
               return getFirstMatchingConfig(key).getBoolean(key, defaultValue);
  -        } catch (NoSuchElementException nsee)
  +        }
  +        catch (NoSuchElementException nsee)
           {
               return defaultValue;
           }
       }
  -
       /**
        * Get a byte associated with the given configuration key.
        *
  @@ -376,7 +347,6 @@
       {
           return getFirstMatchingConfig(key).getByte(key);
       }
  -
       /**
        * Get a byte associated with the given configuration key.
        *
  @@ -392,7 +362,6 @@
       {
           return getByte(key, new Byte(defaultValue).byteValue());
       }
  -
       /**
        * Get a byte associated with the given configuration key.
        *
  @@ -409,14 +378,13 @@
       {
           try
           {
  -
               return getFirstMatchingConfig(key).getByte(key, defaultValue);
  -        } catch (NoSuchElementException nsee)
  +        }
  +        catch (NoSuchElementException nsee)
           {
               return defaultValue;
           }
       }
  -
       /**
        * Get a double associated with the given configuration key.
        *
  @@ -433,7 +401,6 @@
       {
           return getFirstMatchingConfig(key).getDouble(key);
       }
  -
       /**
        * Get a double associated with the given configuration key.
        *
  @@ -449,7 +416,6 @@
       {
           return getDouble(key, new Double(defaultValue)).doubleValue();
       }
  -
       /**
        * Get a double associated with the given configuration key.
        *
  @@ -466,14 +432,13 @@
       {
           try
           {
  -
               return getFirstMatchingConfig(key).getDouble(key, defaultValue);
  -        } catch (NoSuchElementException nsee)
  +        }
  +        catch (NoSuchElementException nsee)
           {
               return defaultValue;
           }
       }
  -
       /**
        * Get a float associated with the given configuration key.
        *
  @@ -489,7 +454,6 @@
       {
           return getFloat(key, new Float(defaultValue)).floatValue();
       }
  -
       /**
        * Get a float associated with the given configuration key.
        *
  @@ -506,14 +470,13 @@
       {
           try
           {
  -
               return getFirstMatchingConfig(key).getFloat(key, defaultValue);
  -        } catch (NoSuchElementException nsee)
  +        }
  +        catch (NoSuchElementException nsee)
           {
               return defaultValue;
           }
       }
  -
       /**
        * Get a int associated with the given configuration key.
        *
  @@ -530,7 +493,6 @@
       {
           return getFirstMatchingConfig(key).getInt(key);
       }
  -
       /**
        * Get a int associated with the given configuration key.
        *
  @@ -546,7 +508,6 @@
       {
           return getInteger(key, new Integer(defaultValue)).intValue();
       }
  -
       /**
        * Get a int associated with the given configuration key.
        *
  @@ -563,14 +524,13 @@
       {
           try
           {
  -
               return getFirstMatchingConfig(key).getInteger(key, defaultValue);
  -        } catch (NoSuchElementException nsee)
  +        }
  +        catch (NoSuchElementException nsee)
           {
               return defaultValue;
           }
       }
  -
       /**
        * Get a long associated with the given configuration key.
        *
  @@ -587,7 +547,6 @@
       {
           return getFirstMatchingConfig(key).getLong(key);
       }
  -
       /**
        * Get a long associated with the given configuration key.
        *
  @@ -603,7 +562,6 @@
       {
           return getLong(key, new Long(defaultValue)).longValue();
       }
  -
       /**
        * Get a long associated with the given configuration key.
        *
  @@ -620,14 +578,13 @@
       {
           try
           {
  -
               return getFirstMatchingConfig(key).getLong(key, defaultValue);
  -        } catch (NoSuchElementException nsee)
  +        }
  +        catch (NoSuchElementException nsee)
           {
               return defaultValue;
           }
       }
  -
       /**
        * Get a short associated with the given configuration key.
        *
  @@ -644,7 +601,6 @@
       {
           return getFirstMatchingConfig(key).getShort(key);
       }
  -
       /**
        * Get a short associated with the given configuration key.
        *
  @@ -659,9 +615,7 @@
       public short getShort(String key, short defaultValue)
       {
           return getShort(key, new Short(defaultValue)).shortValue();
  -
       }
  -
       /**
        * Get a short associated with the given configuration key.
        *
  @@ -679,12 +633,12 @@
           try
           {
               return getFirstMatchingConfig(key).getShort(key, defaultValue);
  -        } catch (NoSuchElementException nsee)
  +        }
  +        catch (NoSuchElementException nsee)
           {
               return defaultValue;
           }
       }
  -
       /**
        * Get a string associated with the given configuration key.
        *
  @@ -695,10 +649,8 @@
        */
       public String getString(String key)
       {
  -
           return getString(key, null);
       }
  -
       /**
        * Get a string associated with the given configuration key.
        *
  @@ -712,15 +664,13 @@
       {
           try
           {
  -
               return getFirstMatchingConfig(key).getString(key, defaultValue);
  -        } catch (NoSuchElementException nsee)
  +        }
  +        catch (NoSuchElementException nsee)
           {
               return defaultValue;
  -
           }
       }
  -
       /**
        * Get an array of strings associated with the given configuration
        * key.
  @@ -734,14 +684,13 @@
       {
           try
           {
  -
               return getFirstMatchingConfig(key).getStringArray(key);
  -        } catch (NoSuchElementException nsee)
  +        }
  +        catch (NoSuchElementException nsee)
           {
               return new String[0];
           }
       }
  -
       /**
        * Get a Vector of strings associated with the given configuration key.
        *
  @@ -755,12 +704,12 @@
           try
           {
               return getFirstMatchingConfig(key).getVector(key);
  -        } catch (NoSuchElementException nsee)
  +        }
  +        catch (NoSuchElementException nsee)
           {
               return new Vector();
           }
       }
  -
       /**
        * Get a Vector of strings associated with the given configuration key.
        *
  @@ -774,34 +723,28 @@
       {
           try
           {
  -
               return getFirstMatchingConfig(key).getVector(key, defaultValue);
  -        } catch (NoSuchElementException nsee)
  +        }
  +        catch (NoSuchElementException nsee)
           {
               return defaultValue;
           }
       }
  -
       private Configuration getFirstMatchingConfig(String key)
       {
           for (ListIterator i = configList.listIterator(); i.hasNext();)
           {
               Configuration config = (Configuration) i.next();
  -
               if (config.containsKey(key))
               {
                   return config;
               }
  -
           }
           throw new NoSuchElementException(
               '\'' + key + "' doesn't map to an existing object");
       }
  -
       public Configuration getConfiguration(int index)
       {
           return (Configuration) configList.get(index);
  -
       }
  -
   }
  
  
  
  1.8       +7 -43     jakarta-commons-sandbox/configuration/src/java/org/apache/commons/configuration/ConfigurationFactory.java
  
  Index: ConfigurationFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/configuration/src/java/org/apache/commons/configuration/ConfigurationFactory.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- ConfigurationFactory.java	20 Jun 2003 01:12:49 -0000	1.7
  +++ ConfigurationFactory.java	20 Jun 2003 07:50:47 -0000	1.8
  @@ -1,5 +1,4 @@
   package org.apache.commons.configuration;
  -
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  @@ -53,25 +52,19 @@
    * information on the Apache Software Foundation, please see
    * <http://www.apache.org/>.
    */
  -
   import java.io.File;
   import java.io.FileInputStream;
   import java.io.InputStream;
   import java.net.URL;
  -
   import org.apache.commons.digester.AbstractObjectCreationFactory;
   import org.apache.commons.digester.Digester;
   import org.apache.commons.digester.ObjectCreationFactory;
   import org.apache.commons.digester.xmlrules.DigesterLoader;
  -
   import org.apache.commons.lang.StringUtils;
  -
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -
   import org.xml.sax.Attributes;
   import org.xml.sax.SAXException;
  -
   /**
    * Factory class to create a CompositeConfiguration from a .xml file using
    * Digester.  By default it can handle the Configurations from commons-
  @@ -87,26 +80,20 @@
   {
       /** The XML file with the details about the configuration to load */
       private String configurationFileName;
  -
       /** The basePath to prefix file paths for file based property files. */
       private String basePath;
  -
       /** static logger */
       private static Log log = LogFactory.getLog(ConfigurationFactory.class);
  -
       /** URL for xml digester rules file */
       private URL digesterRules;
  -
       /** The digester namespace to parse */
       private String digesterRuleNamespaceURI;
  -
       /**
        * C'tor
        */
       public ConfigurationFactory()
       {
       }
  -
       /**
        * C'tor with ConfigurationFile Name passed
        *
  @@ -116,7 +103,6 @@
       {
           this.configurationFileName = configurationFileName;
       }
  -
       /**
        * Return the configuration provided by this factory. It
        * loads the configuration file which is a XML description of
  @@ -133,30 +119,28 @@
           CompositeConfiguration configuration = new CompositeConfiguration();
           InputStream input =
               new FileInputStream(new File(getConfigurationFileName()));
  -
           if (getDigesterRules() == null)
           {
               digester = new Digester();
               configureNamespace(digester);
               initDefaultDigesterRules(digester);
  -        } else
  +        }
  +        else
           {
               digester = DigesterLoader.createDigester(getDigesterRules());
  -
               // This might already be too late. As far as I can see, the namespace
               // awareness must be configured before the digester rules are loaded.
               configureNamespace(digester);
           }
  -
           // Put the composite object below all of the other objects.
           digester.push(configuration);
  -
           // Parse the input stream to configure our mappings
           try
           {
               digester.parse(input);
               input.close();
  -        } catch (SAXException e)
  +        }
  +        catch (SAXException e)
           {
               log.error("SAX Exception caught", e);
               throw e;
  @@ -172,7 +156,6 @@
       {
           return configurationFileName;
       }
  -
       /**
        * Sets the configurationFile.
        * @param configurationFileName  The name of the configurationFile to use.
  @@ -181,7 +164,6 @@
       {
           this.configurationFileName = configurationFileName;
       }
  -
       /**
        * Returns the digesterRules.
        * @return URL
  @@ -190,7 +172,6 @@
       {
           return digesterRules;
       }
  -
       /**
        * Sets the digesterRules.
        * @param digesterRules The digesterRules to set
  @@ -199,7 +180,6 @@
       {
           this.digesterRules = digesterRules;
       }
  -
       /**
        * Initializes the parsing rules for the default digester
        *
  @@ -219,14 +199,12 @@
               digester,
               "configuration/dom4j",
               new BasePathConfigurationFactory(DOM4JConfiguration.class));
  -
           // JNDI can be instantiated directly.
           setupDigesterInstance(
               digester,
               "configuration/jndi",
               new JNDIConfigurationFactory(JNDIConfiguration.class));
       }
  -
       /**
        * Sets up a configuration instance that needs an ObjectCreation Factory to
        * generate new Objects.
  @@ -249,7 +227,6 @@
               "addConfiguration",
               Configuration.class.getName());
       }
  -
       /**
        * Sets up a configuration instance that needs an JNDIConfiguration Factory to
        * object.
  @@ -271,7 +248,6 @@
               "addConfiguration",
               Configuration.class.getName());
       }
  -
       /**
        * Returns the digesterRuleNamespaceURI.
        *
  @@ -281,7 +257,6 @@
       {
           return digesterRuleNamespaceURI;
       }
  -
       /**
        * Sets the digesterRuleNamespaceURI.
        *
  @@ -291,7 +266,6 @@
       {
           this.digesterRuleNamespaceURI = digesterRuleNamespaceURI;
       }
  -
       /**
        * Configure the current digester to be namespace aware and to have
        * a Configuration object to which all of the other configurations 
  @@ -306,14 +280,13 @@
           {
               digester.setNamespaceAware(true);
               digester.setRuleNamespaceURI(getDigesterRuleNamespaceURI());
  -        } else
  +        }
  +        else
           {
               digester.setNamespaceAware(false);
           }
  -
           digester.setValidating(false);
       }
  -
       /**
        * Returns the Base path from which this Configuration Factory operates.
        * This is never null. If you set the BasePath to null, then "." is returned.
  @@ -324,7 +297,6 @@
       {
           return StringUtils.isEmpty(basePath) ? "." : basePath;
       }
  -
       /**
        * Sets the basePath for all file references from this Configuration Factory.
        * If you pass null in, this is interpreted as "current directory".
  @@ -335,7 +307,6 @@
       {
           this.basePath = basePath;
       }
  -
       /**
        * A tiny inner class that allows the Configuration Factory to
        * let the digester construct BasePathConfiguration objects
  @@ -348,7 +319,6 @@
       {
           /** Actual class to use. */
           private Class clazz;
  -
           /**
            * C'tor
            *
  @@ -358,7 +328,6 @@
           {
               this.clazz = clazz;
           }
  -
           /**
            * Gets called by the digester. We ignore the attributes
            *
  @@ -374,7 +343,6 @@
               return bpc;
           }
       }
  -
       /**
        * A tiny inner class that allows the Configuration Factory to
        * let the digester construct JNDIPathConfiguration objects.
  @@ -386,7 +354,6 @@
       {
           /** Actual class to use. */
           private Class clazz;
  -
           /**
            * C'tor
            *
  @@ -396,7 +363,6 @@
           {
               this.clazz = clazz;
           }
  -
           /**
            * Gets called by the digester. We ignore the attributes
            *
  @@ -407,9 +373,7 @@
           public Object createObject(Attributes attributes) throws Exception
           {
               JNDIConfiguration jndi = (JNDIConfiguration) clazz.newInstance();
  -
               return jndi;
           }
       }
  -
   }
  
  
  
  1.5       +2 -0      jakarta-commons-sandbox/configuration/conf/test.properties
  
  Index: test.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/configuration/conf/test.properties,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- test.properties	13 Jan 2003 19:29:38 -0000	1.4
  +++ test.properties	20 Jun 2003 07:50:47 -0000	1.5
  @@ -43,3 +43,5 @@
   test.short       = 1
   test.short.array = 2
   test.short.array = 3
  +
  +test.overwrite       = 1
  \ No newline at end of file
  
  
  
  1.28      +2 -2      jakarta-commons-sandbox/configuration/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/configuration/project.xml,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- project.xml	20 Jun 2003 01:12:49 -0000	1.27
  +++ project.xml	20 Jun 2003 07:50:47 -0000	1.28
  @@ -168,7 +168,6 @@
           <war.bundle.jar>true</war.bundle.jar>
         </properties>  
       </dependency>
  -
     </dependencies>
   
     <build>
  @@ -187,6 +186,7 @@
         <excludes>
           <exclude>**/TestBasePropertiesConfiguration.java</exclude>
           <exclude>**/TestClassPropertiesConfiguration.java</exclude>
  +        <exclude>**/NonStringTestHolder.java</exclude>
         </excludes>
         <resources>
           <resource>
  
  
  

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