commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject cvs commit: jakarta-commons/collections/src/test/org/apache/commons/collections/primitives TestAbstractIntArrayList.java TestAbstractLongArrayList.java TestAbstractShortArrayList.java TestFloatArrayList.java TestIntArrayList.java TestLongArrayList.java TestShortArrayList.java TestUnsignedByteArrayList.java TestUnsignedIntArrayList.java TestUnsignedShortArrayList.java
Date Fri, 21 Jun 2002 04:01:31 GMT
mas         2002/06/20 21:01:31

  Modified:    collections/src/test/org/apache/commons/collections/primitives
                        TestAbstractIntArrayList.java
                        TestAbstractLongArrayList.java
                        TestAbstractShortArrayList.java
                        TestFloatArrayList.java TestIntArrayList.java
                        TestLongArrayList.java TestShortArrayList.java
                        TestUnsignedByteArrayList.java
                        TestUnsignedIntArrayList.java
                        TestUnsignedShortArrayList.java
  Log:
  Made the TestCases for primitive lists extend TestList,
  so the full suite of List tests is performed on them.
  Used BulkTest.makeSuite to pick up the sublist tests.
  
  There should probably be additional work for testing the
  primitive operations.
  
  Submitted by: Paul Jack ( pjack at sfaf dot org )
  
  Revision  Changes    Path
  1.2       +56 -5     jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestAbstractIntArrayList.java
  
  Index: TestAbstractIntArrayList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestAbstractIntArrayList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestAbstractIntArrayList.java	4 Jun 2002 16:01:28 -0000	1.1
  +++ TestAbstractIntArrayList.java	21 Jun 2002 04:01:31 -0000	1.2
  @@ -71,7 +71,7 @@
    * @version $Revision$ $Date$
    * @author Rodney Waldhoff
    */
  -public abstract class TestAbstractIntArrayList extends /* TestList */ TestCase {
  +public abstract class TestAbstractIntArrayList extends TestList {
   
       //------------------------------------------------------------ Conventional
   
  @@ -130,5 +130,56 @@
            assertEquals("Should get entry back", i, list.getInt(i));
         }
      }
  +
  +
  +   /**
  +    *  Returns small Integer objects for testing.
  +    */
  +   protected Object[] getFullElements() {
  +       Integer[] result = new Integer[19];
  +       for (int i = 0; i < result.length; i++) {
  +           result[i] = new Integer(i + 19);
  +       }
  +       return result;
  +   }
  +
  +
  +   /**
  +    *  Returns small Integer objects for testing.
  +    */
  +   protected Object[] getOtherElements() {
  +       Integer[] result = new Integer[16];
  +       for (int i = 0; i < result.length; i++) {
  +           result[i] = new Integer(i + 48);
  +       }
  +       return result;
  +   }
  +
  +   // TODO:  Create canonical collections in CVS
  +
  +   public void testCanonicalEmptyCollectionExists() {
  +   }
  +
  +
  +   public void testCanonicalFullCollectionExists() {
  +   }
  +
  +   public void testEmptyListCompatibility() {
  +   }
  +
  +   public void testFullListCompatibility() {
  +   }
  +
  +   // TODO:  Fix primitive lists to be fail fast
  +
  +   public void testCollectionIteratorFailFast() {
  +   }
  +
  +   public void testListSubListFailFastOnAdd() {
  +   }
  +
  +   public void testListSubListFailFastOnRemove() {
  +   }
  +
   }
   
  
  
  
  1.2       +57 -5     jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestAbstractLongArrayList.java
  
  Index: TestAbstractLongArrayList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestAbstractLongArrayList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestAbstractLongArrayList.java	4 Jun 2002 16:01:28 -0000	1.1
  +++ TestAbstractLongArrayList.java	21 Jun 2002 04:01:31 -0000	1.2
  @@ -71,7 +71,7 @@
    * @version $Revision$ $Date$
    * @author Rodney Waldhoff
    */
  -public abstract class TestAbstractLongArrayList extends /* TestList */ TestCase {
  +public abstract class TestAbstractLongArrayList extends TestList {
   
       //------------------------------------------------------------ Conventional
   
  @@ -114,6 +114,58 @@
               assertEquals(value,list.getLong((int)i));
           }
       }
  +
  +
  +    /**
  +     *  Returns an array of Long objects for testing.
  +     */
  +    protected Object[] getFullElements() {
  +        Long[] result = new Long[19];
  +        for (int i = 0; i < result.length; i++) {
  +            result[i] = new Long(i + 19);
  +        }
  +        return result;
  +    }
  +
  +
  +    /**
  +     *  Returns an array of Long objects for testing.
  +     */
  +    protected Object[] getOtherElements() {
  +        Long[] result = new Long[16];
  +        for (int i = 0; i < result.length; i++) {
  +            result[i] = new Long(i + 48);
  +        }
  +        return result;
  +    }
  +
  +    // TODO:  Create canonical primitive lists in CVS
  +
  +    public void testCanonicalEmptyCollectionExists() {
  +    }
  +
  +
  +    public void testCanonicalFullCollectionExists() {
  +    }
  +
  +    public void testEmptyListCompatibility() {
  +    }
  +
  +    public void testFullListCompatibility() {
  +    }
  +
  +    // TODO: Make primitive lists fail-fast
  +
  +    public void testCollectionIteratorFailFast() {
  +    }
  +
  +    public void testListSubListFailFastOnAdd() {
  +    }
  +
  +    public void testListSubListFailFastOnRemove() {
  +    }
  +
  +
   
   }
   
  
  
  
  1.2       +58 -5     jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestAbstractShortArrayList.java
  
  Index: TestAbstractShortArrayList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestAbstractShortArrayList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestAbstractShortArrayList.java	4 Jun 2002 16:01:28 -0000	1.1
  +++ TestAbstractShortArrayList.java	21 Jun 2002 04:01:31 -0000	1.2
  @@ -71,7 +71,7 @@
    * @version $Revision$ $Date$
    * @author Rodney Waldhoff
    */
  -public abstract class TestAbstractShortArrayList extends /* TestList */ TestCase {
  +public abstract class TestAbstractShortArrayList extends TestList {
   
       //------------------------------------------------------------ Conventional
   
  @@ -110,5 +110,58 @@
               assertEquals((short)(i+128),list.getShort(i));
           }
       }
  +
  +    /**
  +     *  Returns an array of Short objects for testing.
  +     */
  +    protected Object[] getFullElements() {
  +        Short[] result = new Short[19];
  +        for (int i = 0; i < result.length; i++) {
  +            result[i] = new Short((short)(i + 19));
  +        }
  +        return result;
  +    }
  +
  +
  +    /**
  +     *  Returns an array of Short objects for testing.
  +     */
  +    protected Object[] getOtherElements() {
  +        Short[] result = new Short[16];
  +        for (int i = 0; i < result.length; i++) {
  +            result[i] = new Short((short)(i + 48));
  +        }
  +        return result;
  +    }
  +
  +    // TODO:  Create canonical primitive lists in CVS
  +
  +    public void testCanonicalEmptyCollectionExists() {
  +    }
  +
  +
  +    public void testCanonicalFullCollectionExists() {
  +    }
  +
  +    public void testEmptyListCompatibility() {
  +    }
  +
  +    public void testFullListCompatibility() {
  +    }
  +
  +    // TODO: Make primitive lists fail fast
  +
  +    public void testCollectionIteratorFailFast() {
  +    }
  +
  +    public void testListSubListFailFastOnAdd() {
  +    }
  +
  +    public void testListSubListFailFastOnRemove() {
  +    }
  +
  +
  +
  +
   }
   
  
  
  
  1.2       +47 -5     jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestFloatArrayList.java
  
  Index: TestFloatArrayList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestFloatArrayList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestFloatArrayList.java	4 Jun 2002 16:50:09 -0000	1.1
  +++ TestFloatArrayList.java	21 Jun 2002 04:01:31 -0000	1.2
  @@ -71,7 +71,7 @@
    * @version $Revision$ $Date$
    * @author Rodney Waldhoff
    */
  -public class TestFloatArrayList extends /* TestList */ TestCase {
  +public class TestFloatArrayList extends TestList {
   
       //------------------------------------------------------------ Conventional
   
  @@ -80,7 +80,7 @@
       }
   
       public static Test suite() {
  -        TestSuite suite = new TestSuite(TestFloatArrayList.class);
  +        TestSuite suite = TestList.makeSuite(TestFloatArrayList.class);
           return suite;
       }
   
  @@ -107,5 +107,47 @@
               assertEquals((float)i,list.getFloat(i),Float.MAX_VALUE);
           }
       }
  +
  +
  +   protected Object[] getFullElements() {
  +       Float[] result = new Float[19];
  +       for (int i = 0; i < result.length; i++) {
  +           result[i] = new Float((float)(i + 19));
  +       }
  +       return result;
  +   }
  +
  +
  +   protected Object[] getOtherElements() {
  +       Float[] result = new Float[16];
  +       for (int i = 0; i < result.length; i++) {
  +           result[i] = new Float((float)(i + 48));
  +       }
  +       return result;
  +   }
  +
  +
  +   public void testCanonicalEmptyCollectionExists() {
  +   }
  +
  +
  +   public void testCanonicalFullCollectionExists() {
  +   }
  +
  +   public void testEmptyListCompatibility() {
  +   }
  +
  +   public void testFullListCompatibility() {
  +   }
  +
  +   public void testCollectionIteratorFailFast() {
  +   }
  +
  +   public void testListSubListFailFastOnAdd() {
  +   }
  +
  +   public void testListSubListFailFastOnRemove() {
  +   }
  +
   }
   
  
  
  
  1.2       +6 -5      jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestIntArrayList.java
  
  Index: TestIntArrayList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestIntArrayList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestIntArrayList.java	4 Jun 2002 16:01:28 -0000	1.1
  +++ TestIntArrayList.java	21 Jun 2002 04:01:31 -0000	1.2
  @@ -64,6 +64,7 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  +import org.apache.commons.collections.BulkTest;
   
   /**
    * @version $Revision$ $Date$
  @@ -78,7 +79,7 @@
       }
   
       public static Test suite() {
  -        TestSuite suite = new TestSuite(TestIntArrayList.class);
  +        TestSuite suite = BulkTest.makeSuite(TestIntArrayList.class);
           return suite;
       }
   
  
  
  
  1.2       +6 -5      jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestLongArrayList.java
  
  Index: TestLongArrayList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestLongArrayList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestLongArrayList.java	4 Jun 2002 16:01:28 -0000	1.1
  +++ TestLongArrayList.java	21 Jun 2002 04:01:31 -0000	1.2
  @@ -64,6 +64,7 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  +import org.apache.commons.collections.BulkTest;
   
   /**
    * @version $Revision$ $Date$
  @@ -78,7 +79,7 @@
       }
   
       public static Test suite() {
  -        TestSuite suite = new TestSuite(TestLongArrayList.class);
  +        TestSuite suite = BulkTest.makeSuite(TestLongArrayList.class);
           return suite;
       }
   
  
  
  
  1.2       +6 -5      jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestShortArrayList.java
  
  Index: TestShortArrayList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestShortArrayList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestShortArrayList.java	4 Jun 2002 16:01:28 -0000	1.1
  +++ TestShortArrayList.java	21 Jun 2002 04:01:31 -0000	1.2
  @@ -64,6 +64,7 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  +import org.apache.commons.collections.BulkTest;
   
   /**
    * @version $Revision$ $Date$
  @@ -78,7 +79,7 @@
       }
   
       public static Test suite() {
  -        TestSuite suite = new TestSuite(TestShortArrayList.class);
  +        TestSuite suite = BulkTest.makeSuite(TestShortArrayList.class);
           return suite;
       }
   
  
  
  
  1.2       +6 -5      jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestUnsignedByteArrayList.java
  
  Index: TestUnsignedByteArrayList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestUnsignedByteArrayList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestUnsignedByteArrayList.java	4 Jun 2002 16:01:28 -0000	1.1
  +++ TestUnsignedByteArrayList.java	21 Jun 2002 04:01:31 -0000	1.2
  @@ -64,6 +64,7 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  +import org.apache.commons.collections.BulkTest;
   
   /**
    * @version $Revision$ $Date$
  @@ -78,7 +79,7 @@
       }
   
       public static Test suite() {
  -        TestSuite suite = new TestSuite(TestUnsignedByteArrayList.class);
  +        TestSuite suite = BulkTest.makeSuite(TestUnsignedByteArrayList.class);
           return suite;
       }
   
  
  
  
  1.2       +6 -5      jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestUnsignedIntArrayList.java
  
  Index: TestUnsignedIntArrayList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestUnsignedIntArrayList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestUnsignedIntArrayList.java	4 Jun 2002 16:01:28 -0000	1.1
  +++ TestUnsignedIntArrayList.java	21 Jun 2002 04:01:31 -0000	1.2
  @@ -64,6 +64,7 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  +import org.apache.commons.collections.BulkTest;
   
   /**
    * @version $Revision$ $Date$
  @@ -78,7 +79,7 @@
       }
   
       public static Test suite() {
  -        TestSuite suite = new TestSuite(TestUnsignedIntArrayList.class);
  +        TestSuite suite = BulkTest.makeSuite(TestUnsignedIntArrayList.class);
           return suite;
       }
   
  
  
  
  1.2       +6 -5      jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestUnsignedShortArrayList.java
  
  Index: TestUnsignedShortArrayList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/primitives/TestUnsignedShortArrayList.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestUnsignedShortArrayList.java	4 Jun 2002 16:01:28 -0000	1.1
  +++ TestUnsignedShortArrayList.java	21 Jun 2002 04:01:31 -0000	1.2
  @@ -64,6 +64,7 @@
   import junit.framework.Test;
   import junit.framework.TestCase;
   import junit.framework.TestSuite;
  +import org.apache.commons.collections.BulkTest;
   
   /**
    * @version $Revision$ $Date$
  @@ -78,7 +79,7 @@
       }
   
       public static Test suite() {
  -        TestSuite suite = new TestSuite(TestUnsignedShortArrayList.class);
  +        TestSuite suite = BulkTest.makeSuite(TestUnsignedShortArrayList.class);
           return suite;
       }
   
  
  
  

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


Mime
View raw message