You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2003/10/03 00:48:41 UTC
cvs commit: jakarta-commons/collections/src/test/org/apache/commons/collections/decorators TestTransformedSortedSet.java TestOrderedSet.java TestPredicatedSet.java TestTransformedSet.java
scolebourne 2003/10/02 15:48:41
Modified: collections/src/test/org/apache/commons/collections/observed
TestObservableSet.java TestObservableSortedSet.java
collections/src/test/org/apache/commons/collections
TestMap.java TestSetUtils.java
collections/src/test/org/apache/commons/collections/decorators
TestTransformedSortedSet.java TestOrderedSet.java
TestPredicatedSet.java TestTransformedSet.java
Added: collections/src/test/org/apache/commons/collections
AbstractTestSet.java AbstractTestSortedSet.java
Removed: collections/src/test/org/apache/commons/collections
TestSortedSet.java TestSet.java
Log:
Rename TestSet to AbstractTestSet
Rename TestSortedSet to AbstractTestSortedSet
Javadoc and tidy
Revision Changes Path
1.2 +5 -5 jakarta-commons/collections/src/test/org/apache/commons/collections/observed/TestObservableSet.java
Index: TestObservableSet.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/observed/TestObservableSet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TestObservableSet.java 21 Sep 2003 20:01:53 -0000 1.1
+++ TestObservableSet.java 2 Oct 2003 22:48:40 -0000 1.2
@@ -64,7 +64,7 @@
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
@@ -75,7 +75,7 @@
*
* @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 Set makeEmptySet() {
+ protected Set makeEmptySet() {
return ObservableSet.decorate(new HashSet(), ObservedTestHelper.LISTENER);
}
1.3 +5 -5 jakarta-commons/collections/src/test/org/apache/commons/collections/observed/TestObservableSortedSet.java
Index: TestObservableSortedSet.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/observed/TestObservableSortedSet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestObservableSortedSet.java 24 Sep 2003 08:23:56 -0000 1.2
+++ TestObservableSortedSet.java 2 Oct 2003 22:48:40 -0000 1.3
@@ -64,7 +64,7 @@
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
@@ -75,7 +75,7 @@
*
* @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 Set makeEmptySet() {
+ protected Set makeEmptySet() {
return ObservableSortedSet.decorate(new TreeSet(), ObservedTestHelper.LISTENER);
}
1.30 +6 -6 jakarta-commons/collections/src/test/org/apache/commons/collections/TestMap.java
Index: TestMap.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestMap.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- TestMap.java 2 Oct 2003 22:14:28 -0000 1.29
+++ TestMap.java 2 Oct 2003 22:48:40 -0000 1.30
@@ -874,7 +874,7 @@
return new TestMapEntrySet();
}
- class TestMapEntrySet extends TestSet {
+ class TestMapEntrySet extends AbstractTestSet {
public TestMapEntrySet() {
super("");
}
@@ -942,7 +942,7 @@
return new TestMapKeySet();
}
- class TestMapKeySet extends TestSet {
+ class TestMapKeySet extends AbstractTestSet {
public TestMapKeySet() {
super("");
}
1.10 +4 -4 jakarta-commons/collections/src/test/org/apache/commons/collections/TestSetUtils.java
Index: TestSetUtils.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/TestSetUtils.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- TestSetUtils.java 20 Sep 2003 17:02:03 -0000 1.9
+++ TestSetUtils.java 2 Oct 2003 22:48:41 -0000 1.10
@@ -122,7 +122,7 @@
}
public BulkTest bulkTestAll() {
- return new TestSet("") {
+ return new AbstractTestSet("") {
public Set makeEmptySet() {
return (Set)typedCollection();
}
1.1 jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestSet.java
Index: AbstractTestSet.java
===================================================================
/*
* $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestSet.java,v 1.1 2003/10/02 22:48:41 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowledgement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 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 Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.commons.collections;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
/**
* 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 Commons Collections 3.0
* @version $Revision: 1.1 $ $Date: 2003/10/02 22:48:41 $
*
* @author Paul Jack
*/
public abstract class AbstractTestSet extends AbstractTestCollection {
/**
* JUnit constructor.
*
* @param name name for test
*/
public AbstractTestSet(String name) {
super(name);
}
//-----------------------------------------------------------------------
/**
* 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());
Collection set = makeConfirmedCollection();
Iterator iterator = collection.iterator();
while (iterator.hasNext()) {
assertTrue("Set.iterator should only return unique elements",
set.add(iterator.next()));
}
}
//-----------------------------------------------------------------------
/**
* Returns an empty Set for use in modification testing.
*
* @return a confirmed empty collection
*/
protected Collection makeConfirmedCollection() {
return new HashSet();
}
/**
* Returns a full Set for use in modification testing.
*
* @return a confirmed full collection
*/
protected Collection makeConfirmedFullCollection() {
Collection set = makeConfirmedCollection();
set.addAll(Arrays.asList(getFullElements()));
return set;
}
/**
* Makes an empty set. The returned set should have no elements.
*
* @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()}.
*
* Override if your set does not support the add operation.
*
* @return a full set
*/
protected Set makeFullSet() {
Set set = makeEmptySet();
set.addAll(Arrays.asList(getFullElements()));
return set;
}
/**
* Makes an empty collection by invoking {@link #makeEmptySet()}.
*
* @return an empty collection
*/
protected final Collection makeCollection() {
return makeEmptySet();
}
/**
* Makes a full collection by invoking {@link #makeFullSet()}.
*
* @return a full collection
*/
protected final Collection makeFullCollection() {
return makeFullSet();
}
//-----------------------------------------------------------------------
/**
* 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.
*/
protected Set getConfirmedSet() {
return (Set)confirmed;
}
//-----------------------------------------------------------------------
/**
* Tests {@link Set#equals(Object)}.
*/
public void testSetEquals() {
resetEmpty();
assertEquals("Empty sets should be equal",
getSet(), getConfirmedSet());
verify();
Collection set2 = makeConfirmedCollection();
set2.add("foo");
assertTrue("Empty set shouldn't equal nonempty set",
!getSet().equals(set2));
resetFull();
assertEquals("Full sets should be equal", getSet(), getConfirmedSet());
verify();
set2.clear();
set2.addAll(Arrays.asList(getOtherElements()));
assertTrue("Sets with different contents shouldn't be equal",
!getSet().equals(set2));
}
/**
* Tests {@link Set#hashCode()}.
*/
public void testSetHashCode() {
resetEmpty();
assertEquals("Empty sets have equal hashCodes",
getSet().hashCode(), getConfirmedSet().hashCode());
resetFull();
assertEquals("Equal sets have equal hashCodes",
getSet().hashCode(), getConfirmedSet().hashCode());
}
}
1.1 jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestSortedSet.java
Index: AbstractTestSortedSet.java
===================================================================
/*
* $Header: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/AbstractTestSortedSet.java,v 1.1 2003/10/02 22:48:41 scolebourne Exp $
* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowledgement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 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 Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.commons.collections;
import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
/**
* 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
* set is not modifiable, or if your set restricts what kinds of
* elements may be added; see {@link TestCollection} for more details.
*
* @since Commons Collections 3.0
* @version $Revision: 1.1 $ $Date: 2003/10/02 22:48:41 $
*
* @author Stephen Colebourne
* @author Dieter Wimberger
*/
public abstract class AbstractTestSortedSet extends AbstractTestSet {
/**
* JUnit constructor.
*
* @param name name for test
*/
public AbstractTestSortedSet(String name) {
super(name);
}
//-----------------------------------------------------------------------
/**
* Verification extension, will check the order of elements,
* the sets should already be verified equal.
*/
protected void verify() {
super.verify();
//Sorted sets should return in-order iterators by contract
Iterator colliter = collection.iterator();
Iterator confiter = confirmed.iterator();
while (colliter.hasNext()) {
assertEquals("Element appears to be out of order.", colliter.next(), confiter.next());
}
}
//-----------------------------------------------------------------------
/**
* Overridden because SortedSets don't allow null elements (normally).
* @return false
*/
protected boolean isNullSupported() {
return false;
}
//-----------------------------------------------------------------------
/**
* Returns an empty {@link TreeSet} for use in modification testing.
*
* @return a confirmed empty collection
*/
protected Collection makeConfirmedCollection() {
return new TreeSet();
}
//-----------------------------------------------------------------------
/**
* Return the {@link TestCollection#confirmed} fixture, but cast as a
* SortedSet.
*/
protected SortedSet getConfirmedSortedSet() {
return (SortedSet) confirmed;
}
//-----------------------------------------------------------------------
/**
* Override to return comparable objects.
*/
protected Object[] getFullNonNullElements() {
Object[] elements = new Object[30];
for (int i = 0; i < 30; i++) {
elements[i] = new Integer(i + i + 1);
}
return elements;
}
/**
* Override to return comparable objects.
*/
protected Object[] getOtherNonNullElements() {
Object[] elements = new Object[30];
for (int i = 0; i < 30; i++) {
elements[i] = new Integer(i + i + 2);
}
return elements;
}
//-----------------------------------------------------------------------
/**
* 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.
*/
public BulkTest bulkTestSortedSetSubSet() {
int length = getFullElements().length;
int lobound = length / 3;
int hibound = lobound * 2;
return new TestSortedSetSubSet(lobound, hibound);
}
/**
* 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.
*/
public BulkTest bulkTestSortedSetHeadSet() {
int length = getFullElements().length;
int lobound = length / 3;
int hibound = lobound * 2;
return new TestSortedSetSubSet(hibound, true);
}
/**
* 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.
*/
public BulkTest bulkTestSortedSetTailSet() {
int length = getFullElements().length;
int lobound = length / 3;
return new TestSortedSetSubSet(lobound, false);
}
class TestSortedSetSubSet extends AbstractTestSortedSet {
private int m_Type;
private int m_LowBound;
private int m_HighBound;
private Object[] m_FullElements;
private Object[] m_OtherElements;
public TestSortedSetSubSet(int bound, boolean head) {
super("TestSortedSetSubSet");
if (head) {
//System.out.println("HEADSET");
m_Type = TYPE_HEADSET;
m_HighBound = bound;
m_FullElements = new Object[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
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 = 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
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();
//System.out.println(collection);
//System.out.println(confirmed);
}
} //type
public TestSortedSetSubSet(int lobound, int hibound) {
super("TestSortedSetSubSet");
//System.out.println("SUBSET");
m_Type = TYPE_SUBSET;
m_LowBound = lobound;
m_HighBound = hibound;
int length = hibound - lobound;
//System.out.println("Low=" + lobound + "::High=" + hibound + "::Length=" + length);
m_FullElements = new Object[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
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
protected boolean isNullSupported() {
return AbstractTestSortedSet.this.isNullSupported();
} //useNullValue
protected Object[] getFullElements() {
//System.out.println("getFullElements()");
return m_FullElements;
}
protected Object[] getOtherElements() {
return m_OtherElements;
}
private SortedSet getSubSet(SortedSet set) {
Object[] elements = AbstractTestSortedSet.this.getFullElements();
switch (m_Type) {
case TYPE_SUBSET :
return set.subSet(elements[m_LowBound], elements[m_HighBound]);
case TYPE_HEADSET :
return set.headSet(elements[m_HighBound]);
case TYPE_TAILSET :
return set.tailSet(elements[m_LowBound]);
default :
return null;
}
} //getSubSet
protected Set makeEmptySet() {
SortedSet s = (SortedSet) AbstractTestSortedSet.this.makeFullSet();
s = getSubSet(s);
s.clear();
return s;
} //makeEmptySet
protected Set makeFullSet() {
SortedSet s = (SortedSet) AbstractTestSortedSet.this.makeFullCollection();
return getSubSet(s);
} //makeFullSet
protected void resetFull() {
AbstractTestSortedSet.this.resetFull();
TestSortedSetSubSet.this.confirmed = getSubSet((SortedSet) AbstractTestSortedSet.this.confirmed);
TestSortedSetSubSet.this.collection = getSubSet((SortedSet) AbstractTestSortedSet.this.collection);
}
protected void resetEmpty() {
TestSortedSetSubSet.this.resetFull();
TestSortedSetSubSet.this.confirmed.clear();
TestSortedSetSubSet.this.collection.clear();
}
public BulkTest bulkTestSortedSetSubSet() {
//Override returning null to prevent endless
//loop of bulk tests
return null;
} //bulkTestSortedSetSubSet
public BulkTest bulkTestSortedSetHeadSet() {
return null;
}
public BulkTest bulkTestSortedSetTailSet() {
return null;
}
static final int TYPE_SUBSET = 0;
static final int TYPE_TAILSET = 1;
static final int TYPE_HEADSET = 2;
}
}
1.4 +4 -4 jakarta-commons/collections/src/test/org/apache/commons/collections/decorators/TestTransformedSortedSet.java
Index: TestTransformedSortedSet.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/decorators/TestTransformedSortedSet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TestTransformedSortedSet.java 31 Aug 2003 17:28:42 -0000 1.3
+++ TestTransformedSortedSet.java 2 Oct 2003 22:48:41 -0000 1.4
@@ -65,7 +65,7 @@
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}
@@ -76,7 +76,7 @@
*
* @author Stephen Colebourne
*/
-public class TestTransformedSortedSet extends TestSortedSet {
+public class TestTransformedSortedSet extends AbstractTestSortedSet {
public TestTransformedSortedSet(String testName) {
super(testName);
1.3 +6 -6 jakarta-commons/collections/src/test/org/apache/commons/collections/decorators/TestOrderedSet.java
Index: TestOrderedSet.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/decorators/TestOrderedSet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestOrderedSet.java 20 Sep 2003 16:57:47 -0000 1.2
+++ TestOrderedSet.java 2 Oct 2003 22:48:41 -0000 1.3
@@ -66,7 +66,7 @@
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}
@@ -78,7 +78,7 @@
* @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 @@
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.3 +7 -7 jakarta-commons/collections/src/test/org/apache/commons/collections/decorators/TestPredicatedSet.java
Index: TestPredicatedSet.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/decorators/TestPredicatedSet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestPredicatedSet.java 20 Sep 2003 17:05:36 -0000 1.2
+++ TestPredicatedSet.java 2 Oct 2003 22:48:41 -0000 1.3
@@ -65,7 +65,7 @@
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
@@ -76,7 +76,7 @@
*
* @author Phil Steitz
*/
-public class TestPredicatedSet extends TestSet{
+public class TestPredicatedSet extends AbstractTestSet{
public TestPredicatedSet(String testName) {
super(testName);
@@ -99,7 +99,7 @@
return PredicatedSet.decorate(set, predicate);
}
- public Set makeEmptySet() {
+ protected Set makeEmptySet() {
return decorateSet(new HashSet(), truePredicate);
}
@@ -109,14 +109,14 @@
//--------------------------------------------------------------------
- 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.3 +6 -6 jakarta-commons/collections/src/test/org/apache/commons/collections/decorators/TestTransformedSet.java
Index: TestTransformedSet.java
===================================================================
RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/decorators/TestTransformedSet.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestTransformedSet.java 31 Aug 2003 17:28:42 -0000 1.2
+++ TestTransformedSet.java 2 Oct 2003 22:48:41 -0000 1.3
@@ -65,7 +65,7 @@
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}
@@ -76,7 +76,7 @@
*
* @author Stephen Colebourne
*/
-public class TestTransformedSet extends TestSet {
+public class TestTransformedSet extends AbstractTestSet {
public TestTransformedSet(String testName) {
super(testName);
@@ -91,7 +91,7 @@
junit.textui.TestRunner.main(testCaseName);
}
- public Collection makeConfirmedCollection() {
+ protected Collection makeConfirmedCollection() {
return new HashSet();
}
@@ -101,7 +101,7 @@
return set;
}
- public Set makeEmptySet() {
+ protected Set makeEmptySet() {
return TransformedSet.decorate(new HashSet(), TestTransformedCollection.NOOP_TRANSFORMER);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org