Fix tests for sub map views so BidiMap tests still work

git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131645 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Stephen Colebourne 2004-04-09 15:04:29 +00:00
parent d759d4214b
commit a32505290c
2 changed files with 16 additions and 16 deletions

View File

@ -117,7 +117,7 @@ import org.apache.commons.collections.set.AbstractTestSet;
* @author Rodney Waldhoff
* @author Paul Jack
* @author Stephen Colebourne
* @version $Revision: 1.11 $ $Date: 2004/04/09 14:45:38 $
* @version $Revision: 1.12 $ $Date: 2004/04/09 15:04:29 $
*/
public abstract class AbstractTestMap extends AbstractTestObject {
@ -227,6 +227,17 @@ public abstract class AbstractTestMap extends AbstractTestObject {
return false;
}
/**
* Returns whether the sub map views of SortedMap are serializable.
* If the class being tested is based around a TreeMap then you should
* override and return false as TreeMap has a bug in deserialization.
*
* @return false
*/
public boolean isSubMapViewsSerializable() {
return true;
}
/**
* Returns true if the maps produced by
* {@link #makeEmptyMap()} and {@link #makeFullMap()}

View File

@ -28,7 +28,7 @@ import org.apache.commons.collections.BulkTest;
/**
* Abstract test class for {@link java.util.SortedMap} methods and contracts.
*
* @version $Revision: 1.6 $ $Date: 2004/04/09 09:38:31 $
* @version $Revision: 1.7 $ $Date: 2004/04/09 15:04:29 $
*
* @author Stephen Colebourne
*/
@ -44,17 +44,6 @@ public abstract class AbstractTestSortedMap extends AbstractTestMap {
}
//-----------------------------------------------------------------------
/**
* Returns whether the sub map views are serializable.
* If the class being tested is based around a TreeMap then you should
* override and return false as TreeMap has a bug in deserialization.
*
* @return false
*/
public boolean isSubMapViewsSerializable() {
return true;
}
/**
* Can't sort null keys.
*
@ -173,15 +162,15 @@ public abstract class AbstractTestSortedMap extends AbstractTestMap {
return false;
}
public void testSerializeDeserializeThenCompare() throws Exception {
if (((AbstractTestSortedMap) main).isSubMapViewsSerializable() == false) return;
if (main.isSubMapViewsSerializable() == false) return;
super.testSerializeDeserializeThenCompare();
}
public void testEmptyMapCompatibility() throws Exception {
if (((AbstractTestSortedMap) main).isSubMapViewsSerializable() == false) return;
if (main.isSubMapViewsSerializable() == false) return;
super.testEmptyMapCompatibility();
}
public void testFullMapCompatibility() throws Exception {
if (((AbstractTestSortedMap) main).isSubMapViewsSerializable() == false) return;
if (main.isSubMapViewsSerializable() == false) return;
super.testFullMapCompatibility();
}
}