From a3b500d0465b6af82fd12fc83140e4875bd7d399 Mon Sep 17 00:00:00 2001 From: zhtttylz Date: Sat, 18 Feb 2023 13:17:37 +0800 Subject: [PATCH] HDFS-16916. Improve the use of JUnit Test in DFSClient (#5404) Co-authored-by: Zhtttylz Reviewed-by: Ayush Saxena Reviewed-by: Shilun Fan Signed-off-by: Shilun Fan --- .../java/org/apache/hadoop/fs/TestXAttr.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/fs/TestXAttr.java b/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/fs/TestXAttr.java index e47658dd6a..af602477d1 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/fs/TestXAttr.java +++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/test/java/org/apache/hadoop/fs/TestXAttr.java @@ -19,8 +19,8 @@ package org.apache.hadoop.fs; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotSame; +import static org.junit.Assert.assertNotEquals; import org.junit.BeforeClass; import org.junit.Test; @@ -77,18 +77,18 @@ public void testXAttrEquals() { assertEquals(XATTR3, XATTR3); assertEquals(XATTR4, XATTR4); assertEquals(XATTR5, XATTR5); - assertFalse(XATTR1.equals(XATTR2)); - assertFalse(XATTR2.equals(XATTR3)); - assertFalse(XATTR3.equals(XATTR4)); - assertFalse(XATTR4.equals(XATTR5)); + assertNotEquals(XATTR1, XATTR2); + assertNotEquals(XATTR2, XATTR3); + assertNotEquals(XATTR3, XATTR4); + assertNotEquals(XATTR4, XATTR5); } @Test public void testXAttrHashCode() { assertEquals(XATTR.hashCode(), XATTR1.hashCode()); - assertFalse(XATTR1.hashCode() == XATTR2.hashCode()); - assertFalse(XATTR2.hashCode() == XATTR3.hashCode()); - assertFalse(XATTR3.hashCode() == XATTR4.hashCode()); - assertFalse(XATTR4.hashCode() == XATTR5.hashCode()); + assertNotEquals(XATTR1.hashCode(), XATTR2.hashCode()); + assertNotEquals(XATTR2.hashCode(), XATTR3.hashCode()); + assertNotEquals(XATTR3.hashCode(), XATTR4.hashCode()); + assertNotEquals(XATTR4.hashCode(), XATTR5.hashCode()); } }