Procházet zdrojové kódy

HDDS-982. Fix TestContainerDataYaml#testIncorrectContainerFile. Contributed by Doroszlai, Attila.

Márton Elek před 6 roky
rodič
revize
2d69a35614

+ 4 - 5
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
       KeyValueContainerData kvData = (KeyValueContainerData) ContainerDataYaml
           .readContainerFile(file);
           .readContainerFile(file);
       fail("testIncorrectContainerFile failed");
       fail("testIncorrectContainerFile failed");
-    } catch (IllegalStateException ex) {
-      GenericTestUtils.assertExceptionContains("Unexpected " +
-          "ContainerLifeCycleState", ex);
+    } catch (IllegalArgumentException ex) {
+      GenericTestUtils.assertExceptionContains("No enum constant", ex);
     }
     }
   }
   }
 
 
 
 
   @Test
   @Test
-  public void testCheckBackWardCompatabilityOfContainerFile() throws
+  public void testCheckBackWardCompatibilityOfContainerFile() throws
       IOException {
       IOException {
     // This test is for if we upgrade, and then .container files added by new
     // 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
     // server will have new fields added to .container file, after a while we
@@ -178,7 +177,7 @@ public class TestContainerDataYaml {
 
 
     } catch (Exception ex) {
     } catch (Exception ex) {
       ex.printStackTrace();
       ex.printStackTrace();
-      fail("testCheckBackWardCompatabilityOfContainerFile failed");
+      fail("testCheckBackWardCompatibilityOfContainerFile failed");
     }
     }
   }
   }
 
 

+ 1 - 1
hadoop-hdds/container-service/src/test/resources/incorrect.container

@@ -9,5 +9,5 @@ maxSize: 5368709120
 originPipelineId: b2c96aa4-b757-4f97-b286-6fb80a1baf8e
 originPipelineId: b2c96aa4-b757-4f97-b286-6fb80a1baf8e
 originNodeId: 6dcfb385-caea-4efb-9ef3-f87fadca0f51
 originNodeId: 6dcfb385-caea-4efb-9ef3-f87fadca0f51
 metadata: {OWNER: ozone, VOLUME: hdfs}
 metadata: {OWNER: ozone, VOLUME: hdfs}
-state: INVALID
+state: NO_SUCH_STATE
 checksum: 08bc9d390f9183aeed3cf33c789e2a07310bba60f3cf55941caccc939db8670f
 checksum: 08bc9d390f9183aeed3cf33c789e2a07310bba60f3cf55941caccc939db8670f