COLLECTIONS-806: Remove use of JUnit4 junit.framework.Test class (#371)

* COLLECTIONS-806: removed references of JUnit4 Test class

- Removed references of junit.framework.Test
- Removed unused method BulkTest.makeSuite()

* COLLECTIONS-806: removed unused imports
This commit is contained in:
Piyush Sagar 2022-12-27 14:42:57 +01:00 committed by GitHub
parent 511d171516
commit b860d0ce3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
58 changed files with 0 additions and 557 deletions

View File

@ -32,10 +32,6 @@ public class ArrayStackTest<E> extends AbstractArrayListTest<E> {
super(ArrayStackTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(ArrayStackTest.class);
}
@Override
public ArrayStack<E> makeObject() {
return new ArrayStack<>();

View File

@ -16,14 +16,6 @@
*/
package org.apache.commons.collections4;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import junit.framework.TestCase;
import junit.framework.TestSuite;
@ -233,261 +225,4 @@ public class BulkTest extends TestCase implements Cloneable {
return getName() + "(" + verboseName + ") ";
}
/**
* Returns a {@link TestSuite} for testing all of the simple tests
* <I>and</I> all the bulk tests defined by the given class.<P>
*
* The class is examined for simple and bulk test methods; any child
* bulk tests are also examined recursively; and the results are stored
* in a hierarchical {@link TestSuite}.<P>
*
* The given class must be a subclass of {@code BulkTest} and must
* not be abstract.<P>
*
* @param c the class to examine for simple and bulk tests
* @return a {@link TestSuite} containing all the simple and bulk tests
* defined by that class
*/
public static TestSuite makeSuite(final Class<? extends BulkTest> c) {
if (Modifier.isAbstract(c.getModifiers())) {
throw new IllegalArgumentException("Class must not be abstract.");
}
if (!BulkTest.class.isAssignableFrom(c)) {
throw new IllegalArgumentException("Class must extend BulkTest.");
}
return new BulkTestSuiteMaker(c).make();
}
}
// It was easier to use a separate class to do all the reflection stuff
// for making the TestSuite instances. Having permanent state around makes
// it easier to handle the recursion.
class BulkTestSuiteMaker {
/** The class that defines simple and bulk tests methods. */
private final Class<? extends BulkTest> startingClass;
/** List of ignored simple test names. */
private List<String> ignored;
/** The TestSuite we're currently populating. Can change over time. */
private TestSuite result;
/**
* The prefix for simple test methods. Used to check if a test is in
* the ignored list.
*/
private String prefix;
/**
* Constructor.
*
* @param startingClass the starting class
*/
BulkTestSuiteMaker(final Class<? extends BulkTest> startingClass) {
this.startingClass = startingClass;
}
/**
* Makes a hierarchical TestSuite based on the starting class.
*
* @return the hierarchical TestSuite for startingClass
*/
public TestSuite make() {
this.result = new TestSuite();
this.prefix = getBaseName(startingClass);
result.setName(prefix);
final BulkTest bulk = makeFirstTestCase(startingClass);
ignored = new ArrayList<>();
final String[] s = bulk.ignoredTests();
if (s != null) {
ignored.addAll(Arrays.asList(s));
}
make(bulk);
return result;
}
/**
* Appends all the simple tests and bulk tests defined by the given
* instance's class to the current TestSuite.
*
* @param bulk An instance of the class that defines simple and bulk
* tests for us to append
*/
void make(final BulkTest bulk) {
final Class<? extends BulkTest> c = bulk.getClass();
final Method[] all = c.getMethods();
for (final Method element : all) {
if (isTest(element)) {
addTest(bulk, element);
}
if (isBulk(element)) {
addBulk(bulk, element);
}
}
}
/**
* Adds the simple test defined by the given method to the TestSuite.
*
* @param bulk The instance of the class that defined the method
* (I know it's weird. But the point is, we can clone the instance
* and not have to worry about constructors.)
* @param m The simple test method
*/
void addTest(final BulkTest bulk, final Method m) {
final BulkTest bulk2 = (BulkTest) bulk.clone();
bulk2.setName(m.getName());
bulk2.verboseName = prefix + "." + m.getName();
if (ignored.contains(bulk2.verboseName)) {
return;
}
result.addTest(bulk2);
}
/**
* Adds a whole new suite of tests that are defined by the result of
* the given bulk test method. In other words, the given bulk test
* method is invoked, and the resulting BulkTest instance is examined
* for yet more simple and bulk tests.
*
* @param bulk The instance of the class that defined the method
* @param m The bulk test method
*/
void addBulk(final BulkTest bulk, final Method m) {
final String verboseName = prefix + "." + m.getName();
if (ignored.contains(verboseName)) {
return;
}
final BulkTest bulk2;
try {
bulk2 = (BulkTest) m.invoke(bulk, (Object[]) null);
if (bulk2 == null) {
return;
}
} catch (final InvocationTargetException ex) {
ex.getTargetException().printStackTrace();
throw new Error(); // FIXME;
} catch (final IllegalAccessException ex) {
ex.printStackTrace();
throw new Error(); // FIXME;
}
// Save current state on the stack.
final String oldPrefix = prefix;
final TestSuite oldResult = result;
prefix = prefix + "." + m.getName();
result = new TestSuite();
result.setName(m.getName());
make(bulk2);
oldResult.addTest(result);
// Restore the old state
prefix = oldPrefix;
result = oldResult;
}
/**
* Returns the base name of the given class.
*
* @param c the class
* @return the name of that class, minus any package names
*/
private static String getBaseName(final Class<?> c) {
String name = c.getName();
final int p = name.lastIndexOf('.');
if (p > 0) {
name = name.substring(p + 1);
}
return name;
}
// These three methods are used to create a valid BulkTest instance
// from a class.
private static <T> Constructor<T> getTestCaseConstructor(final Class<T> c) {
try {
return c.getConstructor();
} catch (final NoSuchMethodException e) {
throw new IllegalArgumentException(c + " must provide an empty constructor");
}
}
private static <T extends BulkTest> BulkTest makeTestCase(final Class<T> c, final Method m) {
final Constructor<T> con = getTestCaseConstructor(c);
try {
return con.newInstance();
} catch (final InvocationTargetException e) {
e.printStackTrace();
throw new RuntimeException(); // FIXME;
} catch (final IllegalAccessException e) {
throw new Error(); // should never occur
} catch (final InstantiationException e) {
throw new RuntimeException(); // FIXME;
}
}
private static <T extends BulkTest> BulkTest makeFirstTestCase(final Class<T> c) {
final Method[] all = c.getMethods();
for (final Method element : all) {
if (isTest(element)) {
return makeTestCase(c, element);
}
}
throw new IllegalArgumentException(c.getName() + " must provide at least one test method.");
}
/**
* Returns true if the given method is a simple test method.
*/
private static boolean isTest(final Method m) {
if (!m.getName().startsWith("test")) {
return false;
}
if (m.getReturnType() != Void.TYPE) {
return false;
}
if (m.getParameterTypes().length != 0) {
return false;
}
final int mods = m.getModifiers();
if (Modifier.isStatic(mods)) {
return false;
}
if (Modifier.isAbstract(mods)) {
return false;
}
return true;
}
/**
* Returns true if the given method is a bulk test method.
*/
private static boolean isBulk(final Method m) {
if (!m.getName().startsWith("bulkTest")) {
return false;
}
if (m.getReturnType() != BulkTest.class) {
return false;
}
if (m.getParameterTypes().length != 0) {
return false;
}
final int mods = m.getModifiers();
if (Modifier.isStatic(mods)) {
return false;
}
if (Modifier.isAbstract(mods)) {
return false;
}
return true;
}
}

View File

@ -17,7 +17,6 @@
package org.apache.commons.collections4.bag;
import org.apache.commons.collections4.Bag;
import org.apache.commons.collections4.BulkTest;
/**
* Extension of {@link AbstractBagTest} for exercising the {@link HashBag}
@ -30,11 +29,6 @@ public class HashBagTest<T> extends AbstractBagTest<T> {
super(HashBagTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(HashBagTest.class);
}
@Override
public Bag<T> makeObject() {
return new HashBag<>();

View File

@ -21,7 +21,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.Set;
import org.apache.commons.collections4.Bag;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.Predicate;
import org.apache.commons.collections4.functors.TruePredicate;
import org.junit.jupiter.api.Test;
@ -38,10 +37,6 @@ public class PredicatedBagTest<T> extends AbstractBagTest<T> {
super(PredicatedBagTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(PredicatedBagTest.class);
}
protected Predicate<T> stringPredicate() {
return o -> o instanceof String;
}

View File

@ -20,7 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.Comparator;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.Predicate;
import org.apache.commons.collections4.SortedBag;
import org.apache.commons.collections4.functors.TruePredicate;
@ -40,10 +39,6 @@ public class PredicatedSortedBagTest<T> extends AbstractSortedBagTest<T> {
super(PredicatedSortedBagTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(PredicatedSortedBagTest.class);
}
protected Predicate<T> stringPredicate() {
return o -> o instanceof String;
}

View File

@ -17,7 +17,6 @@
package org.apache.commons.collections4.bag;
import org.apache.commons.collections4.Bag;
import org.apache.commons.collections4.BulkTest;
/**
* Extension of {@link AbstractBagTest} for exercising the {@link SynchronizedBag}
@ -31,10 +30,6 @@ public class SynchronizedBagTest<T> extends AbstractBagTest<T> {
super(SynchronizedBagTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(SynchronizedBagTest.class);
}
@Override
public Bag<T> makeObject() {

View File

@ -17,7 +17,6 @@
package org.apache.commons.collections4.bag;
import org.apache.commons.collections4.Bag;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.Transformer;
import org.apache.commons.collections4.collection.TransformedCollectionTest;
import org.junit.jupiter.api.Test;
@ -34,11 +33,6 @@ public class TransformedBagTest<T> extends AbstractBagTest<T> {
super(TransformedBagTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(TransformedBagTest.class);
}
@Override
@SuppressWarnings("unchecked")
public Bag<T> makeObject() {

View File

@ -16,7 +16,6 @@
*/
package org.apache.commons.collections4.bag;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.SortedBag;
import org.apache.commons.collections4.Transformer;
import org.apache.commons.collections4.collection.TransformedCollectionTest;
@ -34,11 +33,6 @@ public class TransformedSortedBagTest<T> extends AbstractSortedBagTest<T> {
super(TransformedSortedBagTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(TransformedSortedBagTest.class);
}
@Override
@SuppressWarnings("unchecked")
public SortedBag<T> makeObject() {

View File

@ -19,7 +19,6 @@ package org.apache.commons.collections4.bag;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.apache.commons.collections4.Bag;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.SortedBag;
import org.junit.jupiter.api.Test;
@ -33,10 +32,6 @@ public class TreeBagTest<T> extends AbstractSortedBagTest<T> {
super(TreeBagTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(TreeBagTest.class);
}
@Override
public SortedBag<T> makeObject() {
return new TreeBag<>();

View File

@ -21,7 +21,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.Arrays;
import org.apache.commons.collections4.Bag;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.Unmodifiable;
import org.apache.commons.collections4.collection.AbstractCollectionTest;
import org.junit.jupiter.api.Test;
@ -38,10 +37,6 @@ public class UnmodifiableBagTest<E> extends AbstractBagTest<E> {
super(UnmodifiableBagTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(UnmodifiableBagTest.class);
}
@Override
public Bag<E> makeObject() {
return UnmodifiableBag.unmodifiableBag(new HashBag<E>());

View File

@ -20,7 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.Arrays;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.SortedBag;
import org.apache.commons.collections4.Unmodifiable;
import org.apache.commons.collections4.collection.AbstractCollectionTest;
@ -38,10 +37,6 @@ public class UnmodifiableSortedBagTest<E> extends AbstractSortedBagTest<E> {
super(UnmodifiableSortedBagTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(UnmodifiableSortedBagTest.class);
}
@Override
public SortedBag<E> makeObject() {
return UnmodifiableSortedBag.unmodifiableSortedBag(new TreeBag<E>());

View File

@ -16,7 +16,6 @@
*/
package org.apache.commons.collections4.bidimap;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.collection.AbstractCollectionTest;
/**
@ -24,10 +23,6 @@ import org.apache.commons.collections4.collection.AbstractCollectionTest;
*/
public class DualHashBidiMapTest<K, V> extends AbstractBidiMapTest<K, V> {
public static junit.framework.Test suite() {
return BulkTest.makeSuite(DualHashBidiMapTest.class);
}
public DualHashBidiMapTest() {
super(DualHashBidiMapTest.class.getSimpleName());
}

View File

@ -16,18 +16,12 @@
*/
package org.apache.commons.collections4.bidimap;
import org.apache.commons.collections4.BulkTest;
/**
* JUnit tests.
*
*/
public class DualLinkedHashBidiMapTest<K, V> extends AbstractBidiMapTest<K, V> {
public static junit.framework.Test suite() {
return BulkTest.makeSuite(DualLinkedHashBidiMapTest.class);
}
public DualLinkedHashBidiMapTest() {
super(DualLinkedHashBidiMapTest.class.getSimpleName());
}

View File

@ -27,7 +27,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.TreeMap;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.SortedBidiMap;
import org.apache.commons.collections4.comparators.ComparableComparator;
import org.apache.commons.collections4.comparators.ReverseComparator;
@ -40,10 +39,6 @@ import org.junit.jupiter.api.Test;
@SuppressWarnings("boxing")
public class DualTreeBidiMap2Test<K extends Comparable<K>, V extends Comparable<V>> extends AbstractSortedBidiMapTest<K, V> {
public static junit.framework.Test suite() {
return BulkTest.makeSuite(DualTreeBidiMap2Test.class);
}
public DualTreeBidiMap2Test() {
super(DualTreeBidiMap2Test.class.getSimpleName());
}

View File

@ -16,18 +16,12 @@
*/
package org.apache.commons.collections4.bidimap;
import org.apache.commons.collections4.BulkTest;
/**
* JUnit tests.
*
*/
public class DualTreeBidiMapTest<K extends Comparable<K>, V extends Comparable<V>> extends AbstractSortedBidiMapTest<K, V> {
public static junit.framework.Test suite() {
return BulkTest.makeSuite(DualTreeBidiMapTest.class);
}
public DualTreeBidiMapTest() {
super(DualTreeBidiMapTest.class.getSimpleName());
}

View File

@ -19,7 +19,6 @@ package org.apache.commons.collections4.bidimap;
import java.util.TreeMap;
import org.apache.commons.collections4.BidiMap;
import org.apache.commons.collections4.BulkTest;
/**
* JUnit tests.
@ -27,10 +26,6 @@ import org.apache.commons.collections4.BulkTest;
*/
public class TreeBidiMapTest<K extends Comparable<K>, V extends Comparable<V>> extends AbstractOrderedBidiMapTest<K, V> {
public static junit.framework.Test suite() {
return BulkTest.makeSuite(TreeBidiMapTest.class);
}
public TreeBidiMapTest() {
super(TreeBidiMapTest.class.getSimpleName());
}

View File

@ -22,7 +22,6 @@ import java.util.HashMap;
import java.util.Map;
import org.apache.commons.collections4.BidiMap;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.Unmodifiable;
import org.apache.commons.collections4.collection.AbstractCollectionTest;
import org.junit.jupiter.api.Test;
@ -32,10 +31,6 @@ import org.junit.jupiter.api.Test;
*/
public class UnmodifiableBidiMapTest<K, V> extends AbstractBidiMapTest<K, V> {
public static junit.framework.Test suite() {
return BulkTest.makeSuite(UnmodifiableBidiMapTest.class);
}
public UnmodifiableBidiMapTest() {
super(UnmodifiableBidiMapTest.class.getSimpleName());
}

View File

@ -21,7 +21,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.Map;
import java.util.TreeMap;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.OrderedBidiMap;
import org.apache.commons.collections4.Unmodifiable;
import org.junit.jupiter.api.Test;
@ -31,10 +30,6 @@ import org.junit.jupiter.api.Test;
*/
public class UnmodifiableOrderedBidiMapTest<K extends Comparable<K>, V extends Comparable<V>> extends AbstractOrderedBidiMapTest<K, V> {
public static junit.framework.Test suite() {
return BulkTest.makeSuite(UnmodifiableOrderedBidiMapTest.class);
}
public UnmodifiableOrderedBidiMapTest() {
super(UnmodifiableOrderedBidiMapTest.class.getSimpleName());
}

View File

@ -21,7 +21,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.SortedMap;
import java.util.TreeMap;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.SortedBidiMap;
import org.apache.commons.collections4.Unmodifiable;
import org.junit.jupiter.api.Test;
@ -31,10 +30,6 @@ import org.junit.jupiter.api.Test;
*/
public class UnmodifiableSortedBidiMapTest<K extends Comparable<K>, V extends Comparable<V>> extends AbstractSortedBidiMapTest<K, V> {
public static junit.framework.Test suite() {
return BulkTest.makeSuite(UnmodifiableSortedBidiMapTest.class);
}
public UnmodifiableSortedBidiMapTest() {
super(UnmodifiableSortedBidiMapTest.class.getSimpleName());
}

View File

@ -20,8 +20,6 @@ import java.util.Comparator;
import java.util.LinkedList;
import java.util.List;
import junit.framework.TestSuite;
/**
* Test the NullComparator.
*
@ -32,13 +30,6 @@ public abstract class AbstractNullComparatorTest extends AbstractComparatorTest<
super(testName);
}
public static junit.framework.Test suite() {
final TestSuite suite = new TestSuite(AbstractNullComparatorTest.class.getName());
suite.addTest(new TestSuite(TestNullComparator1.class));
suite.addTest(new TestSuite(TestNullComparator2.class));
return suite;
}
/**
* Test the NullComparator with nulls high, using comparable comparator
**/

View File

@ -29,10 +29,6 @@ import org.junit.jupiter.api.Test;
*/
public class IteratorIterableTest extends BulkTest {
public static junit.framework.Test suite() {
return BulkTest.makeSuite(IteratorIterableTest.class);
}
public IteratorIterableTest() {
super(IteratorIterableTest.class.getSimpleName());
}

View File

@ -28,7 +28,6 @@ import java.util.List;
import java.util.ListIterator;
import java.util.NoSuchElementException;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.lang3.ArrayUtils;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@ -41,11 +40,6 @@ public class CursorableLinkedListTest<E> extends AbstractLinkedListTest<E> {
public CursorableLinkedListTest() {
super(CursorableLinkedListTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(CursorableLinkedListTest.class);
}
private CursorableLinkedList<E> list;
@Override

View File

@ -19,7 +19,6 @@ package org.apache.commons.collections4.list;
import java.util.Arrays;
import java.util.LinkedList;
import org.apache.commons.collections4.BulkTest;
import org.junit.jupiter.api.Test;
/**
@ -32,10 +31,6 @@ public class NodeCachingLinkedListTest<E> extends AbstractLinkedListTest<E> {
super(NodeCachingLinkedListTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(NodeCachingLinkedListTest.class);
}
@Override
public NodeCachingLinkedList<E> makeObject() {
return new NodeCachingLinkedList<>();

View File

@ -20,7 +20,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import org.apache.commons.collections4.BulkTest;
import org.junit.jupiter.api.Test;
/**
@ -47,10 +46,6 @@ public class TreeListTest<E> extends AbstractListTest<E> {
// benchmark(new NodeCachingLinkedList());
// }
public static junit.framework.Test suite() {
return BulkTest.makeSuite(TreeListTest.class);
}
public static void benchmark(final List<? super Integer> l) {
long startMillis = System.currentTimeMillis();
for (int i = 0; i < 100000; i++) {

View File

@ -21,7 +21,6 @@ import java.util.Locale;
import java.util.Map;
import java.util.Set;
import org.apache.commons.collections4.BulkTest;
import org.junit.jupiter.api.Test;
/**
@ -30,10 +29,6 @@ import org.junit.jupiter.api.Test;
*/
public class CaseInsensitiveMapTest<K, V> extends AbstractIterableMapTest<K, V> {
public static junit.framework.Test suite() {
return BulkTest.makeSuite(CaseInsensitiveMapTest.class);
}
public CaseInsensitiveMapTest() {
super(CaseInsensitiveMapTest.class.getSimpleName());
}

View File

@ -19,8 +19,6 @@ package org.apache.commons.collections4.map;
import java.util.SortedMap;
import java.util.TreeMap;
import org.apache.commons.collections4.BulkTest;
/**
* Extension of {@link AbstractSortedMapTest} for exercising the {@link FixedSizeSortedMap}
* implementation.
@ -33,10 +31,6 @@ public class FixedSizeSortedMapTest<K, V> extends AbstractSortedMapTest<K, V> {
super(FixedSizeSortedMapTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(FixedSizeSortedMapTest.class);
}
@Override
public SortedMap<K, V> makeObject() {
return FixedSizeSortedMap.fixedSizeSortedMap(new TreeMap<K, V>());

View File

@ -48,10 +48,6 @@ public class Flat3MapTest<K, V> extends AbstractIterableMapTest<K, V> {
super(Flat3MapTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(Flat3MapTest.class);
}
@Override
public Flat3Map<K, V> makeObject() {
return new Flat3Map<>();

View File

@ -16,7 +16,6 @@
*/
package org.apache.commons.collections4.map;
import org.apache.commons.collections4.BulkTest;
import org.junit.jupiter.api.Test;
/**
@ -29,10 +28,6 @@ public class HashedMapTest<K, V> extends AbstractIterableMapTest<K, V> {
super(HashedMapTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(HashedMapTest.class);
}
@Override
public HashedMap<K, V> makeObject() {
return new HashedMap<>();

View File

@ -25,7 +25,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.MapIterator;
import org.apache.commons.collections4.OrderedMap;
import org.apache.commons.collections4.ResettableIterator;
@ -39,11 +38,6 @@ public class LRUMapTest<K, V> extends AbstractOrderedMapTest<K, V> {
public LRUMapTest() {
super(LRUMapTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(LRUMapTest.class);
}
@Override
public LRUMap<K, V> makeObject() {
return new LRUMap<>();

View File

@ -38,10 +38,6 @@ public class LinkedMapTest<K, V> extends AbstractOrderedMapTest<K, V> {
super(LinkedMapTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(LinkedMapTest.class);
}
@Override
public LinkedMap<K, V> makeObject() {
return new LinkedMap<>();

View File

@ -36,10 +36,6 @@ public class ListOrderedMap2Test<K, V> extends AbstractOrderedMapTest<K, V> {
super(ListOrderedMap2Test.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(ListOrderedMap2Test.class);
}
@Override
public ListOrderedMap<K, V> makeObject() {
return new ListOrderedMap<>();

View File

@ -42,10 +42,6 @@ public class ListOrderedMapTest<K, V> extends AbstractOrderedMapTest<K, V> {
super(ListOrderedMapTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(ListOrderedMapTest.class);
}
@Override
public ListOrderedMap<K, V> makeObject() {
return ListOrderedMap.listOrderedMap(new HashMap<K, V>());

View File

@ -20,7 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.Map;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.MapIterator;
import org.apache.commons.collections4.keyvalue.MultiKey;
import org.junit.jupiter.api.Test;
@ -43,10 +42,6 @@ public class MultiKeyMapTest<K, V> extends AbstractIterableMapTest<MultiKey<? ex
super(MultiKeyMapTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(MultiKeyMapTest.class);
}
@Override
public MultiKeyMap<K, V> makeObject() {
return new MultiKeyMap<>();

View File

@ -23,7 +23,6 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.collection.AbstractCollectionTest;
import org.apache.commons.collections4.map.PassiveExpiringMap.ExpirationPolicy;
import org.junit.jupiter.api.Test;
@ -55,10 +54,6 @@ public class PassiveExpiringMapTest<K, V> extends AbstractMapTest<K, V> {
}
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(PassiveExpiringMapTest.class);
}
public PassiveExpiringMapTest() {
super(PassiveExpiringMapTest.class.getSimpleName());
}

View File

@ -22,7 +22,6 @@ import java.lang.ref.WeakReference;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.IterableMap;
import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
import org.junit.jupiter.api.Test;
@ -48,10 +47,6 @@ public class ReferenceIdentityMapTest<K, V> extends AbstractIterableMapTest<K, V
}
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(ReferenceIdentityMapTest.class);
}
WeakReference<K> keyReference;
WeakReference<V> valueReference;

View File

@ -31,7 +31,6 @@ import java.util.List;
import java.util.Map;
import java.util.function.Consumer;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.map.AbstractHashedMap.HashEntry;
import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceEntry;
import org.apache.commons.collections4.map.AbstractReferenceMap.ReferenceStrength;
@ -46,10 +45,6 @@ public class ReferenceMapTest<K, V> extends AbstractIterableMapTest<K, V> {
super(ReferenceMapTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(ReferenceMapTest.class);
}
@Override
public ReferenceMap<K, V> makeObject() {
return new ReferenceMap<>(ReferenceStrength.WEAK, ReferenceStrength.WEAK);

View File

@ -19,7 +19,6 @@ package org.apache.commons.collections4.map;
import java.util.HashMap;
import org.apache.commons.collections4.BoundedMap;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.KeyValue;
import org.apache.commons.collections4.OrderedMap;
import org.junit.jupiter.api.Test;
@ -38,10 +37,6 @@ public class SingletonMapTest<K, V> extends AbstractOrderedMapTest<K, V> {
super(SingletonMapTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(SingletonMapTest.class);
}
@Override
public OrderedMap<K, V> makeObject() {
// need an empty singleton map, but that's not possible

View File

@ -16,7 +16,6 @@
*/
package org.apache.commons.collections4.map;
import org.apache.commons.collections4.BulkTest;
import org.junit.jupiter.api.Test;
/**
@ -30,10 +29,6 @@ public class StaticBucketMapTest<K, V> extends AbstractIterableMapTest<K, V> {
super(StaticBucketMapTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(StaticBucketMapTest.class);
}
@Override
public StaticBucketMap<K, V> makeObject() {
return new StaticBucketMap<>(30);

View File

@ -23,7 +23,6 @@ import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.Transformer;
import org.apache.commons.collections4.TransformerUtils;
import org.apache.commons.collections4.collection.TransformedCollectionTest;
@ -41,10 +40,6 @@ public class TransformedSortedMapTest<K, V> extends AbstractSortedMapTest<K, V>
super(TransformedSortedMapTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(TransformedSortedMapTest.class);
}
@Override
public String[] ignoredTests() {
return null;

View File

@ -23,7 +23,6 @@ import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.ListValuedMap;
import org.apache.commons.collections4.MultiValuedMap;
import org.apache.commons.collections4.collection.AbstractCollectionTest;
@ -40,10 +39,6 @@ public class ArrayListValuedHashMapTest<K, V> extends AbstractMultiValuedMapTest
super(ArrayListValuedHashMapTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(ArrayListValuedHashMapTest.class);
}
@Override
public ListValuedMap<K, V> makeObject() {
return new ArrayListValuedHashMap<>();

View File

@ -21,7 +21,6 @@ import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.MultiValuedMap;
import org.apache.commons.collections4.SetValuedMap;
import org.apache.commons.collections4.collection.AbstractCollectionTest;
@ -38,10 +37,6 @@ public class HashSetValuedHashMapTest<K, V> extends AbstractMultiValuedMapTest<K
super(HashSetValuedHashMapTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(HashSetValuedHashMapTest.class);
}
@Override
public SetValuedMap<K, V> makeObject() {
return new HashSetValuedHashMap<>();

View File

@ -18,7 +18,6 @@ package org.apache.commons.collections4.multimap;
import java.util.Collection;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.MultiValuedMap;
import org.apache.commons.collections4.Transformer;
import org.apache.commons.collections4.TransformerUtils;
@ -37,10 +36,6 @@ public class TransformedMultiValuedMapTest<K, V> extends AbstractMultiValuedMapT
super(TransformedMultiValuedMapTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(TransformedMultiValuedMapTest.class);
}
@Override
public MultiValuedMap<K, V> makeObject() {
return TransformedMultiValuedMap.transformingMap(new ArrayListValuedHashMap<K, V>(),

View File

@ -26,7 +26,6 @@ import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.MapIterator;
import org.apache.commons.collections4.MultiSet;
import org.apache.commons.collections4.MultiValuedMap;
@ -45,10 +44,6 @@ public class UnmodifiableMultiValuedMapTest<K, V> extends AbstractMultiValuedMap
super(UnmodifiableMultiValuedMapTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(UnmodifiableMultiValuedMapTest.class);
}
/**
* Assert the given map contains all added values after it was initialized
* with makeFullMap(). See COLLECTIONS-769.

View File

@ -16,7 +16,6 @@
*/
package org.apache.commons.collections4.multiset;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.MultiSet;
/**
@ -31,11 +30,6 @@ public class HashMultiSetTest<T> extends AbstractMultiSetTest<T> {
super(HashMultiSetTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(HashMultiSetTest.class);
}
@Override
public MultiSet<T> makeObject() {
return new HashMultiSet<>();

View File

@ -20,7 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.Set;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.MultiSet;
import org.apache.commons.collections4.Predicate;
import org.apache.commons.collections4.functors.TruePredicate;
@ -38,10 +37,6 @@ public class PredicatedMultiSetTest<T> extends AbstractMultiSetTest<T> {
super(PredicatedMultiSetTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(PredicatedMultiSetTest.class);
}
protected Predicate<T> stringPredicate() {
return o -> o instanceof String;
}

View File

@ -16,7 +16,6 @@
*/
package org.apache.commons.collections4.multiset;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.MultiSet;
/**
@ -31,11 +30,6 @@ public class SynchronizedMultiSetTest<T> extends AbstractMultiSetTest<T> {
super(SynchronizedMultiSetTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(SynchronizedMultiSetTest.class);
}
@Override
public MultiSet<T> makeObject() {
return SynchronizedMultiSet.synchronizedMultiSet(new HashMultiSet<T>());

View File

@ -20,7 +20,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
import java.util.Arrays;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.MultiSet;
import org.apache.commons.collections4.Unmodifiable;
import org.junit.jupiter.api.Test;
@ -37,10 +36,6 @@ public class UnmodifiableMultiSetTest<E> extends AbstractMultiSetTest<E> {
super(UnmodifiableMultiSetTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(UnmodifiableMultiSetTest.class);
}
@Override
public MultiSet<E> makeObject() {
return UnmodifiableMultiSet.unmodifiableMultiSet(new HashMultiSet<E>());

View File

@ -30,10 +30,6 @@ import org.junit.jupiter.api.Test;
*/
public class SynchronizedQueueTest<T> extends AbstractQueueTest<T> {
public static junit.framework.Test suite() {
return BulkTest.makeSuite(SynchronizedQueueTest.class);
}
public SynchronizedQueueTest() {
super(SynchronizedQueueTest.class.getSimpleName());
}

View File

@ -24,7 +24,6 @@ import java.util.NavigableSet;
import java.util.Set;
import java.util.TreeSet;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.Predicate;
import org.apache.commons.collections4.functors.TruePredicate;
import org.junit.jupiter.api.Test;
@ -41,10 +40,6 @@ public class PredicatedNavigableSetTest<E> extends AbstractNavigableSetTest<E> {
super(PredicatedNavigableSetTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(PredicatedNavigableSetTest.class);
}
protected Predicate<E> truePredicate = TruePredicate.<E>truePredicate();
@Override

View File

@ -24,7 +24,6 @@ import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.Predicate;
import org.apache.commons.collections4.functors.TruePredicate;
import org.junit.jupiter.api.Test;
@ -41,10 +40,6 @@ public class PredicatedSortedSetTest<E> extends AbstractSortedSetTest<E> {
super(PredicatedSortedSetTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(PredicatedSortedSetTest.class);
}
protected Predicate<E> truePredicate = TruePredicate.<E>truePredicate();
@Override

View File

@ -22,7 +22,6 @@ import java.util.NavigableSet;
import java.util.Set;
import java.util.TreeSet;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.Transformer;
import org.apache.commons.collections4.collection.TransformedCollectionTest;
import org.junit.jupiter.api.Test;
@ -39,10 +38,6 @@ public class TransformedNavigableSetTest<E> extends AbstractNavigableSetTest<E>
super(TransformedNavigableSetTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(TransformedNavigableSetTest.class);
}
@Override
@SuppressWarnings("unchecked")
public NavigableSet<E> makeObject() {

View File

@ -22,7 +22,6 @@ import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.Transformer;
import org.apache.commons.collections4.collection.TransformedCollectionTest;
import org.junit.jupiter.api.Test;
@ -39,10 +38,6 @@ public class TransformedSortedSetTest<E> extends AbstractSortedSetTest<E> {
super(TransformedSortedSetTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(TransformedSortedSetTest.class);
}
@Override
@SuppressWarnings("unchecked")
public SortedSet<E> makeObject() {

View File

@ -25,7 +25,6 @@ import java.util.NavigableSet;
import java.util.Set;
import java.util.TreeSet;
import org.apache.commons.collections4.BulkTest;
import org.junit.jupiter.api.Test;
/**
@ -42,10 +41,6 @@ public class UnmodifiableNavigableSetTest<E> extends AbstractNavigableSetTest<E>
super(UnmodifiableNavigableSetTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(UnmodifiableNavigableSetTest.class);
}
@Override
public NavigableSet<E> makeObject() {
return UnmodifiableNavigableSet.unmodifiableNavigableSet(new TreeSet<>());

View File

@ -22,7 +22,6 @@ import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.Unmodifiable;
import org.junit.jupiter.api.Test;
@ -38,10 +37,6 @@ public class UnmodifiableSetTest<E> extends AbstractSetTest<E> {
super(UnmodifiableSetTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(UnmodifiableSetTest.class);
}
@Override
public Set<E> makeObject() {
return UnmodifiableSet.unmodifiableSet(new HashSet<E>());

View File

@ -26,7 +26,6 @@ import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import org.apache.commons.collections4.BulkTest;
import org.junit.jupiter.api.Test;
/**
@ -43,10 +42,6 @@ public class UnmodifiableSortedSetTest<E> extends AbstractSortedSetTest<E> {
super(UnmodifiableSortedSetTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(UnmodifiableSortedSetTest.class);
}
@Override
public SortedSet<E> makeObject() {
return UnmodifiableSortedSet.unmodifiableSortedSet(new TreeSet<E>());

View File

@ -16,7 +16,6 @@
*/
package org.apache.commons.collections4.trie;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.OrderedMap;
import org.apache.commons.collections4.map.AbstractOrderedMapTest;
@ -31,10 +30,6 @@ public class PatriciaTrie2Test<V> extends AbstractOrderedMapTest<String, V> {
super(PatriciaTrie2Test.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(PatriciaTrie2Test.class);
}
@Override
public OrderedMap<String, V> makeObject() {
return new PatriciaTrie<>();

View File

@ -26,7 +26,6 @@ import java.util.NoSuchElementException;
import java.util.Set;
import java.util.SortedMap;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.Trie;
import org.apache.commons.collections4.map.AbstractSortedMapTest;
import org.junit.jupiter.api.Assertions;
@ -43,10 +42,6 @@ public class PatriciaTrieTest<V> extends AbstractSortedMapTest<String, V> {
super(PatriciaTrieTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(PatriciaTrieTest.class);
}
@Override
public SortedMap<String, V> makeObject() {
return new PatriciaTrie<>();

View File

@ -18,7 +18,6 @@ package org.apache.commons.collections4.trie;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.apache.commons.collections4.BulkTest;
import org.apache.commons.collections4.Trie;
import org.apache.commons.collections4.Unmodifiable;
import org.apache.commons.collections4.map.AbstractSortedMapTest;
@ -36,10 +35,6 @@ public class UnmodifiableTrieTest<V> extends AbstractSortedMapTest<String, V> {
super(UnmodifiableTrieTest.class.getSimpleName());
}
public static junit.framework.Test suite() {
return BulkTest.makeSuite(UnmodifiableTrieTest.class);
}
@Override
public Trie<String, V> makeObject() {
return UnmodifiableTrie.unmodifiableTrie(new PatriciaTrie<V>());