commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject cvs commit: jakarta-commons/math/src/test/org/apache/commons/math TestUtils.java
Date Thu, 17 Jun 2004 21:41:56 GMT
psteitz     2004/06/17 14:41:56

  Modified:    math/src/test/org/apache/commons/math TestUtils.java
  Log:
  Added method to verify that serialization / deserialization preserves equals and hashCode
(when this is supported).
  
  Revision  Changes    Path
  1.14      +12 -1     jakarta-commons/math/src/test/org/apache/commons/math/TestUtils.java
  
  Index: TestUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/math/src/test/org/apache/commons/math/TestUtils.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- TestUtils.java	5 May 2004 19:55:14 -0000	1.13
  +++ TestUtils.java	17 Jun 2004 21:41:56 -0000	1.14
  @@ -97,4 +97,15 @@
           
           return result;
       }
  +    
  +    /**
  +     * Verifies that serialization preserves equals and hashCode
  +     * 
  +     * @param object
  +     */
  +    public static void checkSerializedEquality(Object object) {
  +        Object object2 = serializeAndRecover(object);
  +        Assert.assertEquals("Equals check", object, object2);
  +        Assert.assertEquals("HashCode check", object.hashCode(), object2.hashCode());
  +    }
   }
  
  
  

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