From 4b11c764e5bfa1fd2e3b85247c0384c66b515489 Mon Sep 17 00:00:00 2001 From: contextshuffling Date: Sun, 19 Jan 2020 23:00:06 +0800 Subject: [PATCH 1/2] [LANG-1514] make test more stable by using HashSet to compare --- .../java/org/apache/commons/lang3/reflect/FieldUtilsTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java b/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java index 4e428a926..291e70a20 100644 --- a/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java +++ b/src/test/java/org/apache/commons/lang3/reflect/FieldUtilsTest.java @@ -36,6 +36,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashSet; import java.util.List; import static org.junit.jupiter.api.Assertions.assertArrayEquals; @@ -188,7 +189,7 @@ public class FieldUtilsTest { final List fieldsInteger = Arrays.asList(Integer.class.getDeclaredFields()); final List allFieldsInteger = new ArrayList<>(fieldsInteger); allFieldsInteger.addAll(fieldsNumber); - assertEquals(allFieldsInteger, FieldUtils.getAllFieldsList(Integer.class)); + assertEquals(new HashSet(allFieldsInteger), new HashSet(FieldUtils.getAllFieldsList(Integer.class))); final List allFields = FieldUtils.getAllFieldsList(PublicChild.class); // Under Jacoco,0.8.1 and Java 10, the field count is 7. int expected = 5; From cb0f461237cc9a6fe7082b4a88578cf02a5362f2 Mon Sep 17 00:00:00 2001 From: "Bruno P. Kinoshita" Date: Fri, 14 Feb 2020 09:49:59 +1300 Subject: [PATCH 2/2] [LANG-1514]: add changes.xml entry --- src/changes/changes.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 11f89c4fb..f16d1511e 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -46,6 +46,7 @@ The type attribute can be add,update,fix,remove. + Make test more stable by wrapping assertions in hashset. Generate Javadoc jar on build. Add ExceptionUtils.throwableOfType(Throwable, Class) and friends. Add EMPTY_ARRAY constants to classes in org.apache.commons.lang3.tuple.