You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by dm...@apache.org on 2013/11/27 14:11:38 UTC

git commit: AMBARI-3903. Unit Test broken on trunk (dlysnichenko)

Updated Branches:
  refs/heads/trunk dd535bcf8 -> 1b20485fe


AMBARI-3903. Unit Test broken on trunk (dlysnichenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/1b20485f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/1b20485f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/1b20485f

Branch: refs/heads/trunk
Commit: 1b20485fed5dd4803435aa6671da2417ff6568d1
Parents: dd535bc
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Wed Nov 27 15:06:58 2013 +0200
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Wed Nov 27 15:06:58 2013 +0200

----------------------------------------------------------------------
 .../api/util/StackExtensionHelperTest.java      | 38 +++++++++++++-------
 1 file changed, 25 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/1b20485f/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
index 4a65dad..152a6b5 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/api/util/StackExtensionHelperTest.java
@@ -48,12 +48,19 @@ public class StackExtensionHelperTest {
         assertEquals("RESOURCEMANAGER", components.get(0).getName());
         assertEquals("MASTER", components.get(0).getCategory());
         List<PropertyInfo> properties = serviceInfo.getProperties();
-        // Check some properties
+        // Check some property
         assertEquals(4, properties.size());
-        assertEquals("yarn.resourcemanager.resource-tracker.address",
-                properties.get(0).getName());
-        assertEquals("localhost:8025",
-                properties.get(0).getValue());
+        boolean found = false;
+        for (PropertyInfo property : properties) {
+          if (property.getName().equals("yarn.resourcemanager.resource-tracker.address")) {
+            assertEquals("localhost:8025", property.getValue());
+            assertEquals("yarn-site.xml",
+                    property.getFilename());
+            assertEquals(true, property.isDeleted());
+            found = true;
+          }
+        }
+        assertTrue("Property not found in a list of properties", found);
         // Check config dependencies
         List<String> configDependencies = serviceInfo.getConfigDependencies();
         assertEquals(1, configDependencies.size());
@@ -122,16 +129,21 @@ public class StackExtensionHelperTest {
         assertEquals(CommandScriptDefinition.Type.PYTHON,
                 serviceScriptDefinition.getScriptType());
         assertEquals(50, serviceScriptDefinition.getTimeout());
-        // Check some properties
+        // Check some property
         List<PropertyInfo> properties = serviceInfo.getProperties();
         assertEquals(38, properties.size());
-        assertEquals("hbase.cluster.distributed",
-                properties.get(0).getName());
-        assertEquals("true",
-                properties.get(0).getValue());
-        assertTrue(properties.get(0).getDescription().startsWith("The mode the"));
-        assertEquals("hbase-site.xml",
-                properties.get(0).getFilename());
+        boolean found = false;
+        for (PropertyInfo property : properties) {
+          if (property.getName().equals("hbase.cluster.distributed")) {
+            assertEquals("true",
+                    property.getValue());
+            assertTrue(property.getDescription().startsWith("The mode the"));
+            assertEquals("hbase-site.xml",
+                    property.getFilename());
+            found = true;
+          }
+        }
+        assertTrue("Property not found in a list of properties", found);
         List<String> configDependencies = serviceInfo.getConfigDependencies();
         assertEquals(3, configDependencies.size());
         assertEquals("global", configDependencies.get(0));