Renamed unit tests, removed unused LocalTestNode class.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1377066 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2012-08-24 19:36:22 +00:00
parent 6cbcb9ebc6
commit 68768dbe42
30 changed files with 65 additions and 190 deletions

View File

@ -27,9 +27,9 @@ import org.apache.commons.collections.list.AbstractListTest;
*
* @author Jason van Zyl
*/
public abstract class AbstractTestArrayList<E> extends AbstractListTest<E> {
public abstract class AbstractArrayListTest<E> extends AbstractListTest<E> {
public AbstractTestArrayList(String testName) {
public AbstractArrayListTest(String testName) {
super(testName);
}

View File

@ -38,9 +38,9 @@ import org.apache.commons.collections.list.AbstractListTest;
*
* @author Rich Dougherty
*/
public abstract class AbstractTestLinkedList<T> extends AbstractListTest<T> {
public abstract class AbstractLinkedListTest<T> extends AbstractListTest<T> {
public AbstractTestLinkedList(String testName) {
public AbstractLinkedListTest(String testName) {
super(testName);
}

View File

@ -44,7 +44,7 @@ import java.io.Serializable;
* @author Stephen Colebourne
* @author Anonymous
*/
public abstract class AbstractTestObject extends BulkTest {
public abstract class AbstractObjectTest extends BulkTest {
/** Current major release for Collections */
public static final int COLLECTIONS_MAJOR_VERSION = 3;
@ -54,7 +54,7 @@ public abstract class AbstractTestObject extends BulkTest {
*
* @param testName the test class name
*/
public AbstractTestObject(String testName) {
public AbstractObjectTest(String testName) {
super(testName);
}

View File

@ -27,9 +27,9 @@ import org.apache.commons.collections.map.AbstractTestMap;
*
* @author Jason van Zyl
*/
public abstract class AbstractTestTreeMap<K, V> extends AbstractTestMap<K, V> {
public abstract class AbstractTreeMapTest<K, V> extends AbstractTestMap<K, V> {
public AbstractTestTreeMap(String testName) {
public AbstractTreeMapTest(String testName) {
super(testName);
}

View File

@ -27,9 +27,9 @@ import java.util.List;
*
* @author Stephen Colebourne
*/
public abstract class AbstractTestTypedCollection<T> extends BulkTest {
public abstract class AbstractTypedCollectionTest<T> extends BulkTest {
public AbstractTestTypedCollection(String name) {
public AbstractTypedCollectionTest(String name) {
super(name);
}

View File

@ -27,14 +27,14 @@ import junit.framework.Test;
*
* @author Craig McClanahan
*/
public class TestArrayStack<E> extends AbstractTestArrayList<E> {
public class ArrayStackTest<E> extends AbstractArrayListTest<E> {
public TestArrayStack(String testName) {
public ArrayStackTest(String testName) {
super(testName);
}
public static Test suite() {
return BulkTest.makeSuite(TestArrayStack.class);
return BulkTest.makeSuite(ArrayStackTest.class);
}
@Override

View File

@ -37,15 +37,15 @@ import org.apache.commons.collections.functors.TruePredicate;
*
* @author Phil Steitz
*/
public class TestBagUtils extends BulkTest {
public class BagUtilsTest extends BulkTest {
public TestBagUtils(String name) {
public BagUtilsTest(String name) {
super(name);
}
public static Test suite() {
return BulkTest.makeSuite(TestBagUtils.class);
return BulkTest.makeSuite(BagUtilsTest.class);
}
//----------------------------------------------------------------------

View File

@ -27,15 +27,15 @@ import org.apache.commons.collections.buffer.PredicatedBuffer;
*
* @author Unknown
*/
public class TestBufferUtils extends BulkTest {
public class BufferUtilsTest extends BulkTest {
public TestBufferUtils(String name) {
public BufferUtilsTest(String name) {
super(name);
}
public static Test suite() {
return BulkTest.makeSuite(TestBufferUtils.class);
return BulkTest.makeSuite(BufferUtilsTest.class);
}
public void testNothing() {

View File

@ -38,14 +38,14 @@ import org.apache.commons.collections.functors.TruePredicate;
*
* @author Stephen Colebourne
*/
public class TestClosureUtils extends TestCase {
public class ClosureUtilsTest extends TestCase {
private static final Object cString = "Hello";
/**
* Construct
*/
public TestClosureUtils(String name) {
public ClosureUtilsTest(String name) {
super(name);
}

View File

@ -50,7 +50,7 @@ import org.junit.Test;
* @version $Revision$
*/
@SuppressWarnings("boxing")
public class TestCollectionUtils extends MockTestCase {
public class CollectionUtilsTest extends MockTestCase {
/**
* Collection of {@link Integer}s

View File

@ -30,9 +30,9 @@ import junit.framework.Test;
* @author <a href="mailto:ggregory@seagullsw.com">Gary Gregory</a>
* @version $Id$
*/
public class TestEnumerationUtils extends BulkTest {
public class EnumerationUtilsTest extends BulkTest {
public TestEnumerationUtils(String name) {
public EnumerationUtilsTest(String name) {
super(name);
}
@ -86,7 +86,7 @@ public class TestEnumerationUtils extends BulkTest {
}
public static Test suite() {
return BulkTest.makeSuite(TestEnumerationUtils.class);
return BulkTest.makeSuite(EnumerationUtilsTest.class);
}
}

View File

@ -35,11 +35,11 @@ import junit.framework.TestCase;
* @author Shinobu Kawai
* @author <a href="mailto:hps@intermeta.de">Henning P. Schmiedehausen</a>
*/
public class TestExtendedProperties extends TestCase {
public class ExtendedPropertiesTest extends TestCase {
protected ExtendedProperties eprop = new ExtendedProperties();
public TestExtendedProperties(String testName) {
public ExtendedPropertiesTest(String testName) {
super(testName);
}

View File

@ -38,12 +38,12 @@ import org.junit.Test;
*
* @author Stephen Colebourne
*/
public class TestFactoryUtils extends junit.framework.TestCase {
public class FactoryUtilsTest extends junit.framework.TestCase {
/**
* Construct
*/
public TestFactoryUtils(String name) {
public FactoryUtilsTest(String name) {
super(name);
}

View File

@ -38,14 +38,14 @@ import org.apache.commons.collections.iterators.EmptyOrderedMapIterator;
*
* @author Unknown
*/
public class TestIteratorUtils extends BulkTest {
public class IteratorUtilsTest extends BulkTest {
public TestIteratorUtils(String name) {
public IteratorUtilsTest(String name) {
super(name);
}
public static Test suite() {
return BulkTest.makeSuite(TestIteratorUtils.class);
return BulkTest.makeSuite(IteratorUtilsTest.class);
}
public void testAsIterable() {

View File

@ -33,7 +33,7 @@ import org.apache.commons.collections.list.PredicatedList;
*
* @version $Id$
*/
public class TestListUtils extends BulkTest {
public class ListUtilsTest extends BulkTest {
private static final String a = "a";
private static final String b = "b";
@ -45,12 +45,12 @@ public class TestListUtils extends BulkTest {
private String[] fullArray;
private List<String> fullList;
public TestListUtils(String name) {
public ListUtilsTest(String name) {
super(name);
}
public static Test suite() {
return BulkTest.makeSuite(TestListUtils.class);
return BulkTest.makeSuite(ListUtilsTest.class);
}
@Override

View File

@ -1,125 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.commons.collections;
/**
* Class LocalTestNode, a helper class for TestDoubleOrderedMap
*
* @version $Revision$
*
* @author Marc Johnson (marcj at users dot sourceforge dot net)
*/
class LocalTestNode<K extends Comparable<K>, V extends Comparable<V>> implements Comparable<LocalTestNode<K, V>> {
private K key;
private V value;
@SuppressWarnings("boxing")
static LocalTestNode<Integer, String> createLocalTestNode(final int key) {
return new LocalTestNode<Integer, String>(key, String.valueOf(key));
}
/**
* construct a LocalTestNode
*
* @param key value used to create the key and value
*/
private LocalTestNode(K key, V value) {
this.key = key;
this.value = value;
}
/**
* @param key the unique key associated with the current node.
*/
void setKey(K key) {
this.key = key;
}
/**
* @return the unique key associated with the current node
*/
K getKey() {
return key;
}
/**
* @param value the unique value associated with the current node.
*/
void setValue(V value) {
this.value = value;
}
/**
* @return the unique value associated with the current node
*/
V getValue() {
return value;
}
/**
* Method compareTo
*
* @param other
*
* @return a negative integer, zero, or a positive integer
* as this object is less than, equal to, or greater than the specified object.
*/
public int compareTo(LocalTestNode<K, V> other) {
int rval = getKey().compareTo(other.getKey());
if (rval == 0) {
rval = getValue().compareTo(other.getValue());
}
return rval;
}
/**
* Method equals
*
* @param o
*
* @return true if equal
*/
@Override
public boolean equals(Object o) {
if (o == null) {
return false;
}
if (!(o.getClass().equals(this.getClass()))) {
return false;
}
@SuppressWarnings("unchecked") // o has the correct class - see above
LocalTestNode<K, V> node = (LocalTestNode<K, V>) o;
return (getKey().equals(node.getKey())
&& getValue().equals(node.getValue()));
}
/**
* @return hash code
*/
@Override
public int hashCode() {
return getKey().hashCode() ^ getValue().hashCode();
}
}

View File

@ -50,14 +50,14 @@ import org.apache.commons.collections.collection.TransformedCollectionTest;
* @author Neil O'Toole
*/
@SuppressWarnings("boxing")
public class TestMapUtils extends BulkTest {
public class MapUtilsTest extends BulkTest {
public TestMapUtils(String name) {
public MapUtilsTest(String name) {
super(name);
}
public static Test suite() {
return BulkTest.makeSuite(TestMapUtils.class);
return BulkTest.makeSuite(MapUtilsTest.class);
}
public Predicate<Object> getPredicate() {

View File

@ -50,7 +50,7 @@ import org.junit.Test;
* @author Matt Benson
*/
@SuppressWarnings("boxing")
public class TestPredicateUtils extends AbstractPredicateTest {
public class PredicateUtilsTest extends AbstractPredicateTest {
/**
* Set up instance variables required by this test case.
*/

View File

@ -34,14 +34,14 @@ import org.apache.commons.collections.set.PredicatedSet;
* @author Neil O'Toole
* @author Matthew Hawthorne
*/
public class TestSetUtils extends BulkTest {
public class SetUtilsTest extends BulkTest {
public TestSetUtils(String name) {
public SetUtilsTest(String name) {
super(name);
}
public static Test suite() {
return BulkTest.makeSuite(TestSetUtils.class);
return BulkTest.makeSuite(SetUtilsTest.class);
}
public void testNothing() {

View File

@ -30,7 +30,7 @@ import org.apache.commons.collections.splitmap.TransformedMap;
* @version $Id$
*/
@SuppressWarnings("boxing")
public class TestSplitMapUtils extends BulkTest {
public class SplitMapUtilsTest extends BulkTest {
private Map<String, Integer> backingMap;
private TransformedMap<String, String, String, Integer> transformedMap;
@ -40,7 +40,7 @@ public class TestSplitMapUtils extends BulkTest {
}
};
public TestSplitMapUtils(String testName) {
public SplitMapUtilsTest(String testName) {
super(testName);
}

View File

@ -42,7 +42,7 @@ import org.apache.commons.collections.functors.TruePredicate;
* @author Stephen Colebourne
* @author James Carman
*/
public class TestTransformerUtils extends junit.framework.TestCase {
public class TransformerUtilsTest extends junit.framework.TestCase {
private static final Object cObject = new Object();
private static final Object cString = "Hello";
@ -51,7 +51,7 @@ public class TestTransformerUtils extends junit.framework.TestCase {
/**
* Construct
*/
public TestTransformerUtils(String name) {
public TransformerUtilsTest(String name) {
super(name);
}

View File

@ -24,7 +24,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
import org.apache.commons.collections.AbstractTestObject;
import org.apache.commons.collections.AbstractObjectTest;
import org.apache.commons.collections.Bag;
/**
@ -39,7 +39,7 @@ import org.apache.commons.collections.Bag;
*
* @version $Id$
*/
public abstract class AbstractBagTest<T> extends AbstractTestObject {
public abstract class AbstractBagTest<T> extends AbstractObjectTest {
// TODO: this class should really extend from TestCollection, but the bag
// implementations currently do not conform to the Collection interface. Once
// those are fixed or at least a strategy is made for resolving the issue, this

View File

@ -16,7 +16,7 @@
*/
package org.apache.commons.collections.buffer;
import org.apache.commons.collections.AbstractTestObject;
import org.apache.commons.collections.AbstractObjectTest;
import org.apache.commons.collections.Buffer;
import org.apache.commons.collections.BufferUnderflowException;
@ -27,13 +27,13 @@ import java.util.LinkedList;
import java.util.Set;
/**
* Extension of {@link AbstractTestObject} for exercising the
* Extension of {@link AbstractObjectTest} for exercising the
* {@link BlockingBuffer} implementation.
*
* @since 3.0
* @version $Id$
*/
public class BlockingBufferTest<E> extends AbstractTestObject {
public class BlockingBufferTest<E> extends AbstractObjectTest {
public BlockingBufferTest(String testName) {
super(testName);

View File

@ -16,7 +16,7 @@
*/
package org.apache.commons.collections.buffer;
import org.apache.commons.collections.AbstractTestObject;
import org.apache.commons.collections.AbstractObjectTest;
import org.apache.commons.collections.BoundedCollection;
import org.apache.commons.collections.Buffer;
import org.apache.commons.collections.BufferOverflowException;
@ -25,7 +25,7 @@ import java.util.Iterator;
import java.util.Collections;
import java.util.Arrays;
public class BoundedBufferTest<E> extends AbstractTestObject {
public class BoundedBufferTest<E> extends AbstractObjectTest {
public BoundedBufferTest(String testName) {
super(testName);

View File

@ -34,7 +34,7 @@ import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import org.apache.commons.collections.AbstractTestObject;
import org.apache.commons.collections.AbstractObjectTest;
/**
* Abstract test class for {@link java.util.Collection} methods and contracts.
@ -125,7 +125,7 @@ import org.apache.commons.collections.AbstractTestObject;
* @author Neil O'Toole
* @author Stephen Colebourne
*/
public abstract class AbstractCollectionTest<E> extends AbstractTestObject {
public abstract class AbstractCollectionTest<E> extends AbstractObjectTest {
//
// NOTE:

View File

@ -24,7 +24,7 @@ import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import org.apache.commons.collections.AbstractTestObject;
import org.apache.commons.collections.AbstractObjectTest;
import org.junit.Test;
/**
@ -33,7 +33,7 @@ import org.junit.Test;
* Concrete subclasses declare the comparator to be tested.
* They also declare certain aspects of the tests.
*/
public abstract class AbstractComparatorTest<T> extends AbstractTestObject {
public abstract class AbstractComparatorTest<T> extends AbstractObjectTest {
/**
* JUnit constructor.

View File

@ -19,7 +19,7 @@ package org.apache.commons.collections.iterators;
import java.util.Iterator;
import java.util.NoSuchElementException;
import org.apache.commons.collections.AbstractTestObject;
import org.apache.commons.collections.AbstractObjectTest;
/**
* Abstract class for testing the Iterator interface.
@ -35,7 +35,7 @@ import org.apache.commons.collections.AbstractTestObject;
* @author Morgan Delagrange
* @author Stephen Colebourne
*/
public abstract class AbstractTestIterator<E> extends AbstractTestObject {
public abstract class AbstractTestIterator<E> extends AbstractObjectTest {
/**
* JUnit constructor.

View File

@ -29,7 +29,7 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.apache.commons.collections.AbstractTestObject;
import org.apache.commons.collections.AbstractObjectTest;
import org.apache.commons.collections.BulkTest;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.collection.AbstractCollectionTest;
@ -125,7 +125,7 @@ import org.apache.commons.collections.set.AbstractSetTest;
* @author Stephen Colebourne
* @version $Revision$
*/
public abstract class AbstractTestMap<K, V> extends AbstractTestObject {
public abstract class AbstractTestMap<K, V> extends AbstractObjectTest {
/**
* JDK1.2 has bugs in null handling of Maps, especially HashMap.Entry.toString

View File

@ -23,7 +23,7 @@ import java.util.Map;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.apache.commons.collections.AbstractTestObject;
import org.apache.commons.collections.AbstractObjectTest;
import org.apache.commons.collections.IterableMap;
/**
@ -33,7 +33,7 @@ import org.apache.commons.collections.IterableMap;
*
* @author Stephen Colebourne
*/
public class TestIdentityMap<K, V> extends AbstractTestObject {
public class TestIdentityMap<K, V> extends AbstractObjectTest {
private static final Integer I1A = new Integer(1);
private static final Integer I1B = new Integer(1);

View File

@ -28,7 +28,7 @@ import java.util.Map;
import org.apache.commons.collections.IteratorUtils;
import org.apache.commons.collections.MultiMap;
import org.apache.commons.collections.AbstractTestObject;
import org.apache.commons.collections.AbstractObjectTest;
/**
* TestMultiValueMap.
@ -37,7 +37,7 @@ import org.apache.commons.collections.AbstractTestObject;
* @author Stephen Colebourne
* @since Commons Collections 3.2
*/
public class TestMultiValueMap<K, V> extends AbstractTestObject {
public class TestMultiValueMap<K, V> extends AbstractObjectTest {
public TestMultiValueMap(String testName) {
super(testName);