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 NonStringTestHolder.java
Date Mon, 21 Jun 2004 09:58:54 GMT
ebourg      2004/06/21 02:58:54

  Modified:    configuration/src/test/org/apache/commons/configuration
                        NonStringTestHolder.java
  Log:
  added an assertion comment for testListMissing()
  
  Revision  Changes    Path
  1.6       +13 -15    jakarta-commons/configuration/src/test/org/apache/commons/configuration/NonStringTestHolder.java
  
  Index: NonStringTestHolder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/configuration/src/test/org/apache/commons/configuration/NonStringTestHolder.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- NonStringTestHolder.java	9 Mar 2004 10:31:31 -0000	1.5
  +++ NonStringTestHolder.java	21 Jun 2004 09:58:54 -0000	1.6
  @@ -1,5 +1,3 @@
  -package org.apache.commons.configuration;
  -
   /*
    * Copyright 2001-2004 The Apache Software Foundation.
    *
  @@ -16,7 +14,11 @@
    * limitations under the License.
    */
   
  +package org.apache.commons.configuration;
  +
  +import java.util.ArrayList;
   import java.util.Iterator;
  +import java.util.List;
   
   import junit.framework.Assert;
   
  @@ -29,6 +31,7 @@
   public class NonStringTestHolder
   {
       private Configuration configuration;
  +
       public void testBoolean() throws Exception
       {
           boolean booleanValue = configuration.getBoolean("test.boolean");
  @@ -38,12 +41,10 @@
   
       public void testBooleanDefaultValue() throws Exception
       {
  -        boolean booleanValue =
  -            configuration.getBoolean("test.boolean.missing", true);
  +        boolean booleanValue = configuration.getBoolean("test.boolean.missing", true);
           Assert.assertEquals(true, booleanValue);
   
  -        Boolean booleanObject =
  -            configuration.getBoolean("test.boolean.missing", new Boolean(true));
  +        Boolean booleanObject = configuration.getBoolean("test.boolean.missing", new Boolean(true));
           Assert.assertEquals(new Boolean(true), booleanObject);
       }
   
  @@ -66,8 +67,7 @@
       public void testDoubleDefaultValue() throws Exception
       {
           double testValue = 10.25;
  -        double doubleValue =
  -            configuration.getDouble("test.double.missing", 10.25);
  +        double doubleValue = configuration.getDouble("test.double.missing", 10.25);
   
           Assert.assertEquals(testValue, doubleValue, 0.01);
       }
  @@ -83,10 +83,8 @@
       public void testFloatDefaultValue() throws Exception
       {
           float testValue = (float) 20.25;
  -        float floatValue =
  -            configuration.getFloat("test.float.missing", testValue);
  +        float floatValue = configuration.getFloat("test.float.missing", testValue);
           Assert.assertEquals(testValue, floatValue, 0.01);
  -
       }
   
       public void testInteger() throws Exception
  @@ -123,14 +121,14 @@
   
       public void testShortDefaultValue() throws Exception
       {
  -        short shortValue =
  -            configuration.getShort("test.short.missing", (short) 1);
  +        short shortValue = configuration.getShort("test.short.missing", (short) 1);
           Assert.assertEquals(1, shortValue);
       }
   
       public void testListMissing() throws Exception
       {
  -        Assert.assertEquals(0, configuration.getList("missing.list").size());
  +        List list = configuration.getList("missing.list");
  +        Assert.assertTrue("'missing.list' is not empty", list.isEmpty());
       }
   
       public void testSubset() throws Exception
  
  
  

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