commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From morg...@apache.org
Subject cvs commit: jakarta-commons/collections/src/test/org/apache/commons/collections TestAll.java TestFastHashMap.java TestFastTreeMap.java TestHashMap.java TestLRUMap.java TestMap.java TestSoftRefHashMap.java TestTreeMap.java
Date Tue, 26 Feb 2002 06:17:52 GMT
morgand     02/02/25 22:17:52

  Modified:    collections/src/test/org/apache/commons/collections Tag:
                        collections_1_x_branch TestAll.java
                        TestFastHashMap.java TestFastTreeMap.java
                        TestHashMap.java TestLRUMap.java TestMap.java
                        TestSoftRefHashMap.java TestTreeMap.java
  Log:
  merged in test changed from the HEAD into collections 1.x branch
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.15.2.3  +4 -6      jakarta-commons/collections/src/test/org/apache/commons/collections/TestAll.java
  
  Index: TestAll.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestAll.java,v
  retrieving revision 1.15.2.2
  retrieving revision 1.15.2.3
  diff -u -r1.15.2.2 -r1.15.2.3
  --- TestAll.java	26 Feb 2002 05:44:14 -0000	1.15.2.2
  +++ TestAll.java	26 Feb 2002 06:17:51 -0000	1.15.2.3
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestAll.java,v
1.15.2.2 2002/02/26 05:44:14 morgand Exp $
  - * $Revision: 1.15.2.2 $
  - * $Date: 2002/02/26 05:44:14 $
  + * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestAll.java,v
1.15.2.3 2002/02/26 06:17:51 morgand Exp $
  + * $Revision: 1.15.2.3 $
  + * $Date: 2002/02/26 06:17:51 $
    *
    * ====================================================================
    *
  @@ -66,7 +66,7 @@
   /**
    * Entry point for all Collections tests.
    * @author Rodney Waldhoff
  - * @version $Id: TestAll.java,v 1.15.2.2 2002/02/26 05:44:14 morgand Exp $
  + * @version $Id: TestAll.java,v 1.15.2.3 2002/02/26 06:17:51 morgand Exp $
    */
   public class TestAll extends TestCase {
       public TestAll(String testName) {
  @@ -87,8 +87,6 @@
           suite.addTest(TestFastHashMap1.suite());
           suite.addTest(TestFastTreeMap.suite());
           suite.addTest(TestFastTreeMap1.suite());
  -        suite.addTest(TestHashMap.suite());
  -        suite.addTest(TestTreeMap.suite());
           suite.addTest(TestLRUMap.suite());
           return suite;
       }
  
  
  
  1.3.2.1   +6 -6      jakarta-commons/collections/src/test/org/apache/commons/collections/TestFastHashMap.java
  
  Index: TestFastHashMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestFastHashMap.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- TestFastHashMap.java	21 Apr 2001 12:22:30 -0000	1.3
  +++ TestFastHashMap.java	26 Feb 2002 06:17:51 -0000	1.3.2.1
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestFastHashMap.java,v
1.3 2001/04/21 12:22:30 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2001/04/21 12:22:30 $
  + * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestFastHashMap.java,v
1.3.2.1 2002/02/26 06:17:51 morgand Exp $
  + * $Revision: 1.3.2.1 $
  + * $Date: 2002/02/26 06:17:51 $
    *
    * ====================================================================
    *
  @@ -69,7 +69,7 @@
   
   /**
    * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
  - * @version $Id: TestFastHashMap.java,v 1.3 2001/04/21 12:22:30 craigmcc Exp $
  + * @version $Id: TestFastHashMap.java,v 1.3.2.1 2002/02/26 06:17:51 morgand Exp $
    */
   public class TestFastHashMap extends TestHashMap
   {
  @@ -89,7 +89,7 @@
           junit.textui.TestRunner.main(testCaseName);
       }
   
  -    public Map makeMap() {
  +    public Map makeEmptyMap() {
           FastHashMap fhm = new FastHashMap();
           fhm.setFast(false);
           return (fhm);
  @@ -97,7 +97,7 @@
   
       public void setUp()
       {
  -        map = (HashMap) makeMap();
  +        map = (HashMap) makeEmptyMap();
       }
   
   }
  
  
  
  1.3.2.1   +13 -6     jakarta-commons/collections/src/test/org/apache/commons/collections/TestFastTreeMap.java
  
  Index: TestFastTreeMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestFastTreeMap.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -r1.3 -r1.3.2.1
  --- TestFastTreeMap.java	21 Apr 2001 12:22:30 -0000	1.3
  +++ TestFastTreeMap.java	26 Feb 2002 06:17:51 -0000	1.3.2.1
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestFastTreeMap.java,v
1.3 2001/04/21 12:22:30 craigmcc Exp $
  - * $Revision: 1.3 $
  - * $Date: 2001/04/21 12:22:30 $
  + * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestFastTreeMap.java,v
1.3.2.1 2002/02/26 06:17:51 morgand Exp $
  + * $Revision: 1.3.2.1 $
  + * $Date: 2002/02/26 06:17:51 $
    *
    * ====================================================================
    *
  @@ -69,7 +69,7 @@
   
   /**
    * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
  - * @version $Id: TestFastTreeMap.java,v 1.3 2001/04/21 12:22:30 craigmcc Exp $
  + * @version $Id: TestFastTreeMap.java,v 1.3.2.1 2002/02/26 06:17:51 morgand Exp $
    */
   public class TestFastTreeMap extends TestTreeMap
   {
  @@ -89,15 +89,22 @@
           junit.textui.TestRunner.main(testCaseName);
       }
   
  -    public Map makeMap() {
  +    public Map makeEmptyMap() {
           FastTreeMap ftm = new FastTreeMap();
           ftm.setFast(false);
           return (ftm);
       }
  +  
  +    /**
  +     *  The comparator for the fast tree map does not support null keys.
  +     **/
  +    public boolean useNullKey() {
  +      return false;
  +    }
   
       public void setUp()
       {
  -        map = (TreeMap) makeMap();
  +        map = (TreeMap) makeEmptyMap();
       }
   
   }
  
  
  
  1.2.2.2   +12 -15    jakarta-commons/collections/src/test/org/apache/commons/collections/TestHashMap.java
  
  Index: TestHashMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestHashMap.java,v
  retrieving revision 1.2.2.1
  retrieving revision 1.2.2.2
  diff -u -r1.2.2.1 -r1.2.2.2
  --- TestHashMap.java	26 Feb 2002 00:51:21 -0000	1.2.2.1
  +++ TestHashMap.java	26 Feb 2002 06:17:51 -0000	1.2.2.2
  @@ -1,7 +1,13 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestHashMap.java,v
1.2.2.1 2002/02/26 00:51:21 morgand Exp $
  - * $Revision: 1.2.2.1 $
  - * $Date: 2002/02/26 00:51:21 $
  +<<<<<<< TestHashMap.java
  + * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestHashMap.java,v
1.2.2.2 2002/02/26 06:17:51 morgand Exp $
  + * $Revision: 1.2.2.2 $
  + * $Date: 2002/02/26 06:17:51 $
  +=======
  + * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestHashMap.java,v
1.2.2.2 2002/02/26 06:17:51 morgand Exp $
  + * $Revision: 1.2.2.2 $
  + * $Date: 2002/02/26 06:17:51 $
  +>>>>>>> 1.6
    *
    * ====================================================================
    *
  @@ -69,31 +75,21 @@
   
   /**
    * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
  - * @version $Id: TestHashMap.java,v 1.2.2.1 2002/02/26 00:51:21 morgand Exp $
  + * @version $Id: TestHashMap.java,v 1.2.2.2 2002/02/26 06:17:51 morgand Exp $
    */
  -public class TestHashMap extends TestMap
  +public abstract class TestHashMap extends TestMap
   {
       public TestHashMap(String testName)
       {
           super(testName);
       }
   
  -    public static Test suite()
  -    {
  -        return new TestSuite(TestHashMap.class);
  -    }
  -
       public static void main(String args[])
       {
           String[] testCaseName = { TestHashMap.class.getName() };
           junit.textui.TestRunner.main(testCaseName);
       }
   
  -    public Map makeEmptyMap() {
  -        HashMap hm = new HashMap();
  -        return (hm);
  -    }
  -
       protected HashMap map = null;
   
       public void setUp()
  @@ -114,4 +110,5 @@
           assertEquals("Top item is 'Second Item'", map.get("first"), "First Item");
           assertEquals("Next Item is 'First Item'", map.get("second"), "Second Item");
       }
  +
   }
  
  
  
  1.11.2.2  +4 -25     jakarta-commons/collections/src/test/org/apache/commons/collections/TestLRUMap.java
  
  Index: TestLRUMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestLRUMap.java,v
  retrieving revision 1.11.2.1
  retrieving revision 1.11.2.2
  diff -u -r1.11.2.1 -r1.11.2.2
  --- TestLRUMap.java	26 Feb 2002 00:51:21 -0000	1.11.2.1
  +++ TestLRUMap.java	26 Feb 2002 06:17:51 -0000	1.11.2.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestLRUMap.java,v
1.11.2.1 2002/02/26 00:51:21 morgand Exp $
  - * $Revision: 1.11.2.1 $
  - * $Date: 2002/02/26 00:51:21 $
  + * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestLRUMap.java,v
1.11.2.2 2002/02/26 06:17:51 morgand Exp $
  + * $Revision: 1.11.2.2 $
  + * $Date: 2002/02/26 06:17:51 $
    *
    * ====================================================================
    *
  @@ -76,7 +76,7 @@
    * 
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
    * @author <a href="mailto:morgand@apache.org">Morgan Delagrange</a>
  - * @version $Id: TestLRUMap.java,v 1.11.2.1 2002/02/26 00:51:21 morgand Exp $
  + * @version $Id: TestLRUMap.java,v 1.11.2.2 2002/02/26 06:17:51 morgand Exp $
    */
   public class TestLRUMap extends TestMap
   {
  @@ -188,27 +188,6 @@
   
           assertTrue("map should have size = 3, but actually = " + map.size(), 
                      map.size() == 3);
  -    }
  -
  -
  -    public void testExternalizable() throws IOException, ClassNotFoundException {
  -        /*
  -         * Test object created with this code
  -         * Object created from CVS version 1.3 of the LRUMap class
  -         *
  -        LRUMap map2 = new LRUMap(3);
  -        map2.put(new Integer(1),"foo");
  -        map2.put(new Integer(4),"bar");
  -        map2.put(new Integer(6),"yeah");
  -        map2.writeExternal(new ObjectOutputStream(new FileOutputStream("data/test/LRUMapVersion1.obj")));
  -         */
  -
  -        // purposely start me out with a smaller capacity
  -        LRUMap map2 = new LRUMap(1);
  -        map2.readExternal(new ObjectInputStream(new FileInputStream("data/test/LRUMapVersion1.obj")));
  -        assertTrue("Integer(1) equals foo",map2.get(new Integer(1)).equals("foo"));
  -        assertTrue("Integer(4) equals bar",map2.get(new Integer(4)).equals("bar"));
  -        assertTrue("Integer(6) equals yeah",map2.get(new Integer(6)).equals("yeah"));
       }
   
       /**
  
  
  
  1.3.2.2   +6 -12     jakarta-commons/collections/src/test/org/apache/commons/collections/TestMap.java
  
  Index: TestMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestMap.java,v
  retrieving revision 1.3.2.1
  retrieving revision 1.3.2.2
  diff -u -r1.3.2.1 -r1.3.2.2
  --- TestMap.java	26 Feb 2002 00:51:21 -0000	1.3.2.1
  +++ TestMap.java	26 Feb 2002 06:17:51 -0000	1.3.2.2
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestMap.java,v
1.3.2.1 2002/02/26 00:51:21 morgand Exp $
  - * $Revision: 1.3.2.1 $
  - * $Date: 2002/02/26 00:51:21 $
  + * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestMap.java,v
1.3.2.2 2002/02/26 06:17:51 morgand Exp $
  + * $Revision: 1.3.2.2 $
  + * $Date: 2002/02/26 06:17:51 $
    *
    * ====================================================================
    *
  @@ -87,7 +87,7 @@
    *
    * @author Michael Smith
    * @author Rodney Waldhoff
  - * @version $Id: TestMap.java,v 1.3.2.1 2002/02/26 00:51:21 morgand Exp $
  + * @version $Id: TestMap.java,v 1.3.2.2 2002/02/26 06:17:51 morgand Exp $
    */
   public abstract class TestMap extends TestObject {
   
  @@ -959,17 +959,14 @@
        * against the canonical version in CVS.
        */
       public void testEmptyMapCompatibility() throws IOException, ClassNotFoundException
{
  -        /**
  -         * Create canonical objects with this code
           Map map = makeEmptyMap();
           if (!(map instanceof Serializable)) return;
           
           writeExternalFormToDisk((Serializable) map, getCanonicalEmptyMapName(map));
  -        */
   
           // test to make sure the canonical form has been preserved
           if (!(makeEmptyMap() instanceof Serializable)) return;
  -        Map map = (Map) readExternalFormFromDisk(getCanonicalEmptyMapName(makeEmptyMap()));
  +        map = (Map) readExternalFormFromDisk(getCanonicalEmptyMapName(makeEmptyMap()));
           assertTrue("Map is empty",map.isEmpty()  == true);
       }
   
  @@ -978,17 +975,14 @@
        * against the canonical version in CVS.
        */
       public void testFullMapCompatibility() throws IOException, ClassNotFoundException {
  -        /**
  -         * Create canonical objects with this code
           Map map = makeFullMap();
           if (!(map instanceof Serializable)) return;
           
           writeExternalFormToDisk((Serializable) map, getCanonicalFullMapName(map));
  -        */
   
           // test to make sure the canonical form has been preserved
           if (!(makeFullMap() instanceof Serializable)) return;
  -        Map map = (Map) readExternalFormFromDisk(getCanonicalFullMapName(makeFullMap()));
  +        map = (Map) readExternalFormFromDisk(getCanonicalFullMapName(makeFullMap()));
           assertEquals("Map is the right size",map.size(), getSampleKeys().length);
       }
   
  
  
  
  1.1.2.1   +6 -6      jakarta-commons/collections/src/test/org/apache/commons/collections/TestSoftRefHashMap.java
  
  Index: TestSoftRefHashMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestSoftRefHashMap.java,v
  retrieving revision 1.1
  retrieving revision 1.1.2.1
  diff -u -r1.1 -r1.1.2.1
  --- TestSoftRefHashMap.java	6 May 2001 11:10:36 -0000	1.1
  +++ TestSoftRefHashMap.java	26 Feb 2002 06:17:51 -0000	1.1.2.1
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestSoftRefHashMap.java,v
1.1 2001/05/06 11:10:36 jstrachan Exp $
  - * $Revision: 1.1 $
  - * $Date: 2001/05/06 11:10:36 $
  + * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestSoftRefHashMap.java,v
1.1.2.1 2002/02/26 06:17:51 morgand Exp $
  + * $Revision: 1.1.2.1 $
  + * $Date: 2002/02/26 06:17:51 $
    *
    * ====================================================================
    *
  @@ -69,7 +69,7 @@
   
   /**
    * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
  - * @version $Id: TestSoftRefHashMap.java,v 1.1 2001/05/06 11:10:36 jstrachan Exp $
  + * @version $Id: TestSoftRefHashMap.java,v 1.1.2.1 2002/02/26 06:17:51 morgand Exp $
    */
   public class TestSoftRefHashMap extends TestHashMap
   {
  @@ -86,13 +86,13 @@
           junit.textui.TestRunner.main(testCaseName);
       }
   
  -    public Map makeMap() {
  +    public Map makeEmptyMap() {
           SoftRefHashMap map = new SoftRefHashMap();
           return map;
       }
   
       public void setUp() {
  -        map = (HashMap) makeMap();
  +        map = (HashMap) makeEmptyMap();
       }
   
   }
  
  
  
  1.2.2.2   +13 -13    jakarta-commons/collections/src/test/org/apache/commons/collections/TestTreeMap.java
  
  Index: TestTreeMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestTreeMap.java,v
  retrieving revision 1.2.2.1
  retrieving revision 1.2.2.2
  diff -u -r1.2.2.1 -r1.2.2.2
  --- TestTreeMap.java	26 Feb 2002 00:51:21 -0000	1.2.2.1
  +++ TestTreeMap.java	26 Feb 2002 06:17:51 -0000	1.2.2.2
  @@ -1,7 +1,13 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestTreeMap.java,v
1.2.2.1 2002/02/26 00:51:21 morgand Exp $
  - * $Revision: 1.2.2.1 $
  - * $Date: 2002/02/26 00:51:21 $
  +<<<<<<< TestTreeMap.java
  + * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestTreeMap.java,v
1.2.2.2 2002/02/26 06:17:51 morgand Exp $
  + * $Revision: 1.2.2.2 $
  + * $Date: 2002/02/26 06:17:51 $
  +=======
  + * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestTreeMap.java,v
1.2.2.2 2002/02/26 06:17:51 morgand Exp $
  + * $Revision: 1.2.2.2 $
  + * $Date: 2002/02/26 06:17:51 $
  +>>>>>>> 1.5
    *
    * ====================================================================
    *
  @@ -69,29 +75,23 @@
   
   /**
    * @author <a href="mailto:jvanzyl@apache.org">Jason van Zyl</a>
  - * @version $Id: TestTreeMap.java,v 1.2.2.1 2002/02/26 00:51:21 morgand Exp $
  + * @version $Id: TestTreeMap.java,v 1.2.2.2 2002/02/26 06:17:51 morgand Exp $
    */
  -public class TestTreeMap extends TestMap
  +public abstract class TestTreeMap extends TestMap
   {
       public TestTreeMap(String testName)
       {
           super(testName);
       }
   
  -    public static Test suite()
  -    {
  -        return new TestSuite(TestTreeMap.class);
  -    }
  -
       public static void main(String args[])
       {
           String[] testCaseName = { TestTreeMap.class.getName() };
           junit.textui.TestRunner.main(testCaseName);
       }
   
  -    public Map makeEmptyMap() {
  -        TreeMap tm = new TreeMap();
  -        return (tm);
  +    public boolean useNullKey() {
  +      return false;
       }
   
       protected TreeMap map = null;
  
  
  

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