You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2013/10/10 16:47:00 UTC
git commit: AMBARI-3474. Add empty string as a valid config value
(ncole)
Updated Branches:
refs/heads/trunk 124e06d72 -> 883d33eb9
AMBARI-3474. Add empty string as a valid config value (ncole)
Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/883d33eb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/883d33eb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/883d33eb
Branch: refs/heads/trunk
Commit: 883d33eb9b0f911b0b24d48acdb675dea55da8df
Parents: 124e06d
Author: Nate Cole <nc...@hortonworks.com>
Authored: Wed Oct 9 17:18:00 2013 -0400
Committer: Nate Cole <nc...@hortonworks.com>
Committed: Thu Oct 10 10:46:35 2013 -0400
----------------------------------------------------------------------
.../server/api/util/StackExtensionHelper.java | 3 +--
.../server/api/services/AmbariMetaInfoTest.java | 19 ++++++++++---------
.../AmbariManagementControllerTest.java | 5 +++--
3 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/883d33eb/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 cb18373..12fc6dc 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,8 +309,7 @@ public class StackExtensionHelper {
List<PropertyInfo> list = new ArrayList<PropertyInfo>();
for (PropertyInfo pi : cx.getProperties()) {
- // maintain old behavior
- if (null == pi.getValue() || pi.getValue().isEmpty())
+ if (null == pi.getValue())
continue;
pi.setFilename(propertyFile.getName());
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/883d33eb/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 63a921d..6253b07 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 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_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 final String STACK_MINIMAL_VERSION_HDP = "0.0";
- private static String SERVICE_NAME_HDFS = "HDFS";
- private static String SERVICE_COMPONENT_NAME = "NAMENODE";
+ private static final String SERVICE_NAME_HDFS = "HDFS";
+ private static final 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,9 +505,10 @@ public class AmbariMetaInfoTest {
Assert.assertNotNull("yarn.nodemanager.address expected to be inherited " +
"from parent", inheritedProperty);
Assert.assertEquals("localhost:100009", redefinedProperty1.getValue());
- // Parent property value will result in property being present in the
+ // Empty Parent property value will result in property being present in the
// child stack
- Assert.assertEquals("localhost:8141", redefinedProperty2.getValue());
+ Assert.assertEquals("Expected property '" + redefinedProperty2.getName() + "'",
+ "", redefinedProperty2.getValue());
// New property
Assert.assertNotNull(newProperty);
Assert.assertEquals("some-value", newProperty.getValue());
@@ -599,7 +600,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(81, properties.size());
+ Assert.assertEquals(84, properties.size());
}
@Test
http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/883d33eb/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 a18bcc6..11b4bb7 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 = 81;
+ private static final int STACK_PROPERTIES_CNT = 84;
private static final int STACK_COMPONENTS_CNT = 3;
private static final int OS_CNT = 2;
@@ -6904,6 +6904,7 @@ 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());
@@ -7341,4 +7342,4 @@ public class AmbariManagementControllerTest {
}
}
-
\ No newline at end of file
+