Renamed list tests.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1370008 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
bdea1ff900
commit
452822535d
|
@ -18,7 +18,7 @@ package org.apache.commons.collections;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.apache.commons.collections.list.AbstractTestList;
|
import org.apache.commons.collections.list.AbstractListTest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract test class for ArrayList.
|
* Abstract test class for ArrayList.
|
||||||
|
@ -27,7 +27,7 @@ import org.apache.commons.collections.list.AbstractTestList;
|
||||||
*
|
*
|
||||||
* @author Jason van Zyl
|
* @author Jason van Zyl
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractTestArrayList<E> extends AbstractTestList<E> {
|
public abstract class AbstractTestArrayList<E> extends AbstractListTest<E> {
|
||||||
|
|
||||||
public AbstractTestArrayList(String testName) {
|
public AbstractTestArrayList(String testName) {
|
||||||
super(testName);
|
super(testName);
|
||||||
|
|
|
@ -22,7 +22,7 @@ import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.NoSuchElementException;
|
import java.util.NoSuchElementException;
|
||||||
|
|
||||||
import org.apache.commons.collections.list.AbstractTestList;
|
import org.apache.commons.collections.list.AbstractListTest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests base {@link java.util.LinkedList} methods and contracts.
|
* Tests base {@link java.util.LinkedList} methods and contracts.
|
||||||
|
@ -38,7 +38,7 @@ import org.apache.commons.collections.list.AbstractTestList;
|
||||||
*
|
*
|
||||||
* @author Rich Dougherty
|
* @author Rich Dougherty
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractTestLinkedList<T> extends AbstractTestList<T> {
|
public abstract class AbstractTestLinkedList<T> extends AbstractListTest<T> {
|
||||||
|
|
||||||
public AbstractTestLinkedList(String testName) {
|
public AbstractTestLinkedList(String testName) {
|
||||||
super(testName);
|
super(testName);
|
||||||
|
|
|
@ -104,9 +104,9 @@ import org.apache.commons.collections.AbstractTestObject;
|
||||||
* Those methods should provide a confirmed collection implementation
|
* Those methods should provide a confirmed collection implementation
|
||||||
* that's compatible with your collection implementation.
|
* that's compatible with your collection implementation.
|
||||||
* <p>
|
* <p>
|
||||||
* If you're extending {@link org.apache.commons.collections.list.AbstractTestList AbstractTestList},
|
* If you're extending {@link org.apache.commons.collections.list.AbstractListTest AbstractListTest},
|
||||||
* {@link org.apache.commons.collections.set.AbstractTestSet AbstractTestSet},
|
* {@link org.apache.commons.collections.set.AbstractTestSet AbstractTestSet},
|
||||||
* or {@link org.apache.commons.collections.bag.AbstractBagTest AbstractTestBag},
|
* or {@link org.apache.commons.collections.bag.AbstractBagTest AbstractBagTest},
|
||||||
* you probably don't have to worry about the
|
* you probably don't have to worry about the
|
||||||
* above methods, because those three classes already override the methods
|
* above methods, because those three classes already override the methods
|
||||||
* to provide standard JDK confirmed collections.<P>
|
* to provide standard JDK confirmed collections.<P>
|
||||||
|
|
|
@ -27,9 +27,9 @@ import java.util.Arrays;
|
||||||
* @author David Hay
|
* @author David Hay
|
||||||
* @author Phil Steitz
|
* @author Phil Steitz
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractTestLinkedList<E> extends AbstractTestList<E> {
|
public abstract class AbstractLinkedListTest<E> extends AbstractListTest<E> {
|
||||||
|
|
||||||
public AbstractTestLinkedList(String testName) {
|
public AbstractLinkedListTest(String testName) {
|
||||||
super(testName);
|
super(testName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,14 +53,14 @@ import org.apache.commons.collections.iterators.AbstractTestListIterator;
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
* @author Neil O'Toole
|
* @author Neil O'Toole
|
||||||
*/
|
*/
|
||||||
public abstract class AbstractTestList<E> extends AbstractCollectionTest<E> {
|
public abstract class AbstractListTest<E> extends AbstractCollectionTest<E> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JUnit constructor.
|
* JUnit constructor.
|
||||||
*
|
*
|
||||||
* @param testName the test class name
|
* @param testName the test class name
|
||||||
*/
|
*/
|
||||||
public AbstractTestList(String testName) {
|
public AbstractListTest(String testName) {
|
||||||
super(testName);
|
super(testName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1117,11 +1117,11 @@ public abstract class AbstractTestList<E> extends AbstractCollectionTest<E> {
|
||||||
return new BulkTestSubList<E>(this);
|
return new BulkTestSubList<E>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class BulkTestSubList<E> extends AbstractTestList<E> {
|
public static class BulkTestSubList<E> extends AbstractListTest<E> {
|
||||||
|
|
||||||
private AbstractTestList<E> outer;
|
private AbstractListTest<E> outer;
|
||||||
|
|
||||||
public BulkTestSubList(AbstractTestList<E> outer) {
|
public BulkTestSubList(AbstractListTest<E> outer) {
|
||||||
super("");
|
super("");
|
||||||
this.outer = outer;
|
this.outer = outer;
|
||||||
}
|
}
|
||||||
|
@ -1322,34 +1322,34 @@ public abstract class AbstractTestList<E> extends AbstractCollectionTest<E> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public E addSetValue() {
|
public E addSetValue() {
|
||||||
return AbstractTestList.this.getOtherElements()[0];
|
return AbstractListTest.this.getOtherElements()[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsRemove() {
|
public boolean supportsRemove() {
|
||||||
return AbstractTestList.this.isRemoveSupported();
|
return AbstractListTest.this.isRemoveSupported();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsAdd() {
|
public boolean supportsAdd() {
|
||||||
return AbstractTestList.this.isAddSupported();
|
return AbstractListTest.this.isAddSupported();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsSet() {
|
public boolean supportsSet() {
|
||||||
return AbstractTestList.this.isSetSupported();
|
return AbstractListTest.this.isSetSupported();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ListIterator<E> makeEmptyIterator() {
|
public ListIterator<E> makeEmptyIterator() {
|
||||||
resetEmpty();
|
resetEmpty();
|
||||||
return AbstractTestList.this.getCollection().listIterator();
|
return AbstractListTest.this.getCollection().listIterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ListIterator<E> makeObject() {
|
public ListIterator<E> makeObject() {
|
||||||
resetFull();
|
resetFull();
|
||||||
return AbstractTestList.this.getCollection().listIterator();
|
return AbstractListTest.this.getCollection().listIterator();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,13 +36,13 @@ import org.apache.commons.collections.BulkTest;
|
||||||
* @author Rodney Waldhoff
|
* @author Rodney Waldhoff
|
||||||
* @author Simon Kitching
|
* @author Simon Kitching
|
||||||
*/
|
*/
|
||||||
public class TestCursorableLinkedList<E> extends AbstractTestLinkedList<E> {
|
public class CursorableLinkedListTest<E> extends AbstractLinkedListTest<E> {
|
||||||
public TestCursorableLinkedList(String testName) {
|
public CursorableLinkedListTest(String testName) {
|
||||||
super(testName);
|
super(testName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return BulkTest.makeSuite(TestCursorableLinkedList.class);
|
return BulkTest.makeSuite(CursorableLinkedListTest.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
private CursorableLinkedList<E> list;
|
private CursorableLinkedList<E> list;
|
|
@ -21,7 +21,7 @@ import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extension of {@link AbstractTestList} for exercising the {@link FixedSizeList}
|
* Extension of {@link AbstractListTest} for exercising the {@link FixedSizeList}
|
||||||
* implementation.
|
* implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
|
@ -29,9 +29,9 @@ import java.util.List;
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public class TestFixedSizeList<E> extends AbstractTestList<E> {
|
public class FixedSizeListTest<E> extends AbstractListTest<E> {
|
||||||
|
|
||||||
public TestFixedSizeList(String testName) {
|
public FixedSizeListTest(String testName) {
|
||||||
super(testName);
|
super(testName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,16 +22,16 @@ import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extension of {@link AbstractTestList} for exercising the {@link GrowthList}.
|
* Extension of {@link AbstractListTest} for exercising the {@link GrowthList}.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.2
|
* @since Commons Collections 3.2
|
||||||
* @version $Revision$
|
* @version $Revision$
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public class TestGrowthList<E> extends AbstractTestList<E> {
|
public class GrowthListTest<E> extends AbstractListTest<E> {
|
||||||
|
|
||||||
public TestGrowthList(String testName) {
|
public GrowthListTest(String testName) {
|
||||||
super(testName);
|
super(testName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,14 +31,14 @@ import org.apache.commons.collections.BulkTest;
|
||||||
* @author Jeff Varszegi
|
* @author Jeff Varszegi
|
||||||
* @author Phil Steitz
|
* @author Phil Steitz
|
||||||
*/
|
*/
|
||||||
public class TestNodeCachingLinkedList<E> extends AbstractTestLinkedList<E> {
|
public class NodeCachingLinkedListTest<E> extends AbstractLinkedListTest<E> {
|
||||||
|
|
||||||
public TestNodeCachingLinkedList(String testName) {
|
public NodeCachingLinkedListTest(String testName) {
|
||||||
super(testName);
|
super(testName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return BulkTest.makeSuite(TestNodeCachingLinkedList.class);
|
return BulkTest.makeSuite(NodeCachingLinkedListTest.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
|
@ -23,7 +23,7 @@ import org.apache.commons.collections.Predicate;
|
||||||
import org.apache.commons.collections.functors.TruePredicate;
|
import org.apache.commons.collections.functors.TruePredicate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extension of {@link AbstractTestList} for exercising the
|
* Extension of {@link AbstractListTest} for exercising the
|
||||||
* {@link PredicatedList} implementation.
|
* {@link PredicatedList} implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
|
@ -31,9 +31,9 @@ import org.apache.commons.collections.functors.TruePredicate;
|
||||||
*
|
*
|
||||||
* @author Phil Steitz
|
* @author Phil Steitz
|
||||||
*/
|
*/
|
||||||
public class TestPredicatedList<E> extends AbstractTestList<E> {
|
public class PredicatedListTest<E> extends AbstractListTest<E> {
|
||||||
|
|
||||||
public TestPredicatedList(String testName) {
|
public PredicatedListTest(String testName) {
|
||||||
super(testName);
|
super(testName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,9 +34,9 @@ import java.util.Set;
|
||||||
* @author Matthew Hawthorne
|
* @author Matthew Hawthorne
|
||||||
* @author Tom Dunham
|
* @author Tom Dunham
|
||||||
*/
|
*/
|
||||||
public class TestSetUniqueList<E> extends AbstractTestList<E> {
|
public class SetUniqueListTest<E> extends AbstractListTest<E> {
|
||||||
|
|
||||||
public TestSetUniqueList(String testName) {
|
public SetUniqueListTest(String testName) {
|
||||||
super(testName);
|
super(testName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extension of {@link AbstractTestList} for exercising the {@link SynchronizedList}
|
* Extension of {@link AbstractListTest} for exercising the {@link SynchronizedList}
|
||||||
* implementation.
|
* implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.1
|
* @since Commons Collections 3.1
|
||||||
|
@ -28,9 +28,9 @@ import java.util.List;
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public class TestSynchronizedList<E> extends AbstractTestList<E> {
|
public class SynchronizedListTest<E> extends AbstractListTest<E> {
|
||||||
|
|
||||||
public TestSynchronizedList(String testName) {
|
public SynchronizedListTest(String testName) {
|
||||||
super(testName);
|
super(testName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ import org.apache.commons.collections.Transformer;
|
||||||
import org.apache.commons.collections.collection.TransformedCollectionTest;
|
import org.apache.commons.collections.collection.TransformedCollectionTest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extension of {@link AbstractTestList} for exercising the {@link TransformedList}
|
* Extension of {@link AbstractListTest} for exercising the {@link TransformedList}
|
||||||
* implementation.
|
* implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
|
@ -33,9 +33,9 @@ import org.apache.commons.collections.collection.TransformedCollectionTest;
|
||||||
*
|
*
|
||||||
* @author Stephen Colebourne
|
* @author Stephen Colebourne
|
||||||
*/
|
*/
|
||||||
public class TestTransformedList<E> extends AbstractTestList<E> {
|
public class TransformedListTest<E> extends AbstractListTest<E> {
|
||||||
|
|
||||||
public TestTransformedList(String testName) {
|
public TransformedListTest(String testName) {
|
||||||
super(testName);
|
super(testName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,14 +31,14 @@ import org.apache.commons.collections.BulkTest;
|
||||||
*
|
*
|
||||||
* @author Joerg Schmuecker
|
* @author Joerg Schmuecker
|
||||||
*/
|
*/
|
||||||
public class TestTreeList<E> extends AbstractTestList<E> {
|
public class TreeListTest<E> extends AbstractListTest<E> {
|
||||||
|
|
||||||
public TestTreeList(String name) {
|
public TreeListTest(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
// public static void main(String[] args) {
|
||||||
junit.textui.TestRunner.run(suite());
|
// junit.textui.TestRunner.run(suite());
|
||||||
// System.out.println(" add; toArray; iterator; insert; get; indexOf; remove");
|
// System.out.println(" add; toArray; iterator; insert; get; indexOf; remove");
|
||||||
// System.out.print(" TreeList = ");
|
// System.out.print(" TreeList = ");
|
||||||
// benchmark(new TreeList());
|
// benchmark(new TreeList());
|
||||||
|
@ -47,10 +47,10 @@ public class TestTreeList<E> extends AbstractTestList<E> {
|
||||||
// System.out.print("\n LinkedList = ");
|
// System.out.print("\n LinkedList = ");
|
||||||
// benchmark(new java.util.LinkedList());
|
// benchmark(new java.util.LinkedList());
|
||||||
// benchmark(new NodeCachingLinkedList());
|
// benchmark(new NodeCachingLinkedList());
|
||||||
}
|
// }
|
||||||
|
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return BulkTest.makeSuite(TestTreeList.class);
|
return BulkTest.makeSuite(TreeListTest.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void benchmark(List<? super Integer> l) {
|
public static void benchmark(List<? super Integer> l) {
|
|
@ -22,7 +22,7 @@ import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extension of {@link AbstractTestList} for exercising the
|
* Extension of {@link AbstractListTest} for exercising the
|
||||||
* {@link UnmodifiableList} implementation.
|
* {@link UnmodifiableList} implementation.
|
||||||
*
|
*
|
||||||
* @since Commons Collections 3.0
|
* @since Commons Collections 3.0
|
||||||
|
@ -30,9 +30,9 @@ import java.util.List;
|
||||||
*
|
*
|
||||||
* @author Phil Steitz
|
* @author Phil Steitz
|
||||||
*/
|
*/
|
||||||
public class TestUnmodifiableList<E> extends AbstractTestList<E> {
|
public class UnmodifiableListTest<E> extends AbstractListTest<E> {
|
||||||
|
|
||||||
public TestUnmodifiableList(String testName) {
|
public UnmodifiableListTest(String testName) {
|
||||||
super(testName);
|
super(testName);
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ import org.apache.commons.collections.BulkTest;
|
||||||
import org.apache.commons.collections.MapIterator;
|
import org.apache.commons.collections.MapIterator;
|
||||||
import org.apache.commons.collections.OrderedMap;
|
import org.apache.commons.collections.OrderedMap;
|
||||||
import org.apache.commons.collections.ResettableIterator;
|
import org.apache.commons.collections.ResettableIterator;
|
||||||
import org.apache.commons.collections.list.AbstractTestList;
|
import org.apache.commons.collections.list.AbstractListTest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JUnit tests.
|
* JUnit tests.
|
||||||
|
@ -230,7 +230,7 @@ public class TestLinkedMap<K, V> extends AbstractTestOrderedMap<K, V> {
|
||||||
return new TestListView();
|
return new TestListView();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TestListView extends AbstractTestList<K> {
|
public class TestListView extends AbstractListTest<K> {
|
||||||
|
|
||||||
TestListView() {
|
TestListView() {
|
||||||
super("TestListView");
|
super("TestListView");
|
||||||
|
|
|
@ -27,7 +27,7 @@ import junit.framework.Test;
|
||||||
import org.apache.commons.collections.BulkTest;
|
import org.apache.commons.collections.BulkTest;
|
||||||
import org.apache.commons.collections.MapIterator;
|
import org.apache.commons.collections.MapIterator;
|
||||||
import org.apache.commons.collections.OrderedMapIterator;
|
import org.apache.commons.collections.OrderedMapIterator;
|
||||||
import org.apache.commons.collections.list.AbstractTestList;
|
import org.apache.commons.collections.list.AbstractListTest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extension of {@link AbstractTestOrderedMap} for exercising the {@link ListOrderedMap}
|
* Extension of {@link AbstractTestOrderedMap} for exercising the {@link ListOrderedMap}
|
||||||
|
@ -398,7 +398,7 @@ public class TestListOrderedMap<K, V> extends AbstractTestOrderedMap<K, V> {
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
public class TestKeyListView extends AbstractTestList<K> {
|
public class TestKeyListView extends AbstractListTest<K> {
|
||||||
TestKeyListView() {
|
TestKeyListView() {
|
||||||
super("TestKeyListView");
|
super("TestKeyListView");
|
||||||
}
|
}
|
||||||
|
@ -439,7 +439,7 @@ public class TestListOrderedMap<K, V> extends AbstractTestOrderedMap<K, V> {
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
public class TestValueListView extends AbstractTestList<V> {
|
public class TestValueListView extends AbstractListTest<V> {
|
||||||
TestValueListView() {
|
TestValueListView() {
|
||||||
super("TestValueListView");
|
super("TestValueListView");
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ import junit.framework.Test;
|
||||||
|
|
||||||
import org.apache.commons.collections.BulkTest;
|
import org.apache.commons.collections.BulkTest;
|
||||||
import org.apache.commons.collections.MapIterator;
|
import org.apache.commons.collections.MapIterator;
|
||||||
import org.apache.commons.collections.list.AbstractTestList;
|
import org.apache.commons.collections.list.AbstractListTest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extension of {@link AbstractTestOrderedMap} for exercising the {@link ListOrderedMap}
|
* Extension of {@link AbstractTestOrderedMap} for exercising the {@link ListOrderedMap}
|
||||||
|
@ -161,7 +161,7 @@ public class TestListOrderedMap2<K, V> extends AbstractTestOrderedMap<K, V> {
|
||||||
return new TestListView();
|
return new TestListView();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TestListView extends AbstractTestList<K> {
|
public class TestListView extends AbstractListTest<K> {
|
||||||
|
|
||||||
TestListView() {
|
TestListView() {
|
||||||
super("TestListView");
|
super("TestListView");
|
||||||
|
|
Loading…
Reference in New Issue