From 2d69a3561400eaab683a3c809a6d086bb8abddc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rton=20Elek?= Date: Wed, 23 Jan 2019 11:31:07 +0100 Subject: [PATCH] HDDS-982. Fix TestContainerDataYaml#testIncorrectContainerFile. Contributed by Doroszlai, Attila. --- .../container/common/impl/TestContainerDataYaml.java | 9 ++++----- .../src/test/resources/incorrect.container | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerDataYaml.java b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerDataYaml.java index a52e18b791f..c611ccb28e7 100644 --- a/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerDataYaml.java +++ b/hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/common/impl/TestContainerDataYaml.java @@ -138,15 +138,14 @@ public class TestContainerDataYaml { KeyValueContainerData kvData = (KeyValueContainerData) ContainerDataYaml .readContainerFile(file); fail("testIncorrectContainerFile failed"); - } catch (IllegalStateException ex) { - GenericTestUtils.assertExceptionContains("Unexpected " + - "ContainerLifeCycleState", ex); + } catch (IllegalArgumentException ex) { + GenericTestUtils.assertExceptionContains("No enum constant", ex); } } @Test - public void testCheckBackWardCompatabilityOfContainerFile() throws + public void testCheckBackWardCompatibilityOfContainerFile() throws IOException { // This test is for if we upgrade, and then .container files added by new // server will have new fields added to .container file, after a while we @@ -178,7 +177,7 @@ public class TestContainerDataYaml { } catch (Exception ex) { ex.printStackTrace(); - fail("testCheckBackWardCompatabilityOfContainerFile failed"); + fail("testCheckBackWardCompatibilityOfContainerFile failed"); } } diff --git a/hadoop-hdds/container-service/src/test/resources/incorrect.container b/hadoop-hdds/container-service/src/test/resources/incorrect.container index d14c75f9eb1..38384c8e697 100644 --- a/hadoop-hdds/container-service/src/test/resources/incorrect.container +++ b/hadoop-hdds/container-service/src/test/resources/incorrect.container @@ -9,5 +9,5 @@ maxSize: 5368709120 originPipelineId: b2c96aa4-b757-4f97-b286-6fb80a1baf8e originNodeId: 6dcfb385-caea-4efb-9ef3-f87fadca0f51 metadata: {OWNER: ozone, VOLUME: hdfs} -state: INVALID +state: NO_SUCH_STATE checksum: 08bc9d390f9183aeed3cf33c789e2a07310bba60f3cf55941caccc939db8670f \ No newline at end of file