ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rle...@apache.org
Subject [1/2] ambari git commit: AMBARI-13441. If Ambari Server is not part of the cluster, basic operations throw 500 (NPE) when Kerberos is enabled (even if it is Manual Kerberos) (rlevas)
Date Wed, 21 Oct 2015 03:42:39 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 d2dc26350 -> 24ce16b5a


http://git-wip-us.apache.org/repos/asf/ambari/blob/24ce16b5/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
index 73b1649..f8f9ce9 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/actionmanager/TestActionScheduler.java
@@ -46,10 +46,6 @@ import java.util.TreeMap;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 
-import com.google.inject.Inject;
-import com.google.inject.persist.PersistService;
-import junit.framework.Assert;
-
 import org.apache.ambari.server.AmbariException;
 import org.apache.ambari.server.Role;
 import org.apache.ambari.server.RoleCommand;
@@ -98,9 +94,13 @@ import org.slf4j.LoggerFactory;
 import com.google.common.reflect.TypeToken;
 import com.google.inject.AbstractModule;
 import com.google.inject.Guice;
+import com.google.inject.Inject;
 import com.google.inject.Injector;
+import com.google.inject.persist.PersistService;
 import com.google.inject.persist.UnitOfWork;
 
+import junit.framework.Assert;
+
 public class TestActionScheduler {
 
   private static final Logger log = LoggerFactory.getLogger(TestActionScheduler.class);
@@ -113,7 +113,6 @@ public class TestActionScheduler {
 
   private static Injector injector;
 
-  private final String serverHostname = StageUtils.getHostName();
   private final String hostname = "ahost.ambari.apache.org";
   private final int MAX_CYCLE_ITERATIONS = 100;
 
@@ -291,9 +290,9 @@ public class TestActionScheduler {
     when(request.isExclusive()).thenReturn(false);
     when(db.getRequestEntity(anyLong())).thenReturn(request);
 
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         String host = (String) invocation.getArguments()[0];
         String role = (String) invocation.getArguments()[3];
         HostRoleCommand command = s.getHostRoleCommand(host, role);
@@ -371,9 +370,9 @@ public class TestActionScheduler {
 
     when(db.getCommandsInProgressCount()).thenReturn(stages.size());
     when(db.getStagesInProgress()).thenReturn(stages);
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         String host = (String) invocation.getArguments()[0];
         String role = (String) invocation.getArguments()[3];
         HostRoleCommand command = s.getHostRoleCommand(host, role);
@@ -466,9 +465,9 @@ public class TestActionScheduler {
     when(db.getCommandsInProgressCount()).thenReturn(stages.size());
     when(db.getStagesInProgress()).thenReturn(stages);
 
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         String host = (String) invocation.getArguments()[0];
         String role = (String) invocation.getArguments()[3];
         //HostRoleCommand command = stages.get(0).getHostRoleCommand(host, role);
@@ -482,9 +481,9 @@ public class TestActionScheduler {
       }
     }).when(db).timeoutHostRole(anyString(), anyLong(), anyLong(), anyString());
 
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         Long requestId = (Long) invocation.getArguments()[0];
         for (Stage stage : stages) {
           if (requestId.equals(stage.getRequestId())) {
@@ -564,27 +563,7 @@ public class TestActionScheduler {
     Properties properties = new Properties();
     Configuration conf = new Configuration(properties);
     Clusters fsm = mock(Clusters.class);
-    Cluster oneClusterMock = mock(Cluster.class);
-    Service serviceObj = mock(Service.class);
-    ServiceComponent scomp = mock(ServiceComponent.class);
-    ServiceComponentHost sch = mock(ServiceComponentHost.class);
     UnitOfWork unitOfWork = mock(UnitOfWork.class);
-    Host host = mock(Host.class);
-
-    when(host.getHostName()).thenReturn(serverHostname);
-    when(host.getState()).thenReturn(HostState.HEALTHY);
-
-    when(fsm.getCluster(anyString())).thenReturn(oneClusterMock);
-    when(fsm.getHost(anyString())).thenReturn(host);
-    when(oneClusterMock.getService(anyString())).thenReturn(serviceObj);
-    when(serviceObj.getServiceComponent(anyString())).thenReturn(scomp);
-    when(scomp.getServiceComponentHost(anyString())).thenReturn(sch);
-    when(serviceObj.getCluster()).thenReturn(oneClusterMock);
-
-    HashMap<String, ServiceComponentHost> hosts =
-            new HashMap<String, ServiceComponentHost>();
-    hosts.put(serverHostname, sch);
-    when(scomp.getServiceComponentHosts()).thenReturn(hosts);
 
     List<Stage> stages = new ArrayList<Stage>();
     Map<String, String> payload = new HashMap<String, String>();
@@ -599,37 +578,44 @@ public class TestActionScheduler {
 
     when(db.getCommandsInProgressCount()).thenReturn(stages.size());
     when(db.getStagesInProgress()).thenReturn(stages);
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         String host = (String) invocation.getArguments()[0];
         String role = (String) invocation.getArguments()[3];
         CommandReport commandReport = (CommandReport) invocation.getArguments()[4];
-        HostRoleCommand command = s.getHostRoleCommand(host, role);
+
+        HostRoleCommand command = null;
+        if (null == host) {
+          command = s.getHostRoleCommand(null, role);
+        } else {
+          command = s.getHostRoleCommand(host, role);
+        }
+
         command.setStatus(HostRoleStatus.valueOf(commandReport.getStatus()));
         return null;
       }
     }).when(db).updateHostRoleState(anyString(), anyLong(), anyLong(), anyString(), any(CommandReport.class));
 
-    doAnswer(new Answer() {
+    doAnswer(new Answer<HostRoleCommand>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
-        return s.getHostRoleCommand(serverHostname, "AMBARI_SERVER_ACTION");
+      public HostRoleCommand answer(InvocationOnMock invocation) throws Throwable {
+        return s.getHostRoleCommand(null, "AMBARI_SERVER_ACTION");
       }
     }).when(db).getTask(anyLong());
-    doAnswer(new Answer() {
+
+    doAnswer(new Answer<List<HostRoleCommand>>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
-        String host = (String) invocation.getArguments()[0];
+      public List<HostRoleCommand> answer(InvocationOnMock invocation) throws Throwable
{
         String role = (String) invocation.getArguments()[1];
         HostRoleStatus status = (HostRoleStatus) invocation.getArguments()[2];
 
-        HostRoleCommand task = s.getHostRoleCommand(host, role);
+        HostRoleCommand task = s.getHostRoleCommand(null, role);
 
         if (task.getStatus() == status) {
           return Arrays.asList(task);
         } else {
-          return null;
+          return Collections.emptyList();
         }
       }
     }).when(db).getTasksByHostRoleAndStatus(anyString(), anyString(), any(HostRoleStatus.class));
@@ -639,13 +625,13 @@ public class TestActionScheduler {
         new HostsMap((String) null), unitOfWork, null, conf);
 
     int cycleCount = 0;
-    while (!stages.get(0).getHostRoleStatus(serverHostname, "AMBARI_SERVER_ACTION")
+    while (!stages.get(0).getHostRoleStatus(null, "AMBARI_SERVER_ACTION")
         .equals(HostRoleStatus.COMPLETED) && cycleCount++ <= MAX_CYCLE_ITERATIONS)
{
       scheduler.doWork();
       scheduler.getServerActionExecutor().doWork();
     }
 
-    assertEquals(stages.get(0).getHostRoleStatus(serverHostname, "AMBARI_SERVER_ACTION"),
+    assertEquals(stages.get(0).getHostRoleStatus(null, "AMBARI_SERVER_ACTION"),
         HostRoleStatus.COMPLETED);
   }
 
@@ -658,26 +644,7 @@ public class TestActionScheduler {
     Properties properties = new Properties();
     Configuration conf = new Configuration(properties);
     Clusters fsm = mock(Clusters.class);
-    Cluster oneClusterMock = mock(Cluster.class);
-    Service serviceObj = mock(Service.class);
-    ServiceComponent scomp = mock(ServiceComponent.class);
-    ServiceComponentHost sch = mock(ServiceComponentHost.class);
     UnitOfWork unitOfWork = mock(UnitOfWork.class);
-    when(fsm.getCluster(anyString())).thenReturn(oneClusterMock);
-    when(oneClusterMock.getService(anyString())).thenReturn(serviceObj);
-    when(serviceObj.getServiceComponent(anyString())).thenReturn(scomp);
-    when(scomp.getServiceComponentHost(anyString())).thenReturn(sch);
-    when(serviceObj.getCluster()).thenReturn(oneClusterMock);
-
-    Host host = mock(Host.class);
-    HashMap<String, ServiceComponentHost> hosts =
-            new HashMap<String, ServiceComponentHost>();
-    hosts.put(serverHostname, sch);
-    when(scomp.getServiceComponentHosts()).thenReturn(hosts);
-
-    when(fsm.getHost(anyString())).thenReturn(host);
-    when(host.getState()).thenReturn(HostState.HEALTHY);
-    when(host.getHostName()).thenReturn(serverHostname);
 
     List<Stage> stages = new ArrayList<Stage>();
     Map<String, String> payload = new HashMap<String, String>();
@@ -693,38 +660,46 @@ public class TestActionScheduler {
 
     when(db.getCommandsInProgressCount()).thenReturn(stages.size());
     when(db.getStagesInProgress()).thenReturn(stages);
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         String host = (String) invocation.getArguments()[0];
         String role = (String) invocation.getArguments()[3];
         CommandReport commandReport = (CommandReport) invocation.getArguments()[4];
-        HostRoleCommand command = s.getHostRoleCommand(host, role);
+
+        HostRoleCommand command = null;
+        if (null == host) {
+          command = s.getHostRoleCommand(null, role);
+        } else {
+          command = s.getHostRoleCommand(host, role);
+        }
+
         command.setStatus(HostRoleStatus.valueOf(commandReport.getStatus()));
         return null;
       }
     }).when(db).updateHostRoleState(anyString(), anyLong(), anyLong(), anyString(), any(CommandReport.class));
 
-    doAnswer(new Answer() {
+    doAnswer(new Answer<HostRoleCommand>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
-        return s.getHostRoleCommand(serverHostname, "AMBARI_SERVER_ACTION");
+      public HostRoleCommand answer(InvocationOnMock invocation) throws Throwable {
+        return s.getHostRoleCommand(null, "AMBARI_SERVER_ACTION");
       }
     }).when(db).getTask(anyLong());
-    doAnswer(new Answer() {
+
+    doAnswer(new Answer<List<HostRoleCommand>>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
-        String host = (String) invocation.getArguments()[0];
+      public List<HostRoleCommand> answer(InvocationOnMock invocation) throws Throwable
{
         String role = (String) invocation.getArguments()[1];
         HostRoleStatus status = (HostRoleStatus) invocation.getArguments()[2];
 
-        HostRoleCommand task = s.getHostRoleCommand(host, role);
+        HostRoleCommand task = s.getHostRoleCommand(null, role);
 
         if (task.getStatus() == status) {
           return Arrays.asList(task);
         } else {
-          return null;
+          return Collections.emptyList();
         }
+
       }
     }).when(db).getTasksByHostRoleAndStatus(anyString(), anyString(), any(HostRoleStatus.class));
 
@@ -733,14 +708,14 @@ public class TestActionScheduler {
         new HostsMap((String) null), unitOfWork, null, conf);
 
     int cycleCount = 0;
-    while (!stages.get(0).getHostRoleStatus(serverHostname, "AMBARI_SERVER_ACTION").isCompletedState()
+    while (!stages.get(0).getHostRoleStatus(null, "AMBARI_SERVER_ACTION").isCompletedState()
         && cycleCount++ <= MAX_CYCLE_ITERATIONS) {
       scheduler.doWork();
       scheduler.getServerActionExecutor().doWork();
     }
 
     assertEquals(HostRoleStatus.TIMEDOUT,
-        stages.get(0).getHostRoleStatus(serverHostname, "AMBARI_SERVER_ACTION"));
+        stages.get(0).getHostRoleStatus(null, "AMBARI_SERVER_ACTION"));
   }
 
   @Test
@@ -749,21 +724,7 @@ public class TestActionScheduler {
     Properties properties = new Properties();
     Configuration conf = new Configuration(properties);
     Clusters fsm = mock(Clusters.class);
-    Cluster oneClusterMock = mock(Cluster.class);
-    Service serviceObj = mock(Service.class);
-    ServiceComponent scomp = mock(ServiceComponent.class);
-    ServiceComponentHost sch = mock(ServiceComponentHost.class);
     UnitOfWork unitOfWork = mock(UnitOfWork.class);
-    when(fsm.getCluster(anyString())).thenReturn(oneClusterMock);
-    when(oneClusterMock.getService(anyString())).thenReturn(serviceObj);
-    when(serviceObj.getServiceComponent(anyString())).thenReturn(scomp);
-    when(scomp.getServiceComponentHost(anyString())).thenReturn(sch);
-    when(serviceObj.getCluster()).thenReturn(oneClusterMock);
-
-    HashMap<String, ServiceComponentHost> hosts =
-            new HashMap<String, ServiceComponentHost>();
-    hosts.put(serverHostname, sch);
-    when(scomp.getServiceComponentHosts()).thenReturn(hosts);
 
     List<Stage> stages = new ArrayList<Stage>();
     Map<String, String> payload = new HashMap<String, String>();
@@ -779,37 +740,45 @@ public class TestActionScheduler {
 
     when(db.getCommandsInProgressCount()).thenReturn(stages.size());
     when(db.getStagesInProgress()).thenReturn(stages);
-    doAnswer(new Answer() {
+
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         String host = (String) invocation.getArguments()[0];
         String role = (String) invocation.getArguments()[3];
         CommandReport commandReport = (CommandReport) invocation.getArguments()[4];
-        HostRoleCommand command = s.getHostRoleCommand(host, role);
+
+        HostRoleCommand command = null;
+        if (null == host) {
+          command = s.getHostRoleCommand(null, role);
+        } else {
+          command = s.getHostRoleCommand(host, role);
+        }
+
         command.setStatus(HostRoleStatus.valueOf(commandReport.getStatus()));
         return null;
       }
     }).when(db).updateHostRoleState(anyString(), anyLong(), anyLong(), anyString(), any(CommandReport.class));
 
-    doAnswer(new Answer() {
+    doAnswer(new Answer<HostRoleCommand>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
-        return s.getHostRoleCommand(serverHostname, "AMBARI_SERVER_ACTION");
+      public HostRoleCommand answer(InvocationOnMock invocation) throws Throwable {
+        return s.getHostRoleCommand(null, "AMBARI_SERVER_ACTION");
       }
     }).when(db).getTask(anyLong());
-    doAnswer(new Answer() {
+
+    doAnswer(new Answer<List<HostRoleCommand>>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
-        String host = (String) invocation.getArguments()[0];
+      public List<HostRoleCommand> answer(InvocationOnMock invocation) throws Throwable
{
         String role = (String) invocation.getArguments()[1];
         HostRoleStatus status = (HostRoleStatus) invocation.getArguments()[2];
 
-        HostRoleCommand task = s.getHostRoleCommand(host, role);
+        HostRoleCommand task = s.getHostRoleCommand(null, role);
 
         if (task.getStatus() == status) {
           return Arrays.asList(task);
         } else {
-          return null;
+          return Collections.emptyList();
         }
       }
     }).when(db).getTasksByHostRoleAndStatus(anyString(), anyString(), any(HostRoleStatus.class));
@@ -818,12 +787,12 @@ public class TestActionScheduler {
         new HostsMap((String) null), unitOfWork, null, conf);
 
     int cycleCount = 0;
-    while (!stages.get(0).getHostRoleStatus(serverHostname, "AMBARI_SERVER_ACTION")
+    while (!stages.get(0).getHostRoleStatus(null, "AMBARI_SERVER_ACTION")
         .equals(HostRoleStatus.FAILED) && cycleCount++ <= MAX_CYCLE_ITERATIONS)
{
       scheduler.doWork();
       scheduler.getServerActionExecutor().doWork();
     }
-    assertEquals(stages.get(0).getHostRoleStatus(serverHostname, "AMBARI_SERVER_ACTION"),
+    assertEquals(stages.get(0).getHostRoleStatus(null, "AMBARI_SERVER_ACTION"),
         HostRoleStatus.FAILED);
     assertEquals("test", stages.get(0).getRequestContext());
   }
@@ -831,14 +800,15 @@ public class TestActionScheduler {
   private Stage getStageWithServerAction(long requestId, long stageId,
                                                 Map<String, String> payload, String
requestContext,
                                                 int timeout) {
-    String serverHostname = StageUtils.getHostName();
+
     Stage stage = stageFactory.createNew(requestId, "/tmp", "cluster1", 1L, requestContext,
CLUSTER_HOST_INFO,
       "{}", "{}");
     stage.setStageId(stageId);
 
-    stage.addServerActionCommand(MockServerAction.class.getName(), Role.AMBARI_SERVER_ACTION,
+    stage.addServerActionCommand(MockServerAction.class.getName(), null,
+        Role.AMBARI_SERVER_ACTION,
         RoleCommand.EXECUTE, "cluster1",
-        new ServiceComponentHostServerActionEvent(serverHostname, System.currentTimeMillis()),
+        new ServiceComponentHostServerActionEvent(null, System.currentTimeMillis()),
         payload,
         null, null, timeout, false, false);
 
@@ -859,7 +829,6 @@ public class TestActionScheduler {
     ServiceComponent scomp = mock(ServiceComponent.class);
     ServiceComponentHost sch = mock(ServiceComponentHost.class);
     UnitOfWork unitOfWork = mock(UnitOfWork.class);
-    RequestFactory requestFactory = mock(RequestFactory.class);
     when(fsm.getCluster(anyString())).thenReturn(oneClusterMock);
     when(oneClusterMock.getService(anyString())).thenReturn(serviceObj);
     when(serviceObj.getServiceComponent(anyString())).thenReturn(scomp);
@@ -917,10 +886,6 @@ public class TestActionScheduler {
     ActionScheduler scheduler = new ActionScheduler(100, 50, db, aq, fsm, 3,
             new HostsMap((String) null), unitOfWork, null, conf);
 
-    ActionManager am = new ActionManager(
-        2, 2, aq, fsm, db, new HostsMap((String) null),
-        unitOfWork, requestFactory, conf, null);
-
     scheduler.doWork();
 
     Assert.assertEquals(HostRoleStatus.QUEUED, stages.get(0).getHostRoleStatus(hostname1,
"DATANODE"));
@@ -943,7 +908,6 @@ public class TestActionScheduler {
     ServiceComponent scomp = mock(ServiceComponent.class);
     ServiceComponentHost sch = mock(ServiceComponentHost.class);
     UnitOfWork unitOfWork = mock(UnitOfWork.class);
-    RequestFactory requestFactory = mock(RequestFactory.class);
     when(fsm.getCluster(anyString())).thenReturn(oneClusterMock);
     when(oneClusterMock.getService(anyString())).thenReturn(serviceObj);
     when(serviceObj.getServiceComponent(anyString())).thenReturn(scomp);
@@ -1011,11 +975,6 @@ public class TestActionScheduler {
             new HostsMap((String) null),
             unitOfWork, null, conf);
 
-    ActionManager am = new ActionManager(
-        2, 2, aq, fsm, db, new HostsMap((String) null),
-        unitOfWork,
-        requestFactory, conf, null);
-
     scheduler.doWork();
 
     Assert.assertEquals(HostRoleStatus.QUEUED, stages.get(0).getHostRoleStatus(hostname1,
"HIVE_CLIENT"));
@@ -1038,7 +997,6 @@ public class TestActionScheduler {
     ServiceComponent scomp = mock(ServiceComponent.class);
     ServiceComponentHost sch = mock(ServiceComponentHost.class);
     UnitOfWork unitOfWork = mock(UnitOfWork.class);
-    RequestFactory requestFactory = mock(RequestFactory.class);
     when(fsm.getCluster(anyString())).thenReturn(oneClusterMock);
     when(oneClusterMock.getService(anyString())).thenReturn(serviceObj);
     when(serviceObj.getServiceComponent(anyString())).thenReturn(scomp);
@@ -1088,11 +1046,6 @@ public class TestActionScheduler {
         new HostsMap((String) null),
         unitOfWork, null, conf);
 
-    ActionManager am = new ActionManager(
-        2, 2, aq, fsm, db, new HostsMap((String) null),
-        unitOfWork,
-        requestFactory, conf, null);
-
     scheduler.doWork();
 
     Assert.assertEquals(HostRoleStatus.QUEUED, stages.get(0).getHostRoleStatus(hostname1,
"NAMENODE"));
@@ -1143,16 +1096,15 @@ public class TestActionScheduler {
 
     when(db.getCommandsInProgressCount()).thenReturn(stages.size());
     when(db.getStagesInProgress()).thenReturn(stages);
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         List<CommandReport> reports = (List<CommandReport>) invocation.getArguments()[0];
         for (CommandReport report : reports) {
           String actionId = report.getActionId();
           long[] requestStageIds = StageUtils.getRequestStage(actionId);
           Long requestId = requestStageIds[0];
           Long stageId = requestStageIds[1];
-          String role = report.getRole();
           Long id = report.getTaskId();
           for (Stage stage : stages) {
             if (requestId.equals(stage.getRequestId()) && stageId.equals(stage.getStageId()))
{
@@ -1184,9 +1136,9 @@ public class TestActionScheduler {
         return null;
       }
     });
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         Long requestId = (Long) invocation.getArguments()[0];
         for (Stage stage : stages) {
           if (requestId.equals(stage.getRequestId())) {
@@ -1251,7 +1203,6 @@ public class TestActionScheduler {
     ServiceComponent scomp = mock(ServiceComponent.class);
     ServiceComponentHost sch = mock(ServiceComponentHost.class);
     UnitOfWork unitOfWork = mock(UnitOfWork.class);
-    RequestFactory requestFactory = mock(RequestFactory.class);
     when(fsm.getCluster(anyString())).thenReturn(oneClusterMock);
     when(oneClusterMock.getService(anyString())).thenReturn(serviceObj);
     when(serviceObj.getServiceComponent(anyString())).thenReturn(scomp);
@@ -1332,9 +1283,9 @@ public class TestActionScheduler {
 
     when(db.getCommandsInProgressCount()).thenReturn(stages.size());
     when(db.getStagesInProgress()).thenReturn(stages);
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         String host = (String) invocation.getArguments()[0];
         Long requestId = (Long) invocation.getArguments()[1];
         Long stageId = (Long) invocation.getArguments()[2];
@@ -1365,9 +1316,9 @@ public class TestActionScheduler {
         return null;
       }
     });
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         Long requestId = (Long) invocation.getArguments()[0];
         for (Stage stage : stages) {
           if (requestId.equals(stage.getRequestId())) {
@@ -1390,8 +1341,6 @@ public class TestActionScheduler {
     ActionScheduler scheduler = new ActionScheduler(100, 10000, db, aq, fsm, 3,
         new HostsMap((String) null),
         unitOfWork, null, conf);
-    ActionManager am = new ActionManager(
-        2, 10000, aq, fsm, db, new HostsMap((String) null), unitOfWork, requestFactory, conf,
null);
 
     scheduler.doWork();
 
@@ -1511,16 +1460,15 @@ public class TestActionScheduler {
 
     when(db.getCommandsInProgressCount()).thenReturn(stages.size());
     when(db.getStagesInProgress()).thenReturn(stages);
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         List<CommandReport> reports = (List<CommandReport>) invocation.getArguments()[0];
         for (CommandReport report : reports) {
           String actionId = report.getActionId();
           long[] requestStageIds = StageUtils.getRequestStage(actionId);
           Long requestId = requestStageIds[0];
           Long stageId = requestStageIds[1];
-          String role = report.getRole();
           Long id = report.getTaskId();
           for (Stage stage : stages) {
             if (requestId.equals(stage.getRequestId()) && stageId.equals(stage.getStageId()))
{
@@ -1552,9 +1500,9 @@ public class TestActionScheduler {
         return null;
       }
     });
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         Long requestId = (Long) invocation.getArguments()[0];
         for (Stage stage : stages) {
           if (requestId.equals(stage.getRequestId())) {
@@ -1882,26 +1830,11 @@ public class TestActionScheduler {
     Properties properties = new Properties();
     Configuration conf = new Configuration(properties);
     Clusters fsm = mock(Clusters.class);
-    Cluster oneClusterMock = mock(Cluster.class);
-    Service serviceObj = mock(Service.class);
-    ServiceComponent scomp = mock(ServiceComponent.class);
-    ServiceComponentHost sch = mock(ServiceComponentHost.class);
     UnitOfWork unitOfWork = mock(UnitOfWork.class);
-    when(fsm.getCluster(anyString())).thenReturn(oneClusterMock);
-    when(oneClusterMock.getService(anyString())).thenReturn(serviceObj);
-    when(serviceObj.getServiceComponent(anyString())).thenReturn(scomp);
-    when(scomp.getServiceComponentHost(anyString())).thenReturn(sch);
-    when(serviceObj.getCluster()).thenReturn(oneClusterMock);
-
-    HashMap<String, ServiceComponentHost> hosts =
-            new HashMap<String, ServiceComponentHost>();
-    hosts.put(serverHostname, sch);
-    when(scomp.getServiceComponentHosts()).thenReturn(hosts);
 
     List<Stage> stages = new ArrayList<Stage>();
     Map<String, String> payload = new HashMap<String, String>();
     final Stage s = getStageWithServerAction(1, 977, payload, "test", 300);
-    s.getExecutionCommands().get(serverHostname).get(0).getExecutionCommand().setServiceName(null);
     stages.add(s);
 
     ActionDBAccessor db = mock(ActionDBAccessor.class);
@@ -1912,37 +1845,45 @@ public class TestActionScheduler {
 
     when(db.getCommandsInProgressCount()).thenReturn(stages.size());
     when(db.getStagesInProgress()).thenReturn(stages);
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         String host = (String) invocation.getArguments()[0];
         String role = (String) invocation.getArguments()[3];
         CommandReport commandReport = (CommandReport) invocation.getArguments()[4];
-        HostRoleCommand command = s.getHostRoleCommand(host, role);
+
+        HostRoleCommand command = null;
+        if (null == host) {
+          command = s.getHostRoleCommand(null, role);
+        } else {
+          command = s.getHostRoleCommand(host, role);
+        }
+
         command.setStatus(HostRoleStatus.valueOf(commandReport.getStatus()));
         return null;
       }
     }).when(db).updateHostRoleState(anyString(), anyLong(), anyLong(), anyString(), any(CommandReport.class));
-    doAnswer(new Answer() {
+
+    doAnswer(new Answer<List<HostRoleCommand>>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
-        String host = (String) invocation.getArguments()[0];
+      public List<HostRoleCommand> answer(InvocationOnMock invocation) throws Throwable
{
         String role = (String) invocation.getArguments()[1];
         HostRoleStatus status = (HostRoleStatus) invocation.getArguments()[2];
 
-        HostRoleCommand task = s.getHostRoleCommand(host, role);
+        HostRoleCommand task = s.getHostRoleCommand(null, role);
 
         if (task.getStatus() == status) {
           return Arrays.asList(task);
         } else {
-          return null;
+          return Collections.emptyList();
         }
       }
     }).when(db).getTasksByHostRoleAndStatus(anyString(), anyString(), any(HostRoleStatus.class));
-    doAnswer(new Answer() {
+
+    doAnswer(new Answer<HostRoleCommand>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
-        return s.getHostRoleCommand(serverHostname, "AMBARI_SERVER_ACTION");
+      public HostRoleCommand answer(InvocationOnMock invocation) throws Throwable {
+        return s.getHostRoleCommand(null, "AMBARI_SERVER_ACTION");
       }
     }).when(db).getTask(anyLong());
 
@@ -1951,13 +1892,13 @@ public class TestActionScheduler {
         new HostsMap((String) null), unitOfWork, null, conf);
 
     int cycleCount = 0;
-    while (!stages.get(0).getHostRoleStatus(serverHostname, "AMBARI_SERVER_ACTION")
+    while (!stages.get(0).getHostRoleStatus(null, "AMBARI_SERVER_ACTION")
         .equals(HostRoleStatus.COMPLETED) && cycleCount++ <= MAX_CYCLE_ITERATIONS)
{
       scheduler.doWork();
       scheduler.getServerActionExecutor().doWork();
     }
 
-    assertEquals(stages.get(0).getHostRoleStatus(serverHostname, "AMBARI_SERVER_ACTION"),
+    assertEquals(stages.get(0).getHostRoleStatus(null, "AMBARI_SERVER_ACTION"),
             HostRoleStatus.COMPLETED);
   }
 
@@ -1970,7 +1911,6 @@ public class TestActionScheduler {
     ServiceComponent scomp = mock(ServiceComponent.class);
     ServiceComponentHost sch = mock(ServiceComponentHost.class);
     UnitOfWork unitOfWork = mock(UnitOfWork.class);
-    RequestFactory requestFactory = mock(RequestFactory.class);
     when(fsm.getCluster(anyString())).thenReturn(oneClusterMock);
     when(oneClusterMock.getService(anyString())).thenReturn(serviceObj);
     when(serviceObj.getServiceComponent(anyString())).thenReturn(scomp);
@@ -2019,16 +1959,15 @@ public class TestActionScheduler {
     }
     when(db.getRequestTasks(anyLong())).thenReturn(requestTasks);
     when(db.getAllStages(anyLong())).thenReturn(stages);
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         List<CommandReport> reports = (List<CommandReport>) invocation.getArguments()[0];
         for (CommandReport report : reports) {
           String actionId = report.getActionId();
           long[] requestStageIds = StageUtils.getRequestStage(actionId);
           Long requestId = requestStageIds[0];
           Long stageId = requestStageIds[1];
-          String role = report.getRole();
           Long id = report.getTaskId();
           for (Stage stage : stages) {
             if (requestId.equals(stage.getRequestId()) && stageId.equals(stage.getStageId()))
{
@@ -2060,9 +1999,9 @@ public class TestActionScheduler {
         return null;
       }
     });
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         Long requestId = (Long) invocation.getArguments()[0];
         for (Stage stage : stages) {
           if (requestId.equals(stage.getRequestId())) {
@@ -2086,10 +2025,6 @@ public class TestActionScheduler {
     ActionScheduler scheduler = new ActionScheduler(100, 50, db, aq, fsm, 3,
         new HostsMap((String) null), unitOfWork, null, conf);
 
-    ActionManager am = new ActionManager(
-        2, 2, aq, fsm, db, new HostsMap((String) null),
-        unitOfWork, requestFactory, conf, null);
-
     scheduler.doWork();
 
     String reason = "Some reason";
@@ -2116,7 +2051,6 @@ public class TestActionScheduler {
     ServiceComponent scomp = mock(ServiceComponent.class);
     ServiceComponentHost sch = mock(ServiceComponentHost.class);
     UnitOfWork unitOfWork = mock(UnitOfWork.class);
-    RequestFactory requestFactory = mock(RequestFactory.class);
     when(fsm.getCluster(anyString())).thenReturn(oneClusterMock);
     when(oneClusterMock.getService(anyString())).thenReturn(serviceObj);
     when(serviceObj.getServiceComponent(anyString())).thenReturn(scomp);
@@ -2184,16 +2118,15 @@ public class TestActionScheduler {
     }
     when(db.getRequestTasks(anyLong())).thenReturn(requestTasks);
     when(db.getAllStages(anyLong())).thenReturn(stagesInProgress);
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         List<CommandReport> reports = (List<CommandReport>) invocation.getArguments()[0];
         for (CommandReport report : reports) {
           String actionId = report.getActionId();
           long[] requestStageIds = StageUtils.getRequestStage(actionId);
           Long requestId = requestStageIds[0];
           Long stageId = requestStageIds[1];
-          String role = report.getRole();
           Long id = report.getTaskId();
           for (Stage stage : stagesInProgress) {
             if (requestId.equals(stage.getRequestId()) && stageId.equals(stage.getStageId()))
{
@@ -2227,9 +2160,9 @@ public class TestActionScheduler {
     });
 
     final Map<Long, Boolean> startedRequests = new HashMap<Long, Boolean>();
-    doAnswer(new Answer() {
+    doAnswer(new Answer<Void>() {
       @Override
-      public Object answer(InvocationOnMock invocation) throws Throwable {
+      public Void answer(InvocationOnMock invocation) throws Throwable {
         startedRequests.put((Long)invocation.getArguments()[0], true);
         return null;
       }
@@ -2252,10 +2185,6 @@ public class TestActionScheduler {
     ActionScheduler scheduler = new ActionScheduler(100, 50, db, aq, fsm, 3,
         new HostsMap((String) null), unitOfWork, null, conf);
 
-    ActionManager am = new ActionManager(
-        2, 2, aq, fsm, db, new HostsMap((String) null),
-        unitOfWork, requestFactory, conf, null);
-
     // Execution of request 1
 
     scheduler.doWork();

http://git-wip-us.apache.org/repos/asf/ambari/blob/24ce16b5/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 069f67d..204b865 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
@@ -8078,11 +8078,9 @@ public class AmbariManagementControllerTest {
     stages.add(stageFactory.createNew(requestId3, "/a6", clusterName, 1L, context,
       CLUSTER_HOST_INFO, "", ""));
     stages.get(0).setStageId(6);
-    stages.get(0).addServerActionCommand("some.action.class.name", Role.AMBARI_SERVER_ACTION,
-        RoleCommand.EXECUTE, clusterName, serviceComponentHostServerActionEvent, null, null,
-        null, null,false, false);
-    assertEquals(StageUtils.getHostName(), stages.get(0).getOrderedHostRoleCommands().get(0).getHostName());
-
+    stages.get(0).addServerActionCommand("some.action.class.name", null, Role.AMBARI_SERVER_ACTION,
+        RoleCommand.EXECUTE, clusterName, serviceComponentHostServerActionEvent, null, null,
null, null, false, false);
+    assertEquals("_internal_ambari", stages.get(0).getOrderedHostRoleCommands().get(0).getHostName());
     request = new Request(stages, clusters);
     actionDB.persistActions(request);
 
@@ -8134,7 +8132,7 @@ public class AmbariManagementControllerTest {
     assertNotNull(response);
     assertEquals(6L, response.getTaskId());
     // The host name for the task should be the same as what StageUtils#getHostName returns
since
-    // the host was specifed as null when
+    // the host was specified as null when
     assertEquals(StageUtils.getHostName(), response.getHostName());
 
     //verify that task from second request (requestId2) does not present in first request
(requestId1)

http://git-wip-us.apache.org/repos/asf/ambari/blob/24ce16b5/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
index a779949..17c15b2 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/UpgradeResourceProviderTest.java
@@ -107,14 +107,6 @@ import com.google.inject.util.Modules;
  */
 public class UpgradeResourceProviderTest {
 
-  /**
-   * Server-side Actions still require a host in the cluster, so just use the
-   * local hostname when adding any host to the cluster. This prevents all sorts
-   * of problems when creating stages and tasks since the hosts in the cluster
-   * will now match the localhost.
-   */
-  private String s_serverHostName = StageUtils.getHostName();
-
   private UpgradeDAO upgradeDao = null;
   private RepositoryVersionDAO repoVersionDao = null;
   private Injector injector;
@@ -207,8 +199,8 @@ public class UpgradeResourceProviderTest {
     cluster.createClusterVersion(stack211, stack211.getStackVersion(), "admin", RepositoryVersionState.UPGRADING);
     cluster.transitionClusterVersion(stack211, stack211.getStackVersion(), RepositoryVersionState.CURRENT);
 
-    clusters.addHost(s_serverHostName);
-    Host host = clusters.getHost(s_serverHostName);
+    clusters.addHost("h1");
+    Host host = clusters.getHost("h1");
     Map<String, String> hostAttributes = new HashMap<String, String>();
     hostAttributes.put("os_family", "redhat");
     hostAttributes.put("os_release_version", "6.3");
@@ -216,7 +208,7 @@ public class UpgradeResourceProviderTest {
     host.setState(HostState.HEALTHY);
     host.persist();
 
-    clusters.mapHostToCluster(s_serverHostName, "c1");
+    clusters.mapHostToCluster("h1", "c1");
 
     // add a single ZK server
     Service service = cluster.addService("ZOOKEEPER");
@@ -224,11 +216,11 @@ public class UpgradeResourceProviderTest {
     service.persist();
 
     ServiceComponent component = service.addServiceComponent("ZOOKEEPER_SERVER");
-    ServiceComponentHost sch = component.addServiceComponentHost(s_serverHostName);
+    ServiceComponentHost sch = component.addServiceComponentHost("h1");
     sch.setVersion("2.1.1.0");
 
     component = service.addServiceComponent("ZOOKEEPER_CLIENT");
-    sch = component.addServiceComponentHost(s_serverHostName);
+    sch = component.addServiceComponentHost("h1");
     sch.setVersion("2.1.1.0");
 
     TopologyManager topologyManager = new TopologyManager();

http://git-wip-us.apache.org/repos/asf/ambari/blob/24ce16b5/ambari-server/src/test/java/org/apache/ambari/server/serveraction/ServerActionExecutorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/ServerActionExecutorTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/ServerActionExecutorTest.java
index f9b023f..c3ada2b 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/serveraction/ServerActionExecutorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/serveraction/ServerActionExecutorTest.java
@@ -122,9 +122,7 @@ public class ServerActionExecutorTest {
         "{\"host_param\":\"param_value\"}", "{\"stage_param\":\"param_value\"}");
 
     stage.addServerActionCommand(ManualStageAction.class.getName(),
-        null, Role.AMBARI_SERVER_ACTION,
-        RoleCommand.EXECUTE,
-        "cluster1", SERVER_HOST_NAME,
+        null, Role.AMBARI_SERVER_ACTION, RoleCommand.EXECUTE, "cluster1",
         new ServiceComponentHostServerActionEvent(StageUtils.getHostName(), System.currentTimeMillis()),
         Collections.<String, String> emptyMap(), null, null, 1200, false, false);
 
@@ -321,8 +319,8 @@ public class ServerActionExecutorTest {
                 1L, requestContext, CLUSTER_HOST_INFO, "{}", "{}");
 
             stage.setStageId(stageId);
-            stage.addServerActionCommand(MockServerAction.class.getName(), Role.AMBARI_SERVER_ACTION,
-                RoleCommand.EXECUTE, "cluster1",
+            stage.addServerActionCommand(MockServerAction.class.getName(), null,
+                Role.AMBARI_SERVER_ACTION, RoleCommand.EXECUTE, "cluster1",
                 new ServiceComponentHostServerActionEvent(SERVER_HOST_NAME, System.currentTimeMillis()),
                 payload, "command detail", null, timeout, false, false);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/24ce16b5/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
b/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
index c9d7856..3c192a2 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/stageplanner/TestStagePlanner.java
@@ -126,11 +126,11 @@ public class TestStagePlanner {
     Stage stage = stageFactory.createNew(1, "/tmp", "cluster1", 1L,  "execution command wrapper
test",
             "clusterHostInfo", "commandParamsStage", "hostParamsStage");
     stage.setStageId(1);
-    stage.addServerActionCommand("RESTART", Role.HIVE_METASTORE,
+    stage.addServerActionCommand("RESTART", null, Role.HIVE_METASTORE,
             RoleCommand.CUSTOM_COMMAND, "cluster1",
             new ServiceComponentHostServerActionEvent("host2", System.currentTimeMillis()),
             null, "command detail", null, null, false, false);
-    stage.addServerActionCommand("RESTART", Role.MYSQL_SERVER,
+    stage.addServerActionCommand("RESTART", null, Role.MYSQL_SERVER,
             RoleCommand.CUSTOM_COMMAND, "cluster1",
             new ServiceComponentHostServerActionEvent("host2", System.currentTimeMillis()),
             null, "command detail", null, null, false, false);

http://git-wip-us.apache.org/repos/asf/ambari/blob/24ce16b5/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
index 76e96d1..a8ef7bc 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog213Test.java
@@ -89,6 +89,7 @@ import com.google.inject.Injector;
 import com.google.inject.Module;
 import com.google.inject.Provider;
 import com.google.inject.persist.PersistService;
+import java.lang.reflect.Field;
 
 /**
  * {@link org.apache.ambari.server.upgrade.UpgradeCatalog213} unit tests.
@@ -135,7 +136,23 @@ public class UpgradeCatalog213Test {
     final DBAccessor dbAccessor = createNiceMock(DBAccessor.class);
     UpgradeCatalog213 upgradeCatalog = (UpgradeCatalog213) getUpgradeCatalog(dbAccessor);
 
+    Configuration configuration = createNiceMock(Configuration.class);
+    expect(configuration.getDatabaseUrl()).andReturn(Configuration.JDBC_IN_MEMORY_URL).anyTimes();
+
+    Capture<DBAccessor.DBColumnInfo> columnCapture = EasyMock.newCapture();
+    dbAccessor.alterColumn(eq("host_role_command"), capture(columnCapture));
+    expectLastCall();
+
+    replay(dbAccessor, configuration);
+    Class<?> c = AbstractUpgradeCatalog.class;
+    Field f = c.getDeclaredField("configuration");
+    f.setAccessible(true);
+    f.set(upgradeCatalog, configuration);
+
     upgradeCatalog.executeDDLUpdates();
+    verify(dbAccessor, configuration);
+
+    Assert.assertTrue(columnCapture.getValue().isNullable());
   }
 
   @Test
@@ -798,6 +815,7 @@ public class UpgradeCatalog213Test {
     Capture<String> capturedPKColumn = EasyMock.newCapture();
     Capture<List<DBAccessor.DBColumnInfo>> capturedColumns = EasyMock.newCapture();
     Capture<DBAccessor.DBColumnInfo> capturedColumn = EasyMock.newCapture();
+    Capture<DBAccessor.DBColumnInfo> capturedHostRoleCommandColumn = EasyMock.newCapture();
 
     EasyMock.expect(mockedInjector.getInstance(DaoUtils.class)).andReturn(mockedDaoUtils);
     mockedInjector.injectMembers(anyObject(UpgradeCatalog.class));
@@ -816,6 +834,7 @@ public class UpgradeCatalog213Test {
 
     // addKerberosDescriptorTable
     mockedDbAccessor.createTable(capture(capturedTableName), capture(capturedColumns), capture(capturedPKColumn));
+    mockedDbAccessor.alterColumn(eq("host_role_command"), capture(capturedHostRoleCommandColumn));
 
     mocksControl.replay();
 


Mime
View raw message