From c2d00c84508ac9af2272843547046a27b23f3bb5 Mon Sep 17 00:00:00 2001 From: Wei-Chiu Chuang Date: Thu, 1 Aug 2019 19:11:43 -0700 Subject: [PATCH] HDFS-13131. Modifying testcase testEnableAndDisableErasureCodingPolicy. Contributed by chencan. --- .../org/apache/hadoop/hdfs/TestDistributedFileSystem.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDistributedFileSystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDistributedFileSystem.java index d09ad0209c..a27ed78e0d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDistributedFileSystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDistributedFileSystem.java @@ -1926,10 +1926,12 @@ public void testEnableAndDisableErasureCodingPolicy() throws Exception { fs.addErasureCodingPolicies(policies); assertEquals(policyName, ErasureCodingPolicyManager.getInstance(). getByName(policyName).getName()); - fs.disableErasureCodingPolicy(policyName); fs.enableErasureCodingPolicy(policyName); assertEquals(policyName, ErasureCodingPolicyManager.getInstance(). - getByName(policyName).getName()); + getEnabledPolicyByName(policyName).getName()); + fs.disableErasureCodingPolicy(policyName); + assertNull(ErasureCodingPolicyManager.getInstance(). + getEnabledPolicyByName(policyName)); //test enable a policy that doesn't exist try {