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 TestMap.java TestObject.java TestSequencedHashMap.java
Date Tue, 26 Feb 2002 00:08:07 GMT
morgand     02/02/25 16:08:07

  Modified:    collections/src/test/org/apache/commons/collections
                        TestMap.java TestObject.java
                        TestSequencedHashMap.java
  Log:
  changed compatibility version to a method, and had it default to the
  maximum level of compatibility: version 1
  
  Revision  Changes    Path
  1.13      +6 -6      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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TestMap.java	25 Feb 2002 20:57:08 -0000	1.12
  +++ TestMap.java	26 Feb 2002 00:08:07 -0000	1.13
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestMap.java,v
1.12 2002/02/25 20:57:08 morgand Exp $
  - * $Revision: 1.12 $
  - * $Date: 2002/02/25 20:57:08 $
  + * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestMap.java,v
1.13 2002/02/26 00:08:07 morgand Exp $
  + * $Revision: 1.13 $
  + * $Date: 2002/02/26 00:08:07 $
    *
    * ====================================================================
    *
  @@ -87,7 +87,7 @@
    *
    * @author Michael Smith
    * @author Rodney Waldhoff
  - * @version $Id: TestMap.java,v 1.12 2002/02/25 20:57:08 morgand Exp $
  + * @version $Id: TestMap.java,v 1.13 2002/02/26 00:08:07 morgand Exp $
    */
   public abstract class TestMap extends TestObject {
   
  @@ -937,7 +937,7 @@
           mapName = mapName.substring(mapName.lastIndexOf(".")+1,mapName.length());
           retval.append(mapName);
           retval.append(".emptyMap.version");
  -        retval.append(COMPATIBILITY_VERSION);
  +        retval.append(getCompatibilityVersion());
           retval.append(".obj");
           return retval.toString();
       }
  @@ -949,7 +949,7 @@
           mapName = mapName.substring(mapName.lastIndexOf(".")+1,mapName.length());
           retval.append(mapName);
           retval.append(".fullMap.version");
  -        retval.append(COMPATIBILITY_VERSION);
  +        retval.append(getCompatibilityVersion());
           retval.append(".obj");
           return retval.toString();
       }
  
  
  
  1.7       +20 -11    jakarta-commons/collections/src/test/org/apache/commons/collections/TestObject.java
  
  Index: TestObject.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestObject.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestObject.java	25 Feb 2002 20:57:08 -0000	1.6
  +++ TestObject.java	26 Feb 2002 00:08:07 -0000	1.7
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestObject.java,v
1.6 2002/02/25 20:57:08 morgand Exp $
  - * $Revision: 1.6 $
  - * $Date: 2002/02/25 20:57:08 $
  + * $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestObject.java,v
1.7 2002/02/26 00:08:07 morgand Exp $
  + * $Revision: 1.7 $
  + * $Date: 2002/02/26 00:08:07 $
    *
    * ====================================================================
    *
  @@ -90,7 +90,7 @@
    * test case (method) your {@link Object} fails.
    *
    * @author Rodney Waldhoff
  - * @version $Id: TestObject.java,v 1.6 2002/02/25 20:57:08 morgand Exp $
  + * @version $Id: TestObject.java,v 1.7 2002/02/26 00:08:07 morgand Exp $
    */
   public abstract class TestObject extends TestCase {
       public TestObject(String testName) {
  @@ -99,13 +99,22 @@
   
       // current major release for Collections
       public static final int COLLECTIONS_MAJOR_VERSION = 2;
  -    // This constant makes it possible for TestMap (and other subclasses, 
  -    // if necessary) to automatically check CVS for a versionX copy of a 
  -    // Serialized object, so we can make sure that compatibility is maintained.  
  -    // See, for example, TestMap.getCanonicalFullMapName(Map map).
  -    // Subclasses can override this variable, indicating compatibility
  -    // with earlier Collections versions.
  -    public int COMPATIBILITY_VERSION = COLLECTIONS_MAJOR_VERSION;
  +
  +    /**
  +     * This constant makes it possible for TestMap (and other subclasses,
  +     * if necessary) to automatically check CVS for a versionX copy of a
  +     * Serialized object, so we can make sure that compatibility is maintained.
  +     * See, for example, TestMap.getCanonicalFullMapName(Map map).
  +     * Subclasses can override this variable, indicating compatibility
  +     * with earlier Collections versions.
  +     * Defaults to 1, the earliest Collections version.  (Note: some
  +     * collections did not even exist in this version).
  +     * 
  +     * @return 1
  +     */
  +    public int getCompatibilityVersion() {
  +        return 1;
  +    }
   
       /**
        * Return a new, empty {@link Object} to used for testing.
  
  
  
  1.10      +6 -0      jakarta-commons/collections/src/test/org/apache/commons/collections/TestSequencedHashMap.java
  
  Index: TestSequencedHashMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestSequencedHashMap.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TestSequencedHashMap.java	22 Feb 2002 07:13:02 -0000	1.9
  +++ TestSequencedHashMap.java	26 Feb 2002 00:08:07 -0000	1.10
  @@ -91,6 +91,12 @@
           return new TestSuite(TestSequencedHashMap.class);
       }
   
  +    // current versions of SequencedHashMap and subclasses are not
  +    // compatible with Collections 1.x
  +    public int getCompatibilityVersion() {
  +        return 2;
  +    }
  +
       public static void main(String[] args[]) {
           String[] testCaseName = { TestSequencedHashMap.class.getName() };
           junit.textui.TestRunner.main(testCaseName);
  
  
  

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