commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/collections/src/test/org/apache/commons/collections/collection AbstractTestCollection.java
Date Tue, 01 Jun 2004 22:55:14 GMT
scolebourne    2004/06/01 15:55:14

  Modified:    collections/src/test/org/apache/commons/collections
                        AbstractTestObject.java
               collections/src/test/org/apache/commons/collections/collection
                        AbstractTestCollection.java
  Log:
  Add isEqualsCheckable and fix testSerializeDeserializeThenCompare in AbstractTestObject
  
  Revision  Changes    Path
  1.7       +12 -2     jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestObject.java
  
  Index: AbstractTestObject.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestObject.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AbstractTestObject.java	31 May 2004 22:39:20 -0000	1.6
  +++ AbstractTestObject.java	1 Jun 2004 22:55:14 -0000	1.7
  @@ -95,6 +95,14 @@
           return true;
       }
   
  +    /**
  +     * Returns true to indicate that the collection supports equals() comparisons.
  +     * This implementation returns true;
  +     */
  +    public boolean isEqualsCheckable() {
  +        return true;
  +    }
  +
       //-----------------------------------------------------------------------
       public void testObjectEqualsSelf() {
           Object obj = makeObject();
  @@ -140,7 +148,9 @@
               ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(buffer.toByteArray()));
               Object dest = in.readObject();
               in.close();
  -            assertEquals("obj != deserialize(serialize(obj))", obj, dest);
  +            if (isEqualsCheckable()) {
  +                assertEquals("obj != deserialize(serialize(obj))", obj, dest);
  +            }
           }
       }
   
  
  
  
  1.8       +2 -2      jakarta-commons/collections/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java
  
  Index: AbstractTestCollection.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/collection/AbstractTestCollection.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- AbstractTestCollection.java	31 May 2004 22:39:20 -0000	1.7
  +++ AbstractTestCollection.java	1 Jun 2004 22:55:14 -0000	1.8
  @@ -230,7 +230,7 @@
   
       /**
        * Returns true to indicate that the collection supports equals() comparisons.
  -     * The default implementation returns false;
  +     * This implementation returns false;
        */
       public boolean isEqualsCheckable() {
           return false;
  
  
  

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