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 $
|
* $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 $
|
||||||
* $Revision: 1.6 $
|
|
||||||
* $Date: 2003/10/02 22:14:29 $
|
|
||||||
*
|
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
* The Apache Software License, Version 1.1
|
* 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.
|
* reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* 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"
|
* 5. Products derived from this software may not be called "Apache"
|
||||||
* nor may "Apache" appear in their names without prior written
|
* 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
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
|
@ -67,30 +64,32 @@ import java.util.Iterator;
|
||||||
import java.util.Set;
|
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
|
* Since {@link Set} doesn't stipulate much new behavior that isn't already
|
||||||
* found in {@link Collection}, this class basically just adds tests for
|
* found in {@link Collection}, this class basically just adds tests for
|
||||||
* {@link Set#equals()} and {@link Set#hashCode()} along with an updated
|
* {@link Set#equals()} and {@link Set#hashCode()} along with an updated
|
||||||
* {@link #verify()} that ensures elements do not appear more than once in the
|
* {@link #verify()} that ensures elements do not appear more than once in the
|
||||||
* set.<P>
|
* set.
|
||||||
*
|
* <p>
|
||||||
* To use, subclass and override the {@link #makeEmptySet()}
|
* To use, subclass and override the {@link #makeEmptySet()}
|
||||||
* method. You may have to override other protected methods if your
|
* method. You may have to override other protected methods if your
|
||||||
* set is not modifiable, or if your set restricts what kinds of
|
* set is not modifiable, or if your set restricts what kinds of
|
||||||
* elements may be added; see {@link TestCollection} for more details.<P>
|
* 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
|
* @author Paul Jack
|
||||||
* @version $Id: TestSet.java,v 1.6 2003/10/02 22:14:29 scolebourne Exp $
|
|
||||||
*/
|
*/
|
||||||
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);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,6 +99,7 @@ public abstract class TestSet extends AbstractTestCollection {
|
||||||
*/
|
*/
|
||||||
protected void verify() {
|
protected void verify() {
|
||||||
super.verify();
|
super.verify();
|
||||||
|
|
||||||
assertEquals("Sets should be equal", confirmed, collection);
|
assertEquals("Sets should be equal", confirmed, collection);
|
||||||
assertEquals("Sets should have equal hashCodes",
|
assertEquals("Sets should have equal hashCodes",
|
||||||
confirmed.hashCode(), collection.hashCode());
|
confirmed.hashCode(), collection.hashCode());
|
||||||
|
@ -173,17 +173,15 @@ public abstract class TestSet extends AbstractTestCollection {
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* Return the {@link TestCollection#collection} fixture, but cast as a
|
* Return the {@link TestCollection#collection} fixture, but cast as a Set.
|
||||||
* Set.
|
|
||||||
*/
|
*/
|
||||||
protected Set getSet() {
|
protected Set getSet() {
|
||||||
return (Set)collection;
|
return (Set)collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the {@link TestCollection#confirmed} fixture, but cast as a
|
* Return the {@link TestCollection#confirmed} fixture, but cast as a Set.
|
||||||
* Set.
|
*/
|
||||||
**/
|
|
||||||
protected Set getConfirmedSet() {
|
protected Set getConfirmedSet() {
|
||||||
return (Set)confirmed;
|
return (Set)confirmed;
|
||||||
}
|
}
|
||||||
|
@ -213,7 +211,6 @@ public abstract class TestSet extends AbstractTestCollection {
|
||||||
!getSet().equals(set2));
|
!getSet().equals(set2));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests {@link Set#hashCode()}.
|
* Tests {@link Set#hashCode()}.
|
||||||
*/
|
*/
|
||||||
|
@ -227,5 +224,4 @@ public abstract class TestSet extends AbstractTestCollection {
|
||||||
getSet().hashCode(), getConfirmedSet().hashCode());
|
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
|
* 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.
|
* reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
@ -64,7 +64,7 @@ import java.util.SortedSet;
|
||||||
import java.util.TreeSet;
|
import java.util.TreeSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests base {@link SortedSet} methods and contracts.
|
* Abstract test class for {@link SortedSet} methods and contracts.
|
||||||
* <p>
|
* <p>
|
||||||
* To use, subclass and override the {@link #makeEmptySet()}
|
* To use, subclass and override the {@link #makeEmptySet()}
|
||||||
* method. You may have to override other protected methods if your
|
* 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.
|
* elements may be added; see {@link TestCollection} for more details.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @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 Stephen Colebourne
|
||||||
* @author Dieter Wimberger
|
* @author Dieter Wimberger
|
||||||
*/
|
*/
|
||||||
public abstract class TestSortedSet extends TestSet {
|
public abstract class AbstractTestSortedSet extends AbstractTestSet {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* JUnit constructor.
|
||||||
*
|
*
|
||||||
* @param name name for test
|
* @param name name for test
|
||||||
*/
|
*/
|
||||||
public TestSortedSet(String name) {
|
public AbstractTestSortedSet(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +95,7 @@ public abstract class TestSortedSet extends TestSet {
|
||||||
*/
|
*/
|
||||||
protected void verify() {
|
protected void verify() {
|
||||||
super.verify();
|
super.verify();
|
||||||
|
|
||||||
//Sorted sets should return in-order iterators by contract
|
//Sorted sets should return in-order iterators by contract
|
||||||
Iterator colliter = collection.iterator();
|
Iterator colliter = collection.iterator();
|
||||||
Iterator confiter = confirmed.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
|
* @return false
|
||||||
*/
|
*/
|
||||||
protected boolean isNullSupported() {
|
protected boolean isNullSupported() {
|
||||||
|
@ -204,7 +205,7 @@ public abstract class TestSortedSet extends TestSet {
|
||||||
return new TestSortedSetSubSet(lobound, false);
|
return new TestSortedSetSubSet(lobound, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
class TestSortedSetSubSet extends TestSortedSet {
|
class TestSortedSetSubSet extends AbstractTestSortedSet {
|
||||||
|
|
||||||
private int m_Type;
|
private int m_Type;
|
||||||
private int m_LowBound;
|
private int m_LowBound;
|
||||||
|
@ -219,23 +220,23 @@ public abstract class TestSortedSet extends TestSet {
|
||||||
m_Type = TYPE_HEADSET;
|
m_Type = TYPE_HEADSET;
|
||||||
m_HighBound = bound;
|
m_HighBound = bound;
|
||||||
m_FullElements = new Object[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];
|
m_OtherElements = new Object[bound - 1];
|
||||||
System.arraycopy(//src src_pos dst dst_pos length
|
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_FullElements)));
|
||||||
//System.out.println(new TreeSet(Arrays.asList(m_OtherElements)));
|
//System.out.println(new TreeSet(Arrays.asList(m_OtherElements)));
|
||||||
} else {
|
} else {
|
||||||
//System.out.println("TAILSET");
|
//System.out.println("TAILSET");
|
||||||
m_Type = TYPE_TAILSET;
|
m_Type = TYPE_TAILSET;
|
||||||
m_LowBound = bound;
|
m_LowBound = bound;
|
||||||
Object[] allelements = TestSortedSet.this.getFullElements();
|
Object[] allelements = AbstractTestSortedSet.this.getFullElements();
|
||||||
//System.out.println("bound = "+bound +"::length="+allelements.length);
|
//System.out.println("bound = "+bound +"::length="+allelements.length);
|
||||||
m_FullElements = new Object[allelements.length - bound];
|
m_FullElements = new Object[allelements.length - bound];
|
||||||
System.arraycopy(allelements, bound, m_FullElements, 0, allelements.length - bound);
|
System.arraycopy(allelements, bound, m_FullElements, 0, allelements.length - bound);
|
||||||
m_OtherElements = new Object[allelements.length - bound - 1];
|
m_OtherElements = new Object[allelements.length - bound - 1];
|
||||||
System.arraycopy(//src src_pos dst dst_pos length
|
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_FullElements)));
|
||||||
//System.out.println(new TreeSet(Arrays.asList(m_OtherElements)));
|
//System.out.println(new TreeSet(Arrays.asList(m_OtherElements)));
|
||||||
//resetFull();
|
//resetFull();
|
||||||
|
@ -255,18 +256,18 @@ public abstract class TestSortedSet extends TestSet {
|
||||||
int length = hibound - lobound;
|
int length = hibound - lobound;
|
||||||
//System.out.println("Low=" + lobound + "::High=" + hibound + "::Length=" + length);
|
//System.out.println("Low=" + lobound + "::High=" + hibound + "::Length=" + length);
|
||||||
m_FullElements = new Object[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];
|
m_OtherElements = new Object[length - 1];
|
||||||
System.arraycopy(//src src_pos dst dst_pos length
|
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_FullElements)));
|
||||||
//System.out.println(new TreeSet(Arrays.asList(m_OtherElements)));
|
//System.out.println(new TreeSet(Arrays.asList(m_OtherElements)));
|
||||||
|
|
||||||
} //TestSortedSetSubSet
|
} //TestSortedSetSubSet
|
||||||
|
|
||||||
public boolean isNullSupported() {
|
protected boolean isNullSupported() {
|
||||||
return TestSortedSet.this.isNullSupported();
|
return AbstractTestSortedSet.this.isNullSupported();
|
||||||
} //useNullValue
|
} //useNullValue
|
||||||
|
|
||||||
protected Object[] getFullElements() {
|
protected Object[] getFullElements() {
|
||||||
|
@ -279,7 +280,7 @@ public abstract class TestSortedSet extends TestSet {
|
||||||
}
|
}
|
||||||
|
|
||||||
private SortedSet getSubSet(SortedSet set) {
|
private SortedSet getSubSet(SortedSet set) {
|
||||||
Object[] elements = TestSortedSet.this.getFullElements();
|
Object[] elements = AbstractTestSortedSet.this.getFullElements();
|
||||||
switch (m_Type) {
|
switch (m_Type) {
|
||||||
case TYPE_SUBSET :
|
case TYPE_SUBSET :
|
||||||
return set.subSet(elements[m_LowBound], elements[m_HighBound]);
|
return set.subSet(elements[m_LowBound], elements[m_HighBound]);
|
||||||
|
@ -293,21 +294,21 @@ public abstract class TestSortedSet extends TestSet {
|
||||||
} //getSubSet
|
} //getSubSet
|
||||||
|
|
||||||
protected Set makeEmptySet() {
|
protected Set makeEmptySet() {
|
||||||
SortedSet s = (SortedSet) TestSortedSet.this.makeFullSet();
|
SortedSet s = (SortedSet) AbstractTestSortedSet.this.makeFullSet();
|
||||||
s = getSubSet(s);
|
s = getSubSet(s);
|
||||||
s.clear();
|
s.clear();
|
||||||
return s;
|
return s;
|
||||||
} //makeEmptySet
|
} //makeEmptySet
|
||||||
|
|
||||||
protected Set makeFullSet() {
|
protected Set makeFullSet() {
|
||||||
SortedSet s = (SortedSet) TestSortedSet.this.makeFullCollection();
|
SortedSet s = (SortedSet) AbstractTestSortedSet.this.makeFullCollection();
|
||||||
return getSubSet(s);
|
return getSubSet(s);
|
||||||
} //makeFullSet
|
} //makeFullSet
|
||||||
|
|
||||||
protected void resetFull() {
|
protected void resetFull() {
|
||||||
TestSortedSet.this.resetFull();
|
AbstractTestSortedSet.this.resetFull();
|
||||||
TestSortedSetSubSet.this.confirmed = getSubSet((SortedSet) TestSortedSet.this.confirmed);
|
TestSortedSetSubSet.this.confirmed = getSubSet((SortedSet) AbstractTestSortedSet.this.confirmed);
|
||||||
TestSortedSetSubSet.this.collection = getSubSet((SortedSet) TestSortedSet.this.collection);
|
TestSortedSetSubSet.this.collection = getSubSet((SortedSet) AbstractTestSortedSet.this.collection);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void resetEmpty() {
|
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 $
|
* $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.29 $
|
* $Revision: 1.30 $
|
||||||
* $Date: 2003/10/02 22:14:28 $
|
* $Date: 2003/10/02 22:48:40 $
|
||||||
*
|
*
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
|
@ -152,7 +152,7 @@ import java.util.Set;
|
||||||
* @author Michael Smith
|
* @author Michael Smith
|
||||||
* @author Rodney Waldhoff
|
* @author Rodney Waldhoff
|
||||||
* @author Paul Jack
|
* @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 {
|
public abstract class TestMap extends AbstractTestObject {
|
||||||
|
|
||||||
|
@ -874,7 +874,7 @@ public abstract class TestMap extends AbstractTestObject {
|
||||||
return new TestMapEntrySet();
|
return new TestMapEntrySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
class TestMapEntrySet extends TestSet {
|
class TestMapEntrySet extends AbstractTestSet {
|
||||||
public TestMapEntrySet() {
|
public TestMapEntrySet() {
|
||||||
super("");
|
super("");
|
||||||
}
|
}
|
||||||
|
@ -942,7 +942,7 @@ public abstract class TestMap extends AbstractTestObject {
|
||||||
return new TestMapKeySet();
|
return new TestMapKeySet();
|
||||||
}
|
}
|
||||||
|
|
||||||
class TestMapKeySet extends TestSet {
|
class TestMapKeySet extends AbstractTestSet {
|
||||||
public TestMapKeySet() {
|
public TestMapKeySet() {
|
||||||
super("");
|
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 $
|
* $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.9 $
|
* $Revision: 1.10 $
|
||||||
* $Date: 2003/09/20 17:02:03 $
|
* $Date: 2003/10/02 22:48:41 $
|
||||||
*
|
*
|
||||||
* ====================================================================
|
* ====================================================================
|
||||||
*
|
*
|
||||||
|
@ -122,7 +122,7 @@ public class TestSetUtils extends BulkTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
public BulkTest bulkTestAll() {
|
public BulkTest bulkTestAll() {
|
||||||
return new TestSet("") {
|
return new AbstractTestSet("") {
|
||||||
public Set makeEmptySet() {
|
public Set makeEmptySet() {
|
||||||
return (Set)typedCollection();
|
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
|
* The Apache Software License, Version 1.1
|
||||||
|
@ -66,19 +66,19 @@ import java.util.Set;
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import junit.framework.TestSuite;
|
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}
|
* Extension of {@link TestSet} for exercising the {@link OrderedSet}
|
||||||
* implementation.
|
* implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @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 Henning P. Schmiedehausen
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public class TestOrderedSet extends TestSet {
|
public class TestOrderedSet extends AbstractTestSet {
|
||||||
|
|
||||||
public TestOrderedSet(String testName) {
|
public TestOrderedSet(String testName) {
|
||||||
super(testName);
|
super(testName);
|
||||||
|
@ -93,11 +93,11 @@ public class TestOrderedSet extends TestSet {
|
||||||
junit.textui.TestRunner.main(testCaseName);
|
junit.textui.TestRunner.main(testCaseName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set makeEmptySet() {
|
protected Set makeEmptySet() {
|
||||||
return OrderedSet.decorate(new HashSet());
|
return OrderedSet.decorate(new HashSet());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set setupSet() {
|
protected Set setupSet() {
|
||||||
Set set = makeEmptySet();
|
Set set = makeEmptySet();
|
||||||
|
|
||||||
for (int i = 0; i < 10; i++) {
|
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
|
* 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.Predicate;
|
||||||
import org.apache.commons.collections.PredicateUtils;
|
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
|
* Extension of {@link TestSet} for exercising the
|
||||||
* {@link PredicatedSet} implementation.
|
* {@link PredicatedSet} implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @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
|
* @author Phil Steitz
|
||||||
*/
|
*/
|
||||||
public class TestPredicatedSet extends TestSet{
|
public class TestPredicatedSet extends AbstractTestSet{
|
||||||
|
|
||||||
public TestPredicatedSet(String testName) {
|
public TestPredicatedSet(String testName) {
|
||||||
super(testName);
|
super(testName);
|
||||||
|
@ -99,7 +99,7 @@ public class TestPredicatedSet extends TestSet{
|
||||||
return PredicatedSet.decorate(set, predicate);
|
return PredicatedSet.decorate(set, predicate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set makeEmptySet() {
|
protected Set makeEmptySet() {
|
||||||
return decorateSet(new HashSet(), truePredicate);
|
return decorateSet(new HashSet(), truePredicate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ public class TestPredicatedSet extends TestSet{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
public Set makeTestSet() {
|
protected Set makeTestSet() {
|
||||||
return decorateSet(new HashSet(), testPredicate);
|
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
|
* The Apache Software License, Version 1.1
|
||||||
|
@ -65,18 +65,18 @@ import java.util.Set;
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import junit.framework.TestSuite;
|
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}
|
* Extension of {@link TestSet} for exercising the {@link TransformedSet}
|
||||||
* implementation.
|
* implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @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
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public class TestTransformedSet extends TestSet {
|
public class TestTransformedSet extends AbstractTestSet {
|
||||||
|
|
||||||
public TestTransformedSet(String testName) {
|
public TestTransformedSet(String testName) {
|
||||||
super(testName);
|
super(testName);
|
||||||
|
@ -91,7 +91,7 @@ public class TestTransformedSet extends TestSet {
|
||||||
junit.textui.TestRunner.main(testCaseName);
|
junit.textui.TestRunner.main(testCaseName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection makeConfirmedCollection() {
|
protected Collection makeConfirmedCollection() {
|
||||||
return new HashSet();
|
return new HashSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public class TestTransformedSet extends TestSet {
|
||||||
return set;
|
return set;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set makeEmptySet() {
|
protected Set makeEmptySet() {
|
||||||
return TransformedSet.decorate(new HashSet(), TestTransformedCollection.NOOP_TRANSFORMER);
|
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
|
* The Apache Software License, Version 1.1
|
||||||
|
@ -65,18 +65,18 @@ import java.util.TreeSet;
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import junit.framework.TestSuite;
|
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}
|
* Extension of {@link TestSortedSet} for exercising the {@link TransformedSortedSet}
|
||||||
* implementation.
|
* implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @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
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public class TestTransformedSortedSet extends TestSortedSet {
|
public class TestTransformedSortedSet extends AbstractTestSortedSet {
|
||||||
|
|
||||||
public TestTransformedSortedSet(String testName) {
|
public TestTransformedSortedSet(String testName) {
|
||||||
super(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
|
* The Apache Software License, Version 1.1
|
||||||
|
@ -64,18 +64,18 @@ import java.util.Set;
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
import org.apache.commons.collections.TestSet;
|
import org.apache.commons.collections.AbstractTestSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extension of {@link TestSet} for exercising the
|
* Extension of {@link TestSet} for exercising the
|
||||||
* {@link ObservedSet} implementation.
|
* {@link ObservedSet} implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @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
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public class TestObservableSet extends TestSet implements ObservedTestHelper.ObservedFactory {
|
public class TestObservableSet extends AbstractTestSet implements ObservedTestHelper.ObservedFactory {
|
||||||
|
|
||||||
public TestObservableSet(String testName) {
|
public TestObservableSet(String testName) {
|
||||||
super(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);
|
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
|
* The Apache Software License, Version 1.1
|
||||||
|
@ -64,18 +64,18 @@ import java.util.TreeSet;
|
||||||
import junit.framework.Test;
|
import junit.framework.Test;
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
|
|
||||||
import org.apache.commons.collections.TestSortedSet;
|
import org.apache.commons.collections.AbstractTestSortedSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extension of {@link TestSortedSet} for exercising the
|
* Extension of {@link TestSortedSet} for exercising the
|
||||||
* {@link ObservedSortedSet} implementation.
|
* {@link ObservedSortedSet} implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @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
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public class TestObservableSortedSet extends TestSortedSet implements ObservedTestHelper.ObservedFactory {
|
public class TestObservableSortedSet extends AbstractTestSortedSet implements ObservedTestHelper.ObservedFactory {
|
||||||
|
|
||||||
public TestObservableSortedSet(String testName) {
|
public TestObservableSortedSet(String testName) {
|
||||||
super(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);
|
return ObservableSortedSet.decorate(new TreeSet(), ObservedTestHelper.LISTENER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue