Repository: ambari Updated Branches: refs/heads/trunk 2ec55887c -> 85ff51496
http://git-wip-us.apache.org/repos/asf/ambari/blob/85ff5149/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 dd2a519..0a381f9 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 @@ -89,10 +89,10 @@ public class TestStagePlanner { Stage stage = StageUtils.getATestStage(1, 1, "host1", "", ""); stage.addHostRoleExecutionCommand("host2", Role.HBASE_MASTER, RoleCommand.START, new ServiceComponentHostStartEvent("HBASE_MASTER", - "host2", now), "cluster1", "HBASE"); + "host2", now), "cluster1", "HBASE", false); stage.addHostRoleExecutionCommand("host3", Role.ZOOKEEPER_SERVER, RoleCommand.START, new ServiceComponentHostStartEvent("ZOOKEEPER_SERVER", - "host3", now), "cluster1", "ZOOKEEPER"); + "host3", now), "cluster1", "ZOOKEEPER", false); System.out.println(stage.toString()); rg.build(stage); @@ -115,37 +115,37 @@ public class TestStagePlanner { Stage stage = StageUtils.getATestStage(1, 1, "host1", "", ""); stage.addHostRoleExecutionCommand("host11", Role.SECONDARY_NAMENODE, RoleCommand.START, new ServiceComponentHostStartEvent("SECONDARY_NAMENODE", - "host11", now), "cluster1", "HDFS"); + "host11", now), "cluster1", "HDFS", false); stage.addHostRoleExecutionCommand("host2", Role.HBASE_MASTER, RoleCommand.START, new ServiceComponentHostStartEvent("HBASE_MASTER", - "host2", now), "cluster1", "HBASE"); + "host2", now), "cluster1", "HBASE", false); stage.addHostRoleExecutionCommand("host3", Role.ZOOKEEPER_SERVER, RoleCommand.START, new ServiceComponentHostStartEvent("ZOOKEEPER_SERVER", - "host3", now), "cluster1", "ZOOKEEPER"); + "host3", now), "cluster1", "ZOOKEEPER", false); stage.addHostRoleExecutionCommand("host4", Role.DATANODE, RoleCommand.START, new ServiceComponentHostStartEvent("DATANODE", - "host4", now), "cluster1", "HDFS"); + "host4", now), "cluster1", "HDFS", false); stage.addHostRoleExecutionCommand("host4", Role.HBASE_REGIONSERVER, RoleCommand.START, new ServiceComponentHostStartEvent("HBASE_REGIONSERVER", - "host4", now), "cluster1", "HBASE"); + "host4", now), "cluster1", "HBASE", false); stage.addHostRoleExecutionCommand("host4", Role.TASKTRACKER, RoleCommand.START, new ServiceComponentHostStartEvent("TASKTRACKER", - "host4", now), "cluster1", "MAPREDUCE"); + "host4", now), "cluster1", "MAPREDUCE", false); stage.addHostRoleExecutionCommand("host5", Role.JOBTRACKER, RoleCommand.START, new ServiceComponentHostStartEvent("JOBTRACKER", - "host5", now), "cluster1", "MAPREDUCE"); + "host5", now), "cluster1", "MAPREDUCE", false); stage.addHostRoleExecutionCommand("host6", Role.OOZIE_SERVER, RoleCommand.START, new ServiceComponentHostStartEvent("OOZIE_SERVER", - "host6", now), "cluster1", "OOZIE"); + "host6", now), "cluster1", "OOZIE", false); stage.addHostRoleExecutionCommand("host7", Role.WEBHCAT_SERVER, RoleCommand.START, new ServiceComponentHostStartEvent("WEBHCAT_SERVER", - "host7", now), "cluster1", "WEBHCAT"); + "host7", now), "cluster1", "WEBHCAT", false); stage.addHostRoleExecutionCommand("host4", Role.GANGLIA_MONITOR, RoleCommand.START, new ServiceComponentHostStartEvent("GANGLIA_MONITOR", - "host4", now), "cluster1", "GANGLIA"); + "host4", now), "cluster1", "GANGLIA", false); stage.addHostRoleExecutionCommand("host9", Role.GANGLIA_SERVER, RoleCommand.START, new ServiceComponentHostStartEvent("GANGLIA_SERVER", - "host9", now), "cluster1", "GANGLIA"); + "host9", now), "cluster1", "GANGLIA", false); System.out.println(stage.toString()); rg.build(stage); System.out.println(rg.stringifyGraph()); http://git-wip-us.apache.org/repos/asf/ambari/blob/85ff5149/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java index f8d061a..cd68dc1 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog200Test.java @@ -118,6 +118,7 @@ public class UpgradeCatalog200Test { Capture<DBAccessor.DBColumnInfo> hostComponentStateSecurityStateColumnCapture = new Capture<DBAccessor.DBColumnInfo>(); Capture<DBAccessor.DBColumnInfo> hostComponentDesiredStateSecurityStateColumnCapture = new Capture<DBAccessor.DBColumnInfo>(); Capture<DBAccessor.DBColumnInfo> hostRoleCommandRetryColumnCapture = new Capture<DBAccessor.DBColumnInfo>(); + Capture<DBAccessor.DBColumnInfo> stageSkippableColumnCapture = new Capture<DBAccessor.DBColumnInfo>(); Capture<DBAccessor.DBColumnInfo> viewparameterLabelColumnCapture = new Capture<DBAccessor.DBColumnInfo>(); Capture<DBAccessor.DBColumnInfo> viewparameterPlaceholderColumnCapture = new Capture<DBAccessor.DBColumnInfo>(); @@ -156,6 +157,10 @@ public class UpgradeCatalog200Test { dbAccessor.addColumn(eq("host_role_command"), capture(hostRoleCommandRetryColumnCapture)); + // Stage skippable + dbAccessor.addColumn(eq("stage"), + capture(stageSkippableColumnCapture)); + // Host Component State: security State dbAccessor.addColumn(eq("hostcomponentstate"), capture(hostComponentStateSecurityStateColumnCapture)); @@ -230,6 +235,14 @@ public class UpgradeCatalog200Test { assertEquals(0, upgradeRetryColumn.getDefaultValue()); assertFalse(upgradeRetryColumn.isNullable()); + // Verify added column in host_role_command table + DBAccessor.DBColumnInfo upgradeSkippableColumn = stageSkippableColumnCapture.getValue(); + assertEquals("skippable", upgradeSkippableColumn.getName()); + assertEquals(1, (int) upgradeSkippableColumn.getLength()); + assertEquals(Integer.class, upgradeSkippableColumn.getType()); + assertEquals(0, upgradeSkippableColumn.getDefaultValue()); + assertFalse(upgradeSkippableColumn.isNullable()); + // verify security_state columns verifyComponentSecurityStateColumn(hostComponentStateSecurityStateColumnCapture); verifyComponentSecurityStateColumn(hostComponentDesiredStateSecurityStateColumnCapture);
