Rename TestSet to AbstractTestSet
Rename TestSortedSet to AbstractTestSortedSet Javadoc and tidy git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/collections/trunk@131222 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
e476647953
commit
6318d9964c
|
@ -1,13 +1,10 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestSet.java,v 1.6 2003/10/02 22:14:29 scolebourne Exp $
|
||||
* $Revision: 1.6 $
|
||||
* $Date: 2003/10/02 22:14:29 $
|
||||
*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/AbstractTestSet.java,v 1.1 2003/10/02 22:48:41 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 1999-2001 The Apache Software Foundation. All rights
|
||||
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -36,7 +33,7 @@
|
|||
*
|
||||
* 5. Products derived from this software may not be called "Apache"
|
||||
* nor may "Apache" appear in their names without prior written
|
||||
* permission of the Apache Group.
|
||||
* permission of the Apache Software Foundation.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
|
@ -67,39 +64,42 @@ import java.util.Iterator;
|
|||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Tests base {@link Set} methods and contracts.<P>
|
||||
* Abstract test class for {@link Set} methods and contracts.
|
||||
* <p>
|
||||
* Since {@link Set} doesn't stipulate much new behavior that isn't already
|
||||
* found in {@link Collection}, this class basically just adds tests for
|
||||
* {@link Set#equals()} and {@link Set#hashCode()} along with an updated
|
||||
* {@link #verify()} that ensures elements do not appear more than once in the
|
||||
* set.
|
||||
* <p>
|
||||
* To use, subclass and override the {@link #makeEmptySet()}
|
||||
* method. You may have to override other protected methods if your
|
||||
* set is not modifiable, or if your set restricts what kinds of
|
||||
* elements may be added; see {@link TestCollection} for more details.
|
||||
*
|
||||
* Since {@link Set} doesn't stipulate much new behavior that isn't already
|
||||
* found in {@link Collection}, this class basically just adds tests for
|
||||
* {@link Set#equals()} and {@link Set#hashCode()} along with an updated
|
||||
* {@link #verify()} that ensures elements do not appear more than once in the
|
||||
* set.<P>
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.1 $ $Date: 2003/10/02 22:48:41 $
|
||||
*
|
||||
* To use, subclass and override the {@link #makeEmptySet()}
|
||||
* method. You may have to override other protected methods if your
|
||||
* set is not modifiable, or if your set restricts what kinds of
|
||||
* elements may be added; see {@link TestCollection} for more details.<P>
|
||||
*
|
||||
* @author Paul Jack
|
||||
* @version $Id: TestSet.java,v 1.6 2003/10/02 22:14:29 scolebourne Exp $
|
||||
* @author Paul Jack
|
||||
*/
|
||||
public abstract class TestSet extends AbstractTestCollection {
|
||||
public abstract class AbstractTestSet extends AbstractTestCollection {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* JUnit constructor.
|
||||
*
|
||||
* @param name name for test
|
||||
* @param name name for test
|
||||
*/
|
||||
public TestSet(String name) {
|
||||
public AbstractTestSet(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Provides additional verifications for sets.
|
||||
* Provides additional verifications for sets.
|
||||
*/
|
||||
protected void verify() {
|
||||
super.verify();
|
||||
|
||||
assertEquals("Sets should be equal", confirmed, collection);
|
||||
assertEquals("Sets should have equal hashCodes",
|
||||
confirmed.hashCode(), collection.hashCode());
|
||||
|
@ -113,18 +113,18 @@ public abstract class TestSet extends AbstractTestCollection {
|
|||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Returns an empty Set for use in modification testing.
|
||||
* Returns an empty Set for use in modification testing.
|
||||
*
|
||||
* @return a confirmed empty collection
|
||||
* @return a confirmed empty collection
|
||||
*/
|
||||
protected Collection makeConfirmedCollection() {
|
||||
return new HashSet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a full Set for use in modification testing.
|
||||
* Returns a full Set for use in modification testing.
|
||||
*
|
||||
* @return a confirmed full collection
|
||||
* @return a confirmed full collection
|
||||
*/
|
||||
protected Collection makeConfirmedFullCollection() {
|
||||
Collection set = makeConfirmedCollection();
|
||||
|
@ -133,19 +133,19 @@ public abstract class TestSet extends AbstractTestCollection {
|
|||
}
|
||||
|
||||
/**
|
||||
* Makes an empty set. The returned set should have no elements.
|
||||
* Makes an empty set. The returned set should have no elements.
|
||||
*
|
||||
* @return an empty set
|
||||
* @return an empty set
|
||||
*/
|
||||
protected abstract Set makeEmptySet();
|
||||
|
||||
/**
|
||||
* Makes a full set by first creating an empty set and then adding
|
||||
* all the elements returned by {@link #getFullElements()}.
|
||||
* Makes a full set by first creating an empty set and then adding
|
||||
* all the elements returned by {@link #getFullElements()}.
|
||||
*
|
||||
* Override if your set does not support the add operation.
|
||||
* Override if your set does not support the add operation.
|
||||
*
|
||||
* @return a full set
|
||||
* @return a full set
|
||||
*/
|
||||
protected Set makeFullSet() {
|
||||
Set set = makeEmptySet();
|
||||
|
@ -154,18 +154,18 @@ public abstract class TestSet extends AbstractTestCollection {
|
|||
}
|
||||
|
||||
/**
|
||||
* Makes an empty collection by invoking {@link #makeEmptySet()}.
|
||||
* Makes an empty collection by invoking {@link #makeEmptySet()}.
|
||||
*
|
||||
* @return an empty collection
|
||||
* @return an empty collection
|
||||
*/
|
||||
protected final Collection makeCollection() {
|
||||
return makeEmptySet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a full collection by invoking {@link #makeFullSet()}.
|
||||
* Makes a full collection by invoking {@link #makeFullSet()}.
|
||||
*
|
||||
* @return a full collection
|
||||
* @return a full collection
|
||||
*/
|
||||
protected final Collection makeFullCollection() {
|
||||
return makeFullSet();
|
||||
|
@ -173,24 +173,22 @@ public abstract class TestSet extends AbstractTestCollection {
|
|||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Return the {@link TestCollection#collection} fixture, but cast as a
|
||||
* Set.
|
||||
* Return the {@link TestCollection#collection} fixture, but cast as a Set.
|
||||
*/
|
||||
protected Set getSet() {
|
||||
return (Set)collection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the {@link TestCollection#confirmed} fixture, but cast as a
|
||||
* Set.
|
||||
**/
|
||||
* Return the {@link TestCollection#confirmed} fixture, but cast as a Set.
|
||||
*/
|
||||
protected Set getConfirmedSet() {
|
||||
return (Set)confirmed;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Tests {@link Set#equals(Object)}.
|
||||
* Tests {@link Set#equals(Object)}.
|
||||
*/
|
||||
public void testSetEquals() {
|
||||
resetEmpty();
|
||||
|
@ -213,9 +211,8 @@ public abstract class TestSet extends AbstractTestCollection {
|
|||
!getSet().equals(set2));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tests {@link Set#hashCode()}.
|
||||
* Tests {@link Set#hashCode()}.
|
||||
*/
|
||||
public void testSetHashCode() {
|
||||
resetEmpty();
|
||||
|
@ -227,5 +224,4 @@ public abstract class TestSet extends AbstractTestCollection {
|
|||
getSet().hashCode(), getConfirmedSet().hashCode());
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestSortedSet.java,v 1.3 2003/08/31 17:28:43 scolebourne Exp $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/AbstractTestSortedSet.java,v 1.1 2003/10/02 22:48:41 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
*
|
||||
* Copyright (c) 2003 The Apache Software Foundation. All rights
|
||||
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
|
||||
* reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -64,7 +64,7 @@ import java.util.SortedSet;
|
|||
import java.util.TreeSet;
|
||||
|
||||
/**
|
||||
* Tests base {@link SortedSet} methods and contracts.
|
||||
* Abstract test class for {@link SortedSet} methods and contracts.
|
||||
* <p>
|
||||
* To use, subclass and override the {@link #makeEmptySet()}
|
||||
* method. You may have to override other protected methods if your
|
||||
|
@ -72,19 +72,19 @@ import java.util.TreeSet;
|
|||
* elements may be added; see {@link TestCollection} for more details.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.3 $ $Date: 2003/08/31 17:28:43 $
|
||||
* @version $Revision: 1.1 $ $Date: 2003/10/02 22:48:41 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
* @author Dieter Wimberger
|
||||
*/
|
||||
public abstract class TestSortedSet extends TestSet {
|
||||
public abstract class AbstractTestSortedSet extends AbstractTestSet {
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* JUnit constructor.
|
||||
*
|
||||
* @param name name for test
|
||||
*/
|
||||
public TestSortedSet(String name) {
|
||||
public AbstractTestSortedSet(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
|
@ -95,6 +95,7 @@ public abstract class TestSortedSet extends TestSet {
|
|||
*/
|
||||
protected void verify() {
|
||||
super.verify();
|
||||
|
||||
//Sorted sets should return in-order iterators by contract
|
||||
Iterator colliter = collection.iterator();
|
||||
Iterator confiter = confirmed.iterator();
|
||||
|
@ -105,7 +106,7 @@ public abstract class TestSortedSet extends TestSet {
|
|||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Overridden because UnboundedFifoBuffer doesn't allow null elements.
|
||||
* Overridden because SortedSets don't allow null elements (normally).
|
||||
* @return false
|
||||
*/
|
||||
protected boolean isNullSupported() {
|
||||
|
@ -157,12 +158,12 @@ public abstract class TestSortedSet extends TestSet {
|
|||
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Bulk test {@link SortedSet#subSet(Object, Object)}. This method runs through all of
|
||||
* the tests in {@link TestSortedSet}.
|
||||
* After modification operations, {@link #verify()} is invoked to ensure
|
||||
* that the set and the other collection views are still valid.
|
||||
* Bulk test {@link SortedSet#subSet(Object, Object)}. This method runs through all of
|
||||
* the tests in {@link TestSortedSet}.
|
||||
* After modification operations, {@link #verify()} is invoked to ensure
|
||||
* that the set and the other collection views are still valid.
|
||||
*
|
||||
* @return a {@link TestSet} instance for testing a subset.
|
||||
* @return a {@link TestSet} instance for testing a subset.
|
||||
*/
|
||||
public BulkTest bulkTestSortedSetSubSet() {
|
||||
int length = getFullElements().length;
|
||||
|
@ -174,12 +175,12 @@ public abstract class TestSortedSet extends TestSet {
|
|||
}
|
||||
|
||||
/**
|
||||
* Bulk test {@link SortedSet#headSet(Object)}. This method runs through all of
|
||||
* the tests in {@link TestSortedSet}.
|
||||
* After modification operations, {@link #verify()} is invoked to ensure
|
||||
* that the set and the other collection views are still valid.
|
||||
* Bulk test {@link SortedSet#headSet(Object)}. This method runs through all of
|
||||
* the tests in {@link TestSortedSet}.
|
||||
* After modification operations, {@link #verify()} is invoked to ensure
|
||||
* that the set and the other collection views are still valid.
|
||||
*
|
||||
* @return a {@link TestSet} instance for testing a headset.
|
||||
* @return a {@link TestSet} instance for testing a headset.
|
||||
*/
|
||||
public BulkTest bulkTestSortedSetHeadSet() {
|
||||
int length = getFullElements().length;
|
||||
|
@ -191,12 +192,12 @@ public abstract class TestSortedSet extends TestSet {
|
|||
}
|
||||
|
||||
/**
|
||||
* Bulk test {@link SortedSet#tailSet(Object)}. This method runs through all of
|
||||
* the tests in {@link TestSortedSet}.
|
||||
* After modification operations, {@link #verify()} is invoked to ensure
|
||||
* that the set and the other collection views are still valid.
|
||||
* Bulk test {@link SortedSet#tailSet(Object)}. This method runs through all of
|
||||
* the tests in {@link TestSortedSet}.
|
||||
* After modification operations, {@link #verify()} is invoked to ensure
|
||||
* that the set and the other collection views are still valid.
|
||||
*
|
||||
* @return a {@link TestSet} instance for testing a tailset.
|
||||
* @return a {@link TestSet} instance for testing a tailset.
|
||||
*/
|
||||
public BulkTest bulkTestSortedSetTailSet() {
|
||||
int length = getFullElements().length;
|
||||
|
@ -204,7 +205,7 @@ public abstract class TestSortedSet extends TestSet {
|
|||
return new TestSortedSetSubSet(lobound, false);
|
||||
}
|
||||
|
||||
class TestSortedSetSubSet extends TestSortedSet {
|
||||
class TestSortedSetSubSet extends AbstractTestSortedSet {
|
||||
|
||||
private int m_Type;
|
||||
private int m_LowBound;
|
||||
|
@ -219,23 +220,23 @@ public abstract class TestSortedSet extends TestSet {
|
|||
m_Type = TYPE_HEADSET;
|
||||
m_HighBound = bound;
|
||||
m_FullElements = new Object[bound];
|
||||
System.arraycopy(TestSortedSet.this.getFullElements(), 0, m_FullElements, 0, bound);
|
||||
System.arraycopy(AbstractTestSortedSet.this.getFullElements(), 0, m_FullElements, 0, bound);
|
||||
m_OtherElements = new Object[bound - 1];
|
||||
System.arraycopy(//src src_pos dst dst_pos length
|
||||
TestSortedSet.this.getOtherElements(), 0, m_OtherElements, 0, bound - 1);
|
||||
AbstractTestSortedSet.this.getOtherElements(), 0, m_OtherElements, 0, bound - 1);
|
||||
//System.out.println(new TreeSet(Arrays.asList(m_FullElements)));
|
||||
//System.out.println(new TreeSet(Arrays.asList(m_OtherElements)));
|
||||
} else {
|
||||
//System.out.println("TAILSET");
|
||||
m_Type = TYPE_TAILSET;
|
||||
m_LowBound = bound;
|
||||
Object[] allelements = TestSortedSet.this.getFullElements();
|
||||
Object[] allelements = AbstractTestSortedSet.this.getFullElements();
|
||||
//System.out.println("bound = "+bound +"::length="+allelements.length);
|
||||
m_FullElements = new Object[allelements.length - bound];
|
||||
System.arraycopy(allelements, bound, m_FullElements, 0, allelements.length - bound);
|
||||
m_OtherElements = new Object[allelements.length - bound - 1];
|
||||
System.arraycopy(//src src_pos dst dst_pos length
|
||||
TestSortedSet.this.getOtherElements(), bound, m_OtherElements, 0, allelements.length - bound - 1);
|
||||
AbstractTestSortedSet.this.getOtherElements(), bound, m_OtherElements, 0, allelements.length - bound - 1);
|
||||
//System.out.println(new TreeSet(Arrays.asList(m_FullElements)));
|
||||
//System.out.println(new TreeSet(Arrays.asList(m_OtherElements)));
|
||||
//resetFull();
|
||||
|
@ -255,18 +256,18 @@ public abstract class TestSortedSet extends TestSet {
|
|||
int length = hibound - lobound;
|
||||
//System.out.println("Low=" + lobound + "::High=" + hibound + "::Length=" + length);
|
||||
m_FullElements = new Object[length];
|
||||
System.arraycopy(TestSortedSet.this.getFullElements(), lobound, m_FullElements, 0, length);
|
||||
System.arraycopy(AbstractTestSortedSet.this.getFullElements(), lobound, m_FullElements, 0, length);
|
||||
m_OtherElements = new Object[length - 1];
|
||||
System.arraycopy(//src src_pos dst dst_pos length
|
||||
TestSortedSet.this.getOtherElements(), lobound, m_OtherElements, 0, length - 1);
|
||||
AbstractTestSortedSet.this.getOtherElements(), lobound, m_OtherElements, 0, length - 1);
|
||||
|
||||
//System.out.println(new TreeSet(Arrays.asList(m_FullElements)));
|
||||
//System.out.println(new TreeSet(Arrays.asList(m_OtherElements)));
|
||||
|
||||
} //TestSortedSetSubSet
|
||||
|
||||
public boolean isNullSupported() {
|
||||
return TestSortedSet.this.isNullSupported();
|
||||
protected boolean isNullSupported() {
|
||||
return AbstractTestSortedSet.this.isNullSupported();
|
||||
} //useNullValue
|
||||
|
||||
protected Object[] getFullElements() {
|
||||
|
@ -279,7 +280,7 @@ public abstract class TestSortedSet extends TestSet {
|
|||
}
|
||||
|
||||
private SortedSet getSubSet(SortedSet set) {
|
||||
Object[] elements = TestSortedSet.this.getFullElements();
|
||||
Object[] elements = AbstractTestSortedSet.this.getFullElements();
|
||||
switch (m_Type) {
|
||||
case TYPE_SUBSET :
|
||||
return set.subSet(elements[m_LowBound], elements[m_HighBound]);
|
||||
|
@ -293,21 +294,21 @@ public abstract class TestSortedSet extends TestSet {
|
|||
} //getSubSet
|
||||
|
||||
protected Set makeEmptySet() {
|
||||
SortedSet s = (SortedSet) TestSortedSet.this.makeFullSet();
|
||||
SortedSet s = (SortedSet) AbstractTestSortedSet.this.makeFullSet();
|
||||
s = getSubSet(s);
|
||||
s.clear();
|
||||
return s;
|
||||
} //makeEmptySet
|
||||
|
||||
protected Set makeFullSet() {
|
||||
SortedSet s = (SortedSet) TestSortedSet.this.makeFullCollection();
|
||||
SortedSet s = (SortedSet) AbstractTestSortedSet.this.makeFullCollection();
|
||||
return getSubSet(s);
|
||||
} //makeFullSet
|
||||
|
||||
protected void resetFull() {
|
||||
TestSortedSet.this.resetFull();
|
||||
TestSortedSetSubSet.this.confirmed = getSubSet((SortedSet) TestSortedSet.this.confirmed);
|
||||
TestSortedSetSubSet.this.collection = getSubSet((SortedSet) TestSortedSet.this.collection);
|
||||
AbstractTestSortedSet.this.resetFull();
|
||||
TestSortedSetSubSet.this.confirmed = getSubSet((SortedSet) AbstractTestSortedSet.this.confirmed);
|
||||
TestSortedSetSubSet.this.collection = getSubSet((SortedSet) AbstractTestSortedSet.this.collection);
|
||||
}
|
||||
|
||||
protected void resetEmpty() {
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestMap.java,v 1.29 2003/10/02 22:14:28 scolebourne Exp $
|
||||
* $Revision: 1.29 $
|
||||
* $Date: 2003/10/02 22:14:28 $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/Attic/TestMap.java,v 1.30 2003/10/02 22:48:40 scolebourne Exp $
|
||||
* $Revision: 1.30 $
|
||||
* $Date: 2003/10/02 22:48:40 $
|
||||
*
|
||||
* ====================================================================
|
||||
*
|
||||
|
@ -152,7 +152,7 @@ import java.util.Set;
|
|||
* @author Michael Smith
|
||||
* @author Rodney Waldhoff
|
||||
* @author Paul Jack
|
||||
* @version $Revision: 1.29 $ $Date: 2003/10/02 22:14:28 $
|
||||
* @version $Revision: 1.30 $ $Date: 2003/10/02 22:48:40 $
|
||||
*/
|
||||
public abstract class TestMap extends AbstractTestObject {
|
||||
|
||||
|
@ -874,7 +874,7 @@ public abstract class TestMap extends AbstractTestObject {
|
|||
return new TestMapEntrySet();
|
||||
}
|
||||
|
||||
class TestMapEntrySet extends TestSet {
|
||||
class TestMapEntrySet extends AbstractTestSet {
|
||||
public TestMapEntrySet() {
|
||||
super("");
|
||||
}
|
||||
|
@ -942,7 +942,7 @@ public abstract class TestMap extends AbstractTestObject {
|
|||
return new TestMapKeySet();
|
||||
}
|
||||
|
||||
class TestMapKeySet extends TestSet {
|
||||
class TestMapKeySet extends AbstractTestSet {
|
||||
public TestMapKeySet() {
|
||||
super("");
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestSetUtils.java,v 1.9 2003/09/20 17:02:03 scolebourne Exp $
|
||||
* $Revision: 1.9 $
|
||||
* $Date: 2003/09/20 17:02:03 $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/TestSetUtils.java,v 1.10 2003/10/02 22:48:41 scolebourne Exp $
|
||||
* $Revision: 1.10 $
|
||||
* $Date: 2003/10/02 22:48:41 $
|
||||
*
|
||||
* ====================================================================
|
||||
*
|
||||
|
@ -122,7 +122,7 @@ public class TestSetUtils extends BulkTest {
|
|||
}
|
||||
|
||||
public BulkTest bulkTestAll() {
|
||||
return new TestSet("") {
|
||||
return new AbstractTestSet("") {
|
||||
public Set makeEmptySet() {
|
||||
return (Set)typedCollection();
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/decorators/Attic/TestOrderedSet.java,v 1.2 2003/09/20 16:57:47 scolebourne Exp $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/decorators/Attic/TestOrderedSet.java,v 1.3 2003/10/02 22:48:41 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
|
@ -66,19 +66,19 @@ import java.util.Set;
|
|||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.apache.commons.collections.TestSet;
|
||||
import org.apache.commons.collections.AbstractTestSet;
|
||||
|
||||
/**
|
||||
* Extension of {@link TestSet} for exercising the {@link OrderedSet}
|
||||
* implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.2 $ $Date: 2003/09/20 16:57:47 $
|
||||
* @version $Revision: 1.3 $ $Date: 2003/10/02 22:48:41 $
|
||||
*
|
||||
* @author Henning P. Schmiedehausen
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public class TestOrderedSet extends TestSet {
|
||||
public class TestOrderedSet extends AbstractTestSet {
|
||||
|
||||
public TestOrderedSet(String testName) {
|
||||
super(testName);
|
||||
|
@ -93,11 +93,11 @@ public class TestOrderedSet extends TestSet {
|
|||
junit.textui.TestRunner.main(testCaseName);
|
||||
}
|
||||
|
||||
public Set makeEmptySet() {
|
||||
protected Set makeEmptySet() {
|
||||
return OrderedSet.decorate(new HashSet());
|
||||
}
|
||||
|
||||
public Set setupSet() {
|
||||
protected Set setupSet() {
|
||||
Set set = makeEmptySet();
|
||||
|
||||
for (int i = 0; i < 10; i++) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/decorators/Attic/TestPredicatedSet.java,v 1.2 2003/09/20 17:05:36 scolebourne Exp $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/decorators/Attic/TestPredicatedSet.java,v 1.3 2003/10/02 22:48:41 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
|
@ -65,18 +65,18 @@ import junit.framework.TestSuite;
|
|||
|
||||
import org.apache.commons.collections.Predicate;
|
||||
import org.apache.commons.collections.PredicateUtils;
|
||||
import org.apache.commons.collections.TestSet;
|
||||
import org.apache.commons.collections.AbstractTestSet;
|
||||
|
||||
/**
|
||||
* Extension of {@link TestSet} for exercising the
|
||||
* {@link PredicatedSet} implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.2 $ $Date: 2003/09/20 17:05:36 $
|
||||
* @version $Revision: 1.3 $ $Date: 2003/10/02 22:48:41 $
|
||||
*
|
||||
* @author Phil Steitz
|
||||
*/
|
||||
public class TestPredicatedSet extends TestSet{
|
||||
public class TestPredicatedSet extends AbstractTestSet{
|
||||
|
||||
public TestPredicatedSet(String testName) {
|
||||
super(testName);
|
||||
|
@ -99,7 +99,7 @@ public class TestPredicatedSet extends TestSet{
|
|||
return PredicatedSet.decorate(set, predicate);
|
||||
}
|
||||
|
||||
public Set makeEmptySet() {
|
||||
protected Set makeEmptySet() {
|
||||
return decorateSet(new HashSet(), truePredicate);
|
||||
}
|
||||
|
||||
|
@ -109,14 +109,14 @@ public class TestPredicatedSet extends TestSet{
|
|||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
protected Predicate testPredicate =
|
||||
protected Predicate testPredicate =
|
||||
new Predicate() {
|
||||
public boolean evaluate(Object o) {
|
||||
return o instanceof String;
|
||||
}
|
||||
};
|
||||
|
||||
public Set makeTestSet() {
|
||||
protected Set makeTestSet() {
|
||||
return decorateSet(new HashSet(), testPredicate);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/decorators/Attic/TestTransformedSet.java,v 1.2 2003/08/31 17:28:42 scolebourne Exp $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/decorators/Attic/TestTransformedSet.java,v 1.3 2003/10/02 22:48:41 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
|
@ -65,18 +65,18 @@ import java.util.Set;
|
|||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.apache.commons.collections.TestSet;
|
||||
import org.apache.commons.collections.AbstractTestSet;
|
||||
|
||||
/**
|
||||
* Extension of {@link TestSet} for exercising the {@link TransformedSet}
|
||||
* implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.2 $ $Date: 2003/08/31 17:28:42 $
|
||||
* @version $Revision: 1.3 $ $Date: 2003/10/02 22:48:41 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public class TestTransformedSet extends TestSet {
|
||||
public class TestTransformedSet extends AbstractTestSet {
|
||||
|
||||
public TestTransformedSet(String testName) {
|
||||
super(testName);
|
||||
|
@ -91,7 +91,7 @@ public class TestTransformedSet extends TestSet {
|
|||
junit.textui.TestRunner.main(testCaseName);
|
||||
}
|
||||
|
||||
public Collection makeConfirmedCollection() {
|
||||
protected Collection makeConfirmedCollection() {
|
||||
return new HashSet();
|
||||
}
|
||||
|
||||
|
@ -101,7 +101,7 @@ public class TestTransformedSet extends TestSet {
|
|||
return set;
|
||||
}
|
||||
|
||||
public Set makeEmptySet() {
|
||||
protected Set makeEmptySet() {
|
||||
return TransformedSet.decorate(new HashSet(), TestTransformedCollection.NOOP_TRANSFORMER);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/decorators/Attic/TestTransformedSortedSet.java,v 1.3 2003/08/31 17:28:42 scolebourne Exp $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/decorators/Attic/TestTransformedSortedSet.java,v 1.4 2003/10/02 22:48:41 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
|
@ -65,18 +65,18 @@ import java.util.TreeSet;
|
|||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.apache.commons.collections.TestSortedSet;
|
||||
import org.apache.commons.collections.AbstractTestSortedSet;
|
||||
|
||||
/**
|
||||
* Extension of {@link TestSortedSet} for exercising the {@link TransformedSortedSet}
|
||||
* implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.3 $ $Date: 2003/08/31 17:28:42 $
|
||||
* @version $Revision: 1.4 $ $Date: 2003/10/02 22:48:41 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public class TestTransformedSortedSet extends TestSortedSet {
|
||||
public class TestTransformedSortedSet extends AbstractTestSortedSet {
|
||||
|
||||
public TestTransformedSortedSet(String testName) {
|
||||
super(testName);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableSet.java,v 1.1 2003/09/21 20:01:53 scolebourne Exp $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableSet.java,v 1.2 2003/10/02 22:48:40 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
|
@ -64,18 +64,18 @@ import java.util.Set;
|
|||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.apache.commons.collections.TestSet;
|
||||
import org.apache.commons.collections.AbstractTestSet;
|
||||
|
||||
/**
|
||||
* Extension of {@link TestSet} for exercising the
|
||||
* {@link ObservedSet} implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.1 $ $Date: 2003/09/21 20:01:53 $
|
||||
* @version $Revision: 1.2 $ $Date: 2003/10/02 22:48:40 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public class TestObservableSet extends TestSet implements ObservedTestHelper.ObservedFactory {
|
||||
public class TestObservableSet extends AbstractTestSet implements ObservedTestHelper.ObservedFactory {
|
||||
|
||||
public TestObservableSet(String testName) {
|
||||
super(testName);
|
||||
|
@ -91,7 +91,7 @@ public class TestObservableSet extends TestSet implements ObservedTestHelper.Obs
|
|||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
public Set makeEmptySet() {
|
||||
protected Set makeEmptySet() {
|
||||
return ObservableSet.decorate(new HashSet(), ObservedTestHelper.LISTENER);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableSortedSet.java,v 1.2 2003/09/24 08:23:56 scolebourne Exp $
|
||||
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//collections/src/test/org/apache/commons/collections/observed/Attic/TestObservableSortedSet.java,v 1.3 2003/10/02 22:48:40 scolebourne Exp $
|
||||
* ====================================================================
|
||||
*
|
||||
* The Apache Software License, Version 1.1
|
||||
|
@ -64,18 +64,18 @@ import java.util.TreeSet;
|
|||
import junit.framework.Test;
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
import org.apache.commons.collections.TestSortedSet;
|
||||
import org.apache.commons.collections.AbstractTestSortedSet;
|
||||
|
||||
/**
|
||||
* Extension of {@link TestSortedSet} for exercising the
|
||||
* {@link ObservedSortedSet} implementation.
|
||||
*
|
||||
* @since Commons Collections 3.0
|
||||
* @version $Revision: 1.2 $ $Date: 2003/09/24 08:23:56 $
|
||||
* @version $Revision: 1.3 $ $Date: 2003/10/02 22:48:40 $
|
||||
*
|
||||
* @author Stephen Colebourne
|
||||
*/
|
||||
public class TestObservableSortedSet extends TestSortedSet implements ObservedTestHelper.ObservedFactory {
|
||||
public class TestObservableSortedSet extends AbstractTestSortedSet implements ObservedTestHelper.ObservedFactory {
|
||||
|
||||
public TestObservableSortedSet(String testName) {
|
||||
super(testName);
|
||||
|
@ -91,7 +91,7 @@ public class TestObservableSortedSet extends TestSortedSet implements ObservedTe
|
|||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
public Set makeEmptySet() {
|
||||
protected Set makeEmptySet() {
|
||||
return ObservableSortedSet.decorate(new TreeSet(), ObservedTestHelper.LISTENER);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue