This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git


The following commit(s) were added to refs/heads/master by this push:
     new feccdaf51 Rework test fixtures
feccdaf51 is described below

commit feccdaf51174980c46900f42491b128cdfd77951
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sat Mar 30 13:31:04 2024 -0400

    Rework test fixtures
    
    Next, grow the amount of data tested to find bugs in the tests with
    non-repeatable map ordering
---
 .../collections4/multimap/AbstractMultiValuedMapTest.java     | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
 
b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
index 8a987bae0..1bab571fa 100644
--- 
a/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
+++ 
b/src/test/java/org/apache/commons/collections4/multimap/AbstractMultiValuedMapTest.java
@@ -520,7 +520,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> 
extends AbstractObjectTes
      */
     @SuppressWarnings("unchecked")
     public K[] getSampleKeys() {
-        final Object[] result = { "k0", "k0", "k1", "k1", "k2", "k2" };
+        final Object[] result = new Object[getSampleSize()];
         int k = 0;
         for (int i = 0; i < result.length; i += 2, k++) {
             final String key = "k" + Integer.valueOf(k);
@@ -530,6 +530,10 @@ public abstract class AbstractMultiValuedMapTest<K, V> 
extends AbstractObjectTes
         return (K[]) result;
     }
 
+    public int getSampleSize() {
+        return 6;
+    }
+
     /**
      * Returns the set of values in the mappings used to test the map. This
      * method must return an array with the same length as
@@ -538,10 +542,7 @@ public abstract class AbstractMultiValuedMapTest<K, V> 
extends AbstractObjectTes
      */
     @SuppressWarnings("unchecked")
     public V[] getSampleValues() {
-        final Object[] result = {
-            "v1_b", "v0_b", "v1_a", "v1_b",
-            "v2_a", "v2_b"
-        };
+        final Object[] result = new Object[getSampleSize()];
         int k = 0;
         for (int i = 0; i < result.length; i += 2, k++) {
             final String key = "v" + Integer.valueOf(k);

Reply via email to