Improve serialization tests
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131421 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9e9b4858b1
commit
c784488a2c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/list/AbstractTestList.java,v 1.2 2003/11/18 22:37:14 scolebourne Exp $
|
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/list/AbstractTestList.java,v 1.3 2003/12/11 00:16:02 scolebourne Exp $
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* The Apache Software License, Version 1.1
|
||||||
|
@ -86,7 +86,7 @@ import org.apache.commons.collections.collection.AbstractTestCollection;
|
||||||
* test case (method) your {@link List} fails or override one of the
|
* test case (method) your {@link List} fails or override one of the
|
||||||
* protected methods from AbstractTestCollection.
|
* protected methods from AbstractTestCollection.
|
||||||
*
|
*
|
||||||
* @version $Revision: 1.2 $ $Date: 2003/11/18 22:37:14 $
|
* @version $Revision: 1.3 $ $Date: 2003/12/11 00:16:02 $
|
||||||
*
|
*
|
||||||
* @author Rodney Waldhoff
|
* @author Rodney Waldhoff
|
||||||
* @author Paul Jack
|
* @author Paul Jack
|
||||||
|
@ -987,6 +987,7 @@ public abstract class AbstractTestList extends AbstractTestCollection {
|
||||||
if(list instanceof Serializable && !skipSerializedCanonicalTests()) {
|
if(list instanceof Serializable && !skipSerializedCanonicalTests()) {
|
||||||
List list2 = (List) readExternalFormFromDisk(getCanonicalEmptyCollectionName(list));
|
List list2 = (List) readExternalFormFromDisk(getCanonicalEmptyCollectionName(list));
|
||||||
assertTrue("List is empty",list2.size() == 0);
|
assertTrue("List is empty",list2.size() == 0);
|
||||||
|
assertEquals(list, list2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1007,7 +1008,12 @@ public abstract class AbstractTestList extends AbstractTestCollection {
|
||||||
List list = makeFullList();
|
List list = makeFullList();
|
||||||
if(list instanceof Serializable && !skipSerializedCanonicalTests()) {
|
if(list instanceof Serializable && !skipSerializedCanonicalTests()) {
|
||||||
List list2 = (List) readExternalFormFromDisk(getCanonicalFullCollectionName(list));
|
List list2 = (List) readExternalFormFromDisk(getCanonicalFullCollectionName(list));
|
||||||
assertEquals("List is the right size",list2.size(), 4);
|
if (list2.size() == 4) {
|
||||||
|
// old serialized tests
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
assertEquals("List is the right size",list.size(), list2.size());
|
||||||
|
assertEquals(list, list2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue