Renamed unit tests for iterators package.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1377502 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2012-08-26 19:52:16 +00:00
parent 73d8eab106
commit 7349963217
30 changed files with 96 additions and 166 deletions

View File

@ -29,20 +29,17 @@ import org.apache.commons.collections.AbstractObjectTest;
* They must also specify certain details of how the iterator operates by * They must also specify certain details of how the iterator operates by
* overriding the supportsXxx() methods if necessary. * overriding the supportsXxx() methods if necessary.
* *
* @since Commons Collections 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author Morgan Delagrange
* @author Stephen Colebourne
*/ */
public abstract class AbstractTestIterator<E> extends AbstractObjectTest { public abstract class AbstractIteratorTest<E> extends AbstractObjectTest {
/** /**
* JUnit constructor. * JUnit constructor.
* *
* @param testName the test class name * @param testName the test class name
*/ */
public AbstractTestIterator(String testName) { public AbstractIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -28,20 +28,17 @@ import java.util.NoSuchElementException;
* They must also specify certain details of how the list iterator operates by * They must also specify certain details of how the list iterator operates by
* overriding the supportsXxx() methods if necessary. * overriding the supportsXxx() methods if necessary.
* *
* @since Commons Collections 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author Rodney Waldhoff
* @author Stephen Colebourne
*/ */
public abstract class AbstractTestListIterator<E> extends AbstractTestIterator<E> { public abstract class AbstractListIteratorTest<E> extends AbstractIteratorTest<E> {
/** /**
* JUnit constructor. * JUnit constructor.
* *
* @param testName the test class name * @param testName the test class name
*/ */
public AbstractTestListIterator(String testName) { public AbstractListIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -31,19 +31,17 @@ import org.apache.commons.collections.MapIterator;
* They must also specify certain details of how the list iterator operates by * They must also specify certain details of how the list iterator operates by
* overriding the supportsXxx() methods if necessary. * overriding the supportsXxx() methods if necessary.
* *
* @since Commons Collections 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public abstract class AbstractTestMapIterator<K, V> extends AbstractTestIterator<K> { public abstract class AbstractMapIteratorTest<K, V> extends AbstractIteratorTest<K> {
/** /**
* JUnit constructor. * JUnit constructor.
* *
* @param testName the test class name * @param testName the test class name
*/ */
public AbstractTestMapIterator(String testName) { public AbstractMapIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -34,19 +34,17 @@ import org.apache.commons.collections.OrderedMapIterator;
* They must also specify certain details of how the list iterator operates by * They must also specify certain details of how the list iterator operates by
* overriding the supportsXxx() methods if necessary. * overriding the supportsXxx() methods if necessary.
* *
* @since Commons Collections 3.0 * @since 3.0
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public abstract class AbstractTestOrderedMapIterator<K, V> extends AbstractTestMapIterator<K, V> { public abstract class AbstractOrderedMapIteratorTest<K, V> extends AbstractMapIteratorTest<K, V> {
/** /**
* JUnit constructor. * JUnit constructor.
* *
* @param testName the test class name * @param testName the test class name
*/ */
public AbstractTestOrderedMapIterator(String testName) { public AbstractOrderedMapIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -22,16 +22,13 @@ import java.util.NoSuchElementException;
/** /**
* Tests the ArrayIterator with primitive type arrays. * Tests the ArrayIterator with primitive type arrays.
* *
* @version $Revision$ * @version $Id$
*
* @author Morgan Delagrange
* @author James Strachan
*/ */
public class TestArrayIterator2<E> extends AbstractTestIterator<E> { public class ArrayIterator2Test<E> extends AbstractIteratorTest<E> {
protected int[] testArray = { 2, 4, 6, 8 }; protected int[] testArray = { 2, 4, 6, 8 };
public TestArrayIterator2(String testName) { public ArrayIterator2Test(String testName) {
super(testName); super(testName);
} }

View File

@ -24,18 +24,13 @@ import java.util.NoSuchElementException;
* perform the iteration rather than the hasNext() method. * perform the iteration rather than the hasNext() method.
* The code of this test was supplied by Mauricio S. Moura. * The code of this test was supplied by Mauricio S. Moura.
* *
* @version $Revision$ * @version $Id$
*
* @author James Strachan
* @author Mauricio S. Moura
* @author Morgan Delagrange
* @author Stephen Colebourne
*/ */
public class TestArrayIterator<E> extends AbstractTestIterator<E> { public class ArrayIteratorTest<E> extends AbstractIteratorTest<E> {
protected String[] testArray = { "One", "Two", "Three" }; protected String[] testArray = { "One", "Two", "Three" };
public TestArrayIterator(String testName) { public ArrayIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -19,12 +19,11 @@ package org.apache.commons.collections.iterators;
/** /**
* Test the ArrayListIterator class with primitives. * Test the ArrayListIterator class with primitives.
* *
* @version $Revision$ * @version $Id$
* @author Neil O'Toole
*/ */
public class TestArrayListIterator2<E> extends TestArrayIterator2<E> { public class ArrayListIterator2Test<E> extends ArrayIterator2Test<E> {
public TestArrayListIterator2(String testName) { public ArrayListIterator2Test(String testName) {
super(testName); super(testName);
} }

View File

@ -23,12 +23,11 @@ import java.util.NoSuchElementException;
/** /**
* Test the ArrayListIterator class. * Test the ArrayListIterator class.
* *
* @version $Revision$ * @version $Id$
* @author Neil O'Toole
*/ */
public class TestArrayListIterator<E> extends TestArrayIterator<E> { public class ArrayListIteratorTest<E> extends ArrayIteratorTest<E> {
public TestArrayListIterator(String testName) { public ArrayListIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -26,15 +26,14 @@ import org.apache.commons.collections.comparators.ComparableComparator;
/** /**
* Unit test suite for {@link CollatingIterator}. * Unit test suite for {@link CollatingIterator}.
* *
* @version $Revision$ * @version $Id$
* @author Rodney Waldhoff
*/ */
@SuppressWarnings("boxing") @SuppressWarnings("boxing")
public class TestCollatingIterator extends AbstractTestIterator<Integer> { public class CollatingIteratorTest extends AbstractIteratorTest<Integer> {
//------------------------------------------------------------ Conventional //------------------------------------------------------------ Conventional
public TestCollatingIterator(String testName) { public CollatingIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -31,16 +31,12 @@ import org.apache.commons.collections.functors.NotNullPredicate;
/** /**
* Test the filter iterator. * Test the filter iterator.
* *
* @version $Revision$ * @version $Id$
*
* @author Jan Sorensen
* @author Ralph Wagner
* @author Huw Roberts
*/ */
public class TestFilterIterator<E> extends AbstractTestIterator<E> { public class FilterIteratorTest<E> extends AbstractIteratorTest<E> {
/** Creates new TestFilterIterator */ /** Creates new TestFilterIterator */
public TestFilterIterator(String name) { public FilterIteratorTest(String name) {
super(name); super(name);
} }

View File

@ -31,13 +31,11 @@ import org.junit.Assert;
/** /**
* Tests the FilterListIterator class. * Tests the FilterListIterator class.
* *
* @version $Revision$ * @version $Id$
*
* @author Rodney Waldhoff
*/ */
@SuppressWarnings("boxing") @SuppressWarnings("boxing")
public class TestFilterListIterator extends TestCase { public class FilterListIteratorTest extends TestCase {
public TestFilterListIterator(String testName) { public FilterListIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -27,13 +27,9 @@ import org.apache.commons.collections.Predicate;
/** /**
* Tests the IteratorChain class. * Tests the IteratorChain class.
* *
* @version $Revision$ * @version $Id$
*
* @author James Strachan
* @author Mauricio S. Moura
* @author Morgan Delagrange
*/ */
public class TestIteratorChain extends AbstractTestIterator<String> { public class IteratorChainTest extends AbstractIteratorTest<String> {
protected String[] testArray = { protected String[] testArray = {
"One", "Two", "Three", "Four", "Five", "Six" "One", "Two", "Three", "Four", "Five", "Six"
@ -43,7 +39,7 @@ public class TestIteratorChain extends AbstractTestIterator<String> {
protected List<String> list2 = null; protected List<String> list2 = null;
protected List<String> list3 = null; protected List<String> list3 = null;
public TestIteratorChain(String testName) { public IteratorChainTest(String testName) {
super(testName); super(testName);
} }

View File

@ -24,15 +24,15 @@ import org.apache.commons.collections.BulkTest;
/** /**
* Tests for IteratorIterable. * Tests for IteratorIterable.
* *
* @version $Revision$ * @version $Id$
*/ */
public class TestIteratorIterable extends BulkTest { public class IteratorIterableTest extends BulkTest {
public static Test suite() { public static Test suite() {
return BulkTest.makeSuite(TestIteratorIterable.class); return BulkTest.makeSuite(IteratorIterableTest.class);
} }
public TestIteratorIterable(String name) { public IteratorIterableTest(String name) {
super(name); super(name);
} }
@ -53,7 +53,7 @@ public class TestIteratorIterable extends BulkTest {
verifyIteration(iterable); verifyIteration(iterable);
// second use // second use
for (Number actual : iterable) { for (@SuppressWarnings("unused") Number actual : iterable) {
fail("should not be able to iterate twice"); fail("should not be able to iterate twice");
} }
} }

View File

@ -26,11 +26,9 @@ import org.apache.commons.collections.ResettableListIterator;
/** /**
* Tests the ListIteratorWrapper to insure that it behaves as expected when wrapping a ListIterator. * Tests the ListIteratorWrapper to insure that it behaves as expected when wrapping a ListIterator.
* *
* @version $Revision$ * @version $Id$
*
* @author Morgan Delagrange
*/ */
public class TestListIteratorWrapper2<E> extends AbstractTestIterator<E> { public class ListIteratorWrapper2Test<E> extends AbstractIteratorTest<E> {
protected String[] testArray = { protected String[] testArray = {
"One", "Two", "Three", "Four", "Five", "Six" "One", "Two", "Three", "Four", "Five", "Six"
@ -38,7 +36,7 @@ public class TestListIteratorWrapper2<E> extends AbstractTestIterator<E> {
protected List<E> list1 = null; protected List<E> list1 = null;
public TestListIteratorWrapper2(String testName) { public ListIteratorWrapper2Test(String testName) {
super(testName); super(testName);
} }

View File

@ -27,11 +27,9 @@ import org.apache.commons.collections.ResettableListIterator;
* Tests the ListIteratorWrapper to insure that it simulates * Tests the ListIteratorWrapper to insure that it simulates
* a ListIterator correctly. * a ListIterator correctly.
* *
* @version $Revision$ * @version $Id$
*
* @author Morgan Delagrange
*/ */
public class TestListIteratorWrapper<E> extends AbstractTestIterator<E> { public class ListIteratorWrapperTest<E> extends AbstractIteratorTest<E> {
protected String[] testArray = { protected String[] testArray = {
"One", "Two", "Three", "Four", "Five", "Six" "One", "Two", "Three", "Four", "Five", "Six"
@ -39,7 +37,7 @@ public class TestListIteratorWrapper<E> extends AbstractTestIterator<E> {
protected List<E> list1 = null; protected List<E> list1 = null;
public TestListIteratorWrapper(String testName) { public ListIteratorWrapperTest(String testName) {
super(testName); super(testName);
} }

View File

@ -26,14 +26,11 @@ import junit.framework.TestCase;
/** /**
* Tests the LoopingIterator class. * Tests the LoopingIterator class.
* *
* @version $Revision$ * @version $Id$
*
* @author Jonathan Carlson
* @author Stephen Colebourne
*/ */
public class TestLoopingIterator extends TestCase { public class LoopingIteratorTest extends TestCase {
public TestLoopingIterator(String testName) { public LoopingIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -26,13 +26,11 @@ import junit.framework.TestCase;
/** /**
* Tests the LoopingListIterator class. * Tests the LoopingListIterator class.
* *
* @version $Revision$ * @version $Id$
*
* @author Eric Crampton <ccesc@eonomine.com>
*/ */
public class TestLoopingListIterator extends TestCase { public class LoopingListIteratorTest extends TestCase {
public TestLoopingListIterator(String testName) { public LoopingListIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -22,18 +22,13 @@ import java.util.NoSuchElementException;
/** /**
* Tests the ObjectArrayIterator. * Tests the ObjectArrayIterator.
* *
* @version $Revision$ * @version $Id$
*
* @author James Strachan
* @author Mauricio S. Moura
* @author Morgan Delagrange
* @author Stephen Colebourne
*/ */
public class TestObjectArrayIterator<E> extends AbstractTestIterator<E> { public class ObjectArrayIteratorTest<E> extends AbstractIteratorTest<E> {
protected String[] testArray = { "One", "Two", "Three" }; protected String[] testArray = { "One", "Two", "Three" };
public TestObjectArrayIterator(String testName) { public ObjectArrayIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -19,15 +19,13 @@ package org.apache.commons.collections.iterators;
/** /**
* Tests the ObjectArrayListIterator class. * Tests the ObjectArrayListIterator class.
* *
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public class TestObjectArrayListIterator2<E> extends AbstractTestListIterator<E> { public class ObjectArrayListIterator2Test<E> extends AbstractListIteratorTest<E> {
protected String[] testArray = { "One", "Two", "Three" }; protected String[] testArray = { "One", "Two", "Three" };
public TestObjectArrayListIterator2(String testName) { public ObjectArrayListIterator2Test(String testName) {
super(testName); super(testName);
} }

View File

@ -23,13 +23,11 @@ import java.util.NoSuchElementException;
/** /**
* Tests the ObjectArrayListIterator class. * Tests the ObjectArrayListIterator class.
* *
* @version $Revision$ * @version $Id$
*
* @author Neil O'Toole
*/ */
public class TestObjectArrayListIterator<E> extends TestObjectArrayIterator<E> { public class ObjectArrayListIteratorTest<E> extends ObjectArrayIteratorTest<E> {
public TestObjectArrayListIterator(String testName) { public ObjectArrayListIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -27,11 +27,9 @@ import org.apache.commons.collections.Transformer;
/** /**
* Testcase. * Testcase.
* *
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public class TestObjectGraphIterator extends AbstractTestIterator<Object> { public class ObjectGraphIteratorTest extends AbstractIteratorTest<Object> {
protected String[] testArray = { "One", "Two", "Three", "Four", "Five", "Six" }; protected String[] testArray = { "One", "Two", "Three", "Four", "Five", "Six" };
@ -40,7 +38,7 @@ public class TestObjectGraphIterator extends AbstractTestIterator<Object> {
protected List<String> list3 = null; protected List<String> list3 = null;
protected List<Iterator<String>> iteratorList = null; protected List<Iterator<String>> iteratorList = null;
public TestObjectGraphIterator(String testName) { public ObjectGraphIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -27,13 +27,13 @@ import org.apache.commons.collections.ResettableListIterator;
/** /**
* Tests the ReverseListIterator. * Tests the ReverseListIterator.
* *
* @version $Revision$ * @version $Id$
*/ */
public class TestReverseListIterator<E> extends AbstractTestListIterator<E> { public class ReverseListIteratorTest<E> extends AbstractListIteratorTest<E> {
protected String[] testArray = { "One", "Two", "Three", "Four" }; protected String[] testArray = { "One", "Two", "Three", "Four" };
public TestReverseListIterator(String testName) { public ReverseListIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -25,15 +25,13 @@ import org.apache.commons.collections.ResettableIterator;
* Tests the SingletonIterator to ensure that the next() method will actually * Tests the SingletonIterator to ensure that the next() method will actually
* perform the iteration rather than the hasNext() method. * perform the iteration rather than the hasNext() method.
* *
* @version $Revision$ * @version $Id$
*
* @author James Strachan
*/ */
public class TestSingletonIterator2<E> extends AbstractTestIterator<E> { public class SingletonIterator2Test<E> extends AbstractIteratorTest<E> {
private static final Object testValue = "foo"; private static final Object testValue = "foo";
public TestSingletonIterator2(String testName) { public SingletonIterator2Test(String testName) {
super(testName); super(testName);
} }

View File

@ -25,15 +25,13 @@ import org.apache.commons.collections.ResettableIterator;
* Tests the SingletonIterator to ensure that the next() method will actually * Tests the SingletonIterator to ensure that the next() method will actually
* perform the iteration rather than the hasNext() method. * perform the iteration rather than the hasNext() method.
* *
* @version $Revision$ * @version $Id$
*
* @author James Strachan
*/ */
public class TestSingletonIterator<E> extends AbstractTestIterator<E> { public class SingletonIteratorTest<E> extends AbstractIteratorTest<E> {
private static final Object testValue = "foo"; private static final Object testValue = "foo";
public TestSingletonIterator(String testName) { public SingletonIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -24,15 +24,13 @@ import org.apache.commons.collections.ResettableListIterator;
/** /**
* Tests the SingletonListIterator. * Tests the SingletonListIterator.
* *
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public class TestSingletonListIterator<E> extends AbstractTestListIterator<E> { public class SingletonListIteratorTest<E> extends AbstractListIteratorTest<E> {
private static final Object testValue = "foo"; private static final Object testValue = "foo";
public TestSingletonListIterator(String testName) { public SingletonListIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -24,14 +24,9 @@ import java.util.NoSuchElementException;
/** /**
* Tests the UniqueFilterIterator class. * Tests the UniqueFilterIterator class.
* *
* @version $Revision$ * @version $Id$
*
* @author James Strachan
* @author Mauricio S. Moura
* @author Morgan Delagrange
* @author Stephen Colebourne
*/ */
public class TestUniqueFilterIterator<E> extends AbstractTestIterator<E> { public class UniqueFilterIteratorTest<E> extends AbstractIteratorTest<E> {
protected String[] testArray = { protected String[] testArray = {
"One", "Two", "Three", "Four", "Five", "Six" "One", "Two", "Three", "Four", "Five", "Six"
@ -39,7 +34,7 @@ public class TestUniqueFilterIterator<E> extends AbstractTestIterator<E> {
protected List<E> list1 = null; protected List<E> list1 = null;
public TestUniqueFilterIterator(String testName) { public UniqueFilterIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -27,16 +27,14 @@ import org.apache.commons.collections.Unmodifiable;
/** /**
* Tests the UnmodifiableIterator. * Tests the UnmodifiableIterator.
* *
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public class TestUnmodifiableIterator<E> extends AbstractTestIterator<E> { public class UnmodifiableIteratorTest<E> extends AbstractIteratorTest<E> {
protected String[] testArray = { "One", "Two", "Three" }; protected String[] testArray = { "One", "Two", "Three" };
protected List<E> testList; protected List<E> testList;
public TestUnmodifiableIterator(String testName) { public UnmodifiableIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -27,16 +27,14 @@ import org.apache.commons.collections.Unmodifiable;
/** /**
* Tests the UnmodifiableListIterator. * Tests the UnmodifiableListIterator.
* *
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public class TestUnmodifiableListIterator<E> extends AbstractTestListIterator<E> { public class UnmodifiableListIteratorTest<E> extends AbstractListIteratorTest<E> {
protected String[] testArray = { "One", "Two", "Three" }; protected String[] testArray = { "One", "Two", "Three" };
protected List<E> testList; protected List<E> testList;
public TestUnmodifiableListIterator(String testName) { public UnmodifiableListIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -27,13 +27,11 @@ import org.apache.commons.collections.bidimap.DualHashBidiMap;
/** /**
* Tests the UnmodifiableMapIterator. * Tests the UnmodifiableMapIterator.
* *
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public class TestUnmodifiableMapIterator<K, V> extends AbstractTestMapIterator<K, V> { public class UnmodifiableMapIteratorTest<K, V> extends AbstractMapIteratorTest<K, V> {
public TestUnmodifiableMapIterator(String testName) { public UnmodifiableMapIteratorTest(String testName) {
super(testName); super(testName);
} }

View File

@ -28,13 +28,11 @@ import org.apache.commons.collections.map.ListOrderedMap;
/** /**
* Tests the UnmodifiableOrderedMapIterator. * Tests the UnmodifiableOrderedMapIterator.
* *
* @version $Revision$ * @version $Id$
*
* @author Stephen Colebourne
*/ */
public class TestUnmodifiableOrderedMapIterator<K, V> extends AbstractTestOrderedMapIterator<K, V> { public class UnmodifiableOrderedMapIteratorTest<K, V> extends AbstractOrderedMapIteratorTest<K, V> {
public TestUnmodifiableOrderedMapIterator(String testName) { public UnmodifiableOrderedMapIteratorTest(String testName) {
super(testName); super(testName);
} }