From 192f96d50584a6c7733682783acb9f34641ee524 Mon Sep 17 00:00:00 2001 From: Morgan James Delagrange Date: Tue, 26 Feb 2002 20:52:17 +0000 Subject: [PATCH] if a collection is serializable, it should have a canonical version in CVS for compatibility testing git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@130608 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/collections/TestObject.java | 40 +++++++++++++++++-- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/src/test/org/apache/commons/collections/TestObject.java b/src/test/org/apache/commons/collections/TestObject.java index 0b1b7d887..e719d8ed1 100644 --- a/src/test/org/apache/commons/collections/TestObject.java +++ b/src/test/org/apache/commons/collections/TestObject.java @@ -1,7 +1,7 @@ /* - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestObject.java,v 1.8 2002/02/26 18:08:58 morgand Exp $ - * $Revision: 1.8 $ - * $Date: 2002/02/26 18:08:58 $ + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestObject.java,v 1.9 2002/02/26 20:52:17 morgand Exp $ + * $Revision: 1.9 $ + * $Date: 2002/02/26 20:52:17 $ * * ==================================================================== * @@ -65,6 +65,7 @@ import junit.framework.*; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; +import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStream; @@ -90,7 +91,7 @@ import java.util.NoSuchElementException; * test case (method) your {@link Object} fails. * * @author Rodney Waldhoff - * @version $Id: TestObject.java,v 1.8 2002/02/26 18:08:58 morgand Exp $ + * @version $Id: TestObject.java,v 1.9 2002/02/26 20:52:17 morgand Exp $ */ public abstract class TestObject extends TestCase { public TestObject(String testName) { @@ -259,4 +260,35 @@ public abstract class TestObject extends TestCase { retval.append(".obj"); return retval.toString(); } + + + /** + * If the test object is serializable, confirm that + * a canonical form exists in CVS + * + */ + public void testCanonicalEmptyCollectionExists() { + Object object = makeObject(); + if (!(object instanceof Serializable)) { + return; + } + String name = getCanonicalEmptyCollectionName(object); + assertTrue("Canonical empty collection is not in CVS", + new File(name).exists()); + } + + /** + * If the test object is serializable, confirm that + * a canonical form exists in CVS + * + */ + public void testCanonicalFullCollectionExists() { + Object object = makeObject(); + if (!(object instanceof Serializable)) { + return; + } + String name = getCanonicalFullCollectionName(object); + assertTrue("Canonical full collection is not in CVS", + new File(name).exists()); + } }