From da88597717474b6ba349423a93a4069b6a140537 Mon Sep 17 00:00:00 2001 From: khadgarmage Date: Mon, 2 Dec 2019 23:15:04 +0800 Subject: [PATCH] unittest-demo (#1337) --- .../common/utils/CollectionUtilsTest.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/CollectionUtilsTest.java b/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/CollectionUtilsTest.java index 394cf5f64a..573e62bf5e 100644 --- a/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/CollectionUtilsTest.java +++ b/dolphinscheduler-common/src/test/java/org/apache/dolphinscheduler/common/utils/CollectionUtilsTest.java @@ -30,34 +30,30 @@ public class CollectionUtilsTest { @Test public void equalLists() { List a = new ArrayList(); - a.add(1); a.add(2); a.add(3); - List b = new ArrayList(); b.add(3); b.add(2); b.add(1); - Assert.assertTrue(CollectionUtils.equalLists(a,b)); - + Assert.assertTrue(CollectionUtils.equalLists(null,null)); + List c = new ArrayList(); + Assert.assertFalse(CollectionUtils.equalLists(c,null)); + Assert.assertFalse(CollectionUtils.equalLists(c,a)); } @Test public void subtract() { Set a = new HashSet(); - a.add(1); a.add(2); a.add(3); - Set b = new HashSet(); b.add(0); b.add(2); b.add(4); - - Assert.assertArrayEquals(new Integer[]{1,3},CollectionUtils.subtract(a,b).toArray()); } -} \ No newline at end of file +}