This is an automated email from the ASF dual-hosted git repository.

elek pushed a commit to branch HDDS-2064
in repository https://gitbox.apache.org/repos/asf/hadoop-ozone.git

commit 891fde41d811b772a99202e5d014cf582bbedc5e
Author: Siyao Meng <sm...@cloudera.com>
AuthorDate: Wed Sep 4 14:49:40 2019 -0700

    Amend unit tests.
---
 .../ozone/om/TestOzoneManagerConfiguration.java    | 36 ++++++----------------
 1 file changed, 10 insertions(+), 26 deletions(-)

diff --git 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java
 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java
index 323cb45..f5b5d05 100644
--- 
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java
+++ 
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerConfiguration.java
@@ -284,35 +284,27 @@ public class TestOzoneManagerConfiguration {
   }
 
   /**
-   * Test a wrong configuration for OM HA. A configuration with an empty
-   * node list while service ID is configured should throw an error.
+   * A configuration with an empty node list while service ID is configured
+   * Should successfully start with no NPEs.
    * @throws Exception
    */
   @Test
-  public void testWrongConfigurationNoOMNodes() throws Exception {
+  public void testNoOMNodes() throws Exception {
     String omServiceId = "om-service-test1";
     conf.set(OMConfigKeys.OZONE_OM_SERVICE_IDS_KEY, omServiceId);
     // Deliberately skip OZONE_OM_NODES_KEY and OZONE_OM_ADDRESS_KEY config
 
-    try {
-      startCluster();
-      Assert.fail("OM initialization should have failed.");
-    } catch (OzoneIllegalArgumentException e) {
-      GenericTestUtils.assertExceptionContains(
-          "Incorrect configuration. Unable to find OzoneManager" +
-          " node address for service id " + omServiceId + ". Please" +
-          " check and reconfigure: " + OZONE_OM_SERVICE_IDS_KEY +
-          ", " + OZONE_OM_NODES_KEY + " and " + OZONE_OM_ADDRESS_KEY, e);
-    }
+    // Should successfully start with no NPEs
+    startCluster();
   }
 
   /**
-   * Test a wrong configuration for OM HA. A configuration with no OM addresses
-   * while service ID is configured should throw an error.
+   * A configuration with no OM addresses while service ID is configured.
+   * Should successfully start with no NPEs.
    * @throws Exception
    */
   @Test
-  public void testWrongConfigurationNoOMAddrs() throws Exception {
+  public void testNoOMAddrs() throws Exception {
     String omServiceId = "om-service-test1";
 
     String omNode1Id = "omNode1";
@@ -326,16 +318,8 @@ public class TestOzoneManagerConfiguration {
     conf.set(omNodesKey, omNodesKeyValue);
     // Deliberately skip OZONE_OM_ADDRESS_KEY config
 
-    try {
-      startCluster();
-      Assert.fail("OM initialization should have failed.");
-    } catch (OzoneIllegalArgumentException e) {
-      GenericTestUtils.assertExceptionContains(
-          "Incorrect configuration. Unable to find OzoneManager" +
-              " node address for service id " + omServiceId + ". Please" +
-              " check and reconfigure: " + OZONE_OM_SERVICE_IDS_KEY +
-              ", " + OZONE_OM_NODES_KEY + " and " + OZONE_OM_ADDRESS_KEY, e);
-    }
+    // Should successfully start with no NPEs
+    startCluster();
   }
 
   /**


---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-commits-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-commits-h...@hadoop.apache.org

Reply via email to