Updated Branches: refs/heads/trunk 8f450ffd7 -> 29012b4aa
Revert "AMBARI-3474. Add empty string as a valid config value (ncole)" This reverts commit 883d33eb9b0f911b0b24d48acdb675dea55da8df. Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/29012b4a Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/29012b4a Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/29012b4a Branch: refs/heads/trunk Commit: 29012b4aaaf1545f842d8d8b6c26c7e97f4f27b6 Parents: 8f450ff Author: Nate Cole <[email protected]> Authored: Thu Oct 10 17:02:32 2013 -0400 Committer: Nate Cole <[email protected]> Committed: Thu Oct 10 17:02:32 2013 -0400 ---------------------------------------------------------------------- .../server/api/util/StackExtensionHelper.java | 3 ++- .../server/api/services/AmbariMetaInfoTest.java | 19 +++++++++---------- .../AmbariManagementControllerTest.java | 5 ++--- 3 files changed, 13 insertions(+), 14 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/29012b4a/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java b/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java index 12fc6dc..cb18373 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/util/StackExtensionHelper.java @@ -309,7 +309,8 @@ public class StackExtensionHelper { List<PropertyInfo> list = new ArrayList<PropertyInfo>(); for (PropertyInfo pi : cx.getProperties()) { - if (null == pi.getValue()) + // maintain old behavior + if (null == pi.getValue() || pi.getValue().isEmpty()) continue; pi.setFilename(propertyFile.getName()); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/29012b4a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java index 6253b07..63a921d 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/AmbariMetaInfoTest.java @@ -59,13 +59,13 @@ import org.slf4j.LoggerFactory; public class AmbariMetaInfoTest { - private static final String STACK_NAME_HDP = "HDP"; - private static final String STACK_VERSION_HDP = "0.1"; - private static final String EXT_STACK_NAME = "2.0.6"; - private static final String STACK_VERSION_HDP_02 = "0.2"; + private static String STACK_NAME_HDP = "HDP"; + private static String STACK_VERSION_HDP = "0.1"; + private static String EXT_STACK_NAME = "2.0.6"; + private static String STACK_VERSION_HDP_02 = "0.2"; private static final String STACK_MINIMAL_VERSION_HDP = "0.0"; - private static final String SERVICE_NAME_HDFS = "HDFS"; - private static final String SERVICE_COMPONENT_NAME = "NAMENODE"; + private static String SERVICE_NAME_HDFS = "HDFS"; + private static String SERVICE_COMPONENT_NAME = "NAMENODE"; private static final String OS_TYPE = "centos5"; private static final String REPO_ID = "HDP-UTILS-1.1.0.15"; private static final String PROPERTY_NAME = "hbase.regionserver.msginterval"; @@ -505,10 +505,9 @@ public class AmbariMetaInfoTest { Assert.assertNotNull("yarn.nodemanager.address expected to be inherited " + "from parent", inheritedProperty); Assert.assertEquals("localhost:100009", redefinedProperty1.getValue()); - // Empty Parent property value will result in property being present in the + // Parent property value will result in property being present in the // child stack - Assert.assertEquals("Expected property '" + redefinedProperty2.getName() + "'", - "", redefinedProperty2.getValue()); + Assert.assertEquals("localhost:8141", redefinedProperty2.getValue()); // New property Assert.assertNotNull(newProperty); Assert.assertEquals("some-value", newProperty.getValue()); @@ -600,7 +599,7 @@ public class AmbariMetaInfoTest { @Test public void testPropertyCount() throws Exception { Set<PropertyInfo> properties = metaInfo.getProperties(STACK_NAME_HDP, STACK_VERSION_HDP_02, SERVICE_NAME_HDFS); - Assert.assertEquals(84, properties.size()); + Assert.assertEquals(81, properties.size()); } @Test http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/29012b4a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java index 11b4bb7..a18bcc6 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java @@ -118,7 +118,7 @@ public class AmbariManagementControllerTest { private static final int REPOS_CNT = 3; private static final int STACKS_CNT = 1; private static final int STACK_SERVICES_CNT = 5 ; - private static final int STACK_PROPERTIES_CNT = 84; + private static final int STACK_PROPERTIES_CNT = 81; private static final int STACK_COMPONENTS_CNT = 3; private static final int OS_CNT = 2; @@ -6904,7 +6904,6 @@ public class AmbariManagementControllerTest { requests.clear(); request = new RepositoryRequest(STACK_NAME, STACK_VERSION, OS_TYPE, REPO_ID); request.setBaseUrl(repo.getDefaultBaseUrl()); - request.setVerifyBaseUrl(false); requests.add(request); controller.updateRespositories(requests); Assert.assertEquals(repo.getBaseUrl(), repo.getDefaultBaseUrl()); @@ -7342,4 +7341,4 @@ public class AmbariManagementControllerTest { } } - + \ No newline at end of file
