Skip to content

Commit aa13ed3

Browse files
committed
[COLLECTIONS-777] Migrate to JUnit 5
Remove JUnit 3 constructors
1 parent d2d894e commit aa13ed3

File tree

169 files changed

+18
-896
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

169 files changed

+18
-896
lines changed

src/test/java/org/apache/commons/collections4/AbstractArrayListTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@
3030
*/
3131
public abstract class AbstractArrayListTest<E> extends AbstractListTest<E> {
3232

33-
public AbstractArrayListTest(final String testName) {
34-
super(testName);
35-
}
36-
3733
/**
3834
* {@inheritDoc}
3935
*/

src/test/java/org/apache/commons/collections4/AbstractLinkedListTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@
4040
*/
4141
public abstract class AbstractLinkedListTest<T> extends AbstractListTest<T> {
4242

43-
public AbstractLinkedListTest(final String testName) {
44-
super(testName);
45-
}
46-
4743
/**
4844
* Returns the {@link #collection} field cast to a {@link LinkedList}.
4945
*

src/test/java/org/apache/commons/collections4/AbstractObjectTest.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,6 @@ public abstract class AbstractObjectTest extends BulkTest {
4949
/** Current major release for Collections */
5050
public static final int COLLECTIONS_MAJOR_VERSION = 4;
5151

52-
/**
53-
* JUnit constructor.
54-
*
55-
* @param testName the test class name
56-
*/
57-
public AbstractObjectTest(final String testName) {
58-
super(testName);
59-
}
60-
6152
protected String getCanonicalEmptyCollectionName(final Object object) {
6253
final StringBuilder retval = new StringBuilder();
6354
retval.append(TEST_DATA_PATH);

src/test/java/org/apache/commons/collections4/AbstractTreeMapTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
*/
3333
public abstract class AbstractTreeMapTest<K, V> extends AbstractMapTest<TreeMap<K, V>, K, V> {
3434

35-
public AbstractTreeMapTest(final String testName) {
36-
super(testName);
37-
}
38-
3935
@Override
4036
public boolean isAllowNullKey() {
4137
return false;

src/test/java/org/apache/commons/collections4/ArrayStackTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@
3131
@SuppressWarnings("deprecation") // we test a deprecated class
3232
public class ArrayStackTest<E> extends AbstractArrayListTest<E> {
3333

34-
public ArrayStackTest() {
35-
super(ArrayStackTest.class.getSimpleName());
36-
}
37-
3834
@Override
3935
public String getCompatibilityVersion() {
4036
return "4";

src/test/java/org/apache/commons/collections4/BulkTest.java

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,18 @@
1616
*/
1717
package org.apache.commons.collections4;
1818

19-
import junit.framework.TestCase;
20-
import junit.framework.TestSuite;
21-
2219
/**
23-
* A {@link TestCase} that can define both simple and bulk test methods.
20+
* A {@code TestCase} that can define both simple and bulk test methods.
2421
* <p>
2522
* A <em>simple test method</em> is the type of test traditionally
26-
* supplied by {@link TestCase}. To define a simple test, create a public
23+
* supplied by {@code TestCase}. To define a simple test, create a public
2724
* no-argument method whose name starts with "test". You can specify
2825
* the name of simple test in the constructor of {@code BulkTest};
29-
* a subsequent call to {@link TestCase#run} will run that simple test.
26+
* a subsequent call to {@code TestCase#run} will run that simple test.
3027
* <p>
3128
* A <em>bulk test method</em>, on the other hand, returns a new instance
3229
* of {@code BulkTest}, which can itself define new simple and bulk
33-
* test methods. By using the {@link #makeSuite} method, you can
30+
* test methods. By using the {@code #makeSuite} method, you can
3431
* automatically create a hierarchical suite of tests and child bulk tests.
3532
* <p>
3633
* For instance, consider the following two classes:
@@ -121,11 +118,11 @@
121118
* A subclass can override a superclass's bulk test by
122119
* returning {@code null} from the bulk test method. If you only
123120
* want to override specific simple tests within a bulk test, use the
124-
* {@link #ignoredTests} method.<P>
121+
* {@code #ignoredTests} method.<P>
125122
*
126123
* Note that if you want to use the bulk test methods, you <em>must</em>
127-
* define your {@code suite()} method to use {@link #makeSuite}.
128-
* The ordinary {@link TestSuite} constructor doesn't know how to
124+
* define your {@code suite()} method to use {@code #makeSuite}.
125+
* The ordinary {@code TestSuite} constructor doesn't know how to
129126
* interpret bulk test methods.
130127
*/
131128
public class BulkTest implements Cloneable {
@@ -160,11 +157,9 @@ public class BulkTest implements Cloneable {
160157
/**
161158
* Constructs a new {@code BulkTest} instance that will run the
162159
* specified simple test.
163-
*
164-
* @param name the name of the simple test method to run
165160
*/
166-
public BulkTest(final String name) {
167-
this.name = name;
161+
public BulkTest() {
162+
this.name = getClass().getSimpleName();
168163
this.verboseName = getClass().getName();
169164
}
170165

src/test/java/org/apache/commons/collections4/bag/AbstractBagTest.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import org.apache.commons.collections4.collection.AbstractCollectionTest;
4040
import org.apache.commons.collections4.set.AbstractSetTest;
4141
import org.apache.commons.lang3.ArrayUtils;
42-
import org.apache.commons.lang3.StringUtils;
4342
import org.junit.jupiter.api.Test;
4443

4544
/**
@@ -71,10 +70,6 @@ public abstract class AbstractBagTest<T> extends AbstractCollectionTest<T> {
7170

7271
public class TestBagUniqueSet extends AbstractSetTest<T> {
7372

74-
public TestBagUniqueSet() {
75-
super(StringUtils.EMPTY);
76-
}
77-
7873
@Override
7974
public T[] getFullElements() {
8075
return AbstractBagTest.this.getFullElements();
@@ -142,11 +137,8 @@ public void verify() {
142137

143138
/**
144139
* JUnit constructor.
145-
*
146-
* @param testName the test class name
147140
*/
148-
public AbstractBagTest(final String testName) {
149-
super(testName);
141+
public AbstractBagTest() {
150142
}
151143

152144
/**

src/test/java/org/apache/commons/collections4/bag/AbstractSortedBagTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
*/
3030
public abstract class AbstractSortedBagTest<T> extends AbstractBagTest<T> {
3131

32-
public AbstractSortedBagTest(final String testName) {
33-
super(testName);
34-
}
35-
3632
/**
3733
* Returns the {@link #collection} field cast to a {@link SortedBag}.
3834
*

src/test/java/org/apache/commons/collections4/bag/CollectionBagTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,6 @@
4141
*/
4242
public class CollectionBagTest<T> extends AbstractCollectionTest<T> {
4343

44-
/**
45-
* JUnit constructor.
46-
*/
47-
public CollectionBagTest() {
48-
super(CollectionBagTest.class.getSimpleName());
49-
}
50-
5144
@Override
5245
public String getCompatibilityVersion() {
5346
return "4";

src/test/java/org/apache/commons/collections4/bag/CollectionSortedBagTest.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@
3737
*/
3838
public class CollectionSortedBagTest<T> extends AbstractCollectionTest<T> {
3939

40-
/**
41-
* JUnit constructor.
42-
*/
43-
public CollectionSortedBagTest() {
44-
super(CollectionSortedBagTest.class.getSimpleName());
45-
}
46-
4740
@Override
4841
public String getCompatibilityVersion() {
4942
return "4";

0 commit comments

Comments
 (0)