You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sw...@apache.org on 2013/06/10 19:46:41 UTC

svn commit: r1491537 - /incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java

Author: swagle
Date: Mon Jun 10 17:46:40 2013
New Revision: 1491537

URL: http://svn.apache.org/r1491537
Log:
AMBARI-2344. Add unit test for host level params added to role commands. (swagle)

Modified:
    incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java

Modified: incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java?rev=1491537&r1=1491536&r2=1491537&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java (original)
+++ incubator/ambari/trunk/ambari-server/src/test/java/org/apache/ambari/server/controller/AmbariManagementControllerTest.java Mon Jun 10 17:46:40 2013
@@ -5310,7 +5310,7 @@ public class AmbariManagementControllerT
   }
 
   @Test
-  public void testStackVersionAsHostLevelParams() throws AmbariException {
+  public void testHostLevelParamsSentWithCommands() throws AmbariException {
     String clusterName = "foo1";
     createCluster(clusterName);
     clusters.getCluster(clusterName)
@@ -5342,6 +5342,8 @@ public class AmbariManagementControllerT
     createServiceComponentHost(clusterName, null, componentName1,
       host2, null);
 
+
+
     ServiceRequest r = new ServiceRequest(clusterName, serviceName, null,
       State.INSTALLED.toString());
     Set<ServiceRequest> requests = new HashSet<ServiceRequest>();
@@ -5354,9 +5356,15 @@ public class AmbariManagementControllerT
         .getDesiredState());
 
     List<Stage> stages = actionDB.getAllStages(trackAction.getRequestId());
-    Assert.assertEquals("0.1", stages.get(0).getOrderedHostRoleCommands().get
+    Map<String, String> params = stages.get(0).getOrderedHostRoleCommands().get
       (0).getExecutionCommandWrapper().getExecutionCommand()
-      .getHostLevelParams().get("stack_version"));
+      .getHostLevelParams();
+    Assert.assertEquals("0.1", params.get("stack_version"));
+    Assert.assertNotNull(params.get("jdk_location"));
+    Assert.assertNotNull(params.get("repo_info"));
+    Assert.assertNotNull(params.get("db_name"));
+    Assert.assertNotNull(params.get("mysql_jdbc_url"));
+    Assert.assertNotNull(params.get("oracle_jdbc_url"));
   }
 
   @Test