From b29813945d714ee8bc2208d802bad0e9a701f83b Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Mon, 11 Nov 2024 09:07:54 -0500 Subject: [PATCH] [COLLECTIONS-777] Migrate to JUnit 5 Remove unused methods --- .../apache/commons/collections4/BulkTest.java | 129 +----------------- 1 file changed, 1 insertion(+), 128 deletions(-) diff --git a/src/test/java/org/apache/commons/collections4/BulkTest.java b/src/test/java/org/apache/commons/collections4/BulkTest.java index 2041eba5a..105b47183 100644 --- a/src/test/java/org/apache/commons/collections4/BulkTest.java +++ b/src/test/java/org/apache/commons/collections4/BulkTest.java @@ -17,113 +17,7 @@ package org.apache.commons.collections4; /** - * A {@code TestCase} that can define both simple and bulk test methods. - *

- * A simple test method is the type of test traditionally - * supplied by {@code TestCase}. To define a simple test, create a public - * no-argument method whose name starts with "test". You can specify - * the name of simple test in the constructor of {@code BulkTest}; - * a subsequent call to {@code TestCase#run} will run that simple test. - *

- * A bulk test method, on the other hand, returns a new instance - * of {@code BulkTest}, which can itself define new simple and bulk - * test methods. By using the {@code #makeSuite} method, you can - * automatically create a hierarchical suite of tests and child bulk tests. - *

- * For instance, consider the following two classes: - * - *

- *  public class SetTest extends BulkTest {
- *
- *      private Set set;
- *
- *      public SetTest(Set set) {
- *          this.set = set;
- *      }
- *
- *      @Test
- *      public void testContains() {
- *          boolean r = set.contains(set.iterator().next()));
- *          assertTrue("Set should contain first element, r);
- *      }
- *
- *      @Test
- *      public void testClear() {
- *          set.clear();
- *          assertTrue("Set should be empty after clear", set.isEmpty());
- *      }
- *  }
- *
- *
- *  public class HashMapTest extends BulkTest {
- *
- *      private Map makeFullMap() {
- *          HashMap result = new HashMap();
- *          result.put("1", "One");
- *          result.put("2", "Two");
- *          return result;
- *      }
- *
- *      @Test
- *      public void testClear() {
- *          Map map = makeFullMap();
- *          map.clear();
- *          assertTrue("Map empty after clear", map.isEmpty());
- *      }
- *
- *      public BulkTest bulkTestKeySet() {
- *          return new SetTest(makeFullMap().keySet());
- *      }
- *
- *      public BulkTest bulkTestEntrySet() {
- *          return new SetTest(makeFullMap().entrySet());
- *      }
- *  }
- *  
- * - * In the above examples, {@code SetTest} defines two - * simple test methods and no bulk test methods; {@code HashMapTest} - * defines one simple test method and two bulk test methods. When - * {@code makeSuite(HashMapTest.class).run} is executed, - * five simple test methods will be run, in this order:

- * - *

    - *
  1. HashMapTest.testClear() - *
  2. HashMapTest.bulkTestKeySet().testContains(); - *
  3. HashMapTest.bulkTestKeySet().testClear(); - *
  4. HashMapTest.bulkTestEntrySet().testContains(); - *
  5. HashMapTest.bulkTestEntrySet().testClear(); - *
- * - * In the graphical junit test runners, the tests would be displayed in - * the following tree:

- * - *

- * - * A subclass can override a superclass's bulk test by - * returning {@code null} from the bulk test method. If you only - * want to override specific simple tests within a bulk test, use the - * {@code #ignoredTests} method.

- * - * Note that if you want to use the bulk test methods, you must - * define your {@code suite()} method to use {@code #makeSuite}. - * The ordinary {@code TestSuite} constructor doesn't know how to - * interpret bulk test methods. + * This class is left over from the JUnit 3 implementation. */ public class BulkTest implements Cloneable { @@ -182,13 +76,6 @@ public class BulkTest implements Cloneable { return name; } - /** - * For Apache Commons BeanUtils until all components migrate to JUnit 5. - */ - public String getVerboseName() { - return verboseName; - } - /** * Returns an array of test names to ignore.

* @@ -226,20 +113,6 @@ public class BulkTest implements Cloneable { return null; } - /** - * For Apache Commons BeanUtils until all components migrate to JUnit 5. - */ - public void setName(final String name) { - this.name = name; - } - - /** - * For Apache Commons BeanUtils until all components migrate to JUnit 5. - */ - public void setVerboseName(final String verboseName) { - this.verboseName = verboseName; - } - /** * Returns the display name of this {@code BulkTest}. *