|
@@ -106,7 +106,7 @@ public class
|
|
|
@Test
|
|
|
public void testRefreshQueueCustomCommand() {
|
|
|
try {
|
|
|
- createClusterFixture();
|
|
|
+ createClusterFixture("HDP-2.0.6");
|
|
|
|
|
|
Map<String, String> requestProperties = new HashMap<String, String>() {
|
|
|
{
|
|
@@ -151,7 +151,7 @@ public class
|
|
|
|
|
|
@Test
|
|
|
public void testHostsFilterHealthy() throws Exception {
|
|
|
- createClusterFixture();
|
|
|
+ createClusterFixture("HDP-2.0.6");
|
|
|
|
|
|
Map<String, String> requestProperties = new HashMap<String, String>() {
|
|
|
{
|
|
@@ -192,7 +192,7 @@ public class
|
|
|
@Test
|
|
|
public void testHostsFilterUnhealthyHost(){
|
|
|
try {
|
|
|
- createClusterFixture();
|
|
|
+ createClusterFixture("HDP-2.0.6");
|
|
|
|
|
|
// Set custom status to host
|
|
|
clusters.getHost("c6402").setState(HostState.HEARTBEAT_LOST);
|
|
@@ -236,7 +236,7 @@ public class
|
|
|
@Test
|
|
|
public void testHostsFilterUnhealthyComponent(){
|
|
|
try {
|
|
|
- createClusterFixture();
|
|
|
+ createClusterFixture("HDP-2.0.6");
|
|
|
|
|
|
// Set custom status to host
|
|
|
clusters.getCluster("c1").getService("GANGLIA").getServiceComponent("GANGLIA_MONITOR").getServiceComponentHost("c6402")
|
|
@@ -278,8 +278,19 @@ public class
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private void createClusterFixture() throws AmbariException {
|
|
|
- createCluster("c1");
|
|
|
+ @Test
|
|
|
+ public void testIsTopologyRefreshRequired() throws Exception {
|
|
|
+ AmbariCustomCommandExecutionHelper helper = injector.getInstance(AmbariCustomCommandExecutionHelper.class);
|
|
|
+
|
|
|
+ createClusterFixture("HDP-2.1.1");
|
|
|
+
|
|
|
+ Assert.assertTrue(helper.isTopologyRefreshRequired("START", "c1", "HDFS"));
|
|
|
+ Assert.assertTrue(helper.isTopologyRefreshRequired("RESTART", "c1", "HDFS"));
|
|
|
+ Assert.assertFalse(helper.isTopologyRefreshRequired("STOP", "c1", "HDFS"));
|
|
|
+ }
|
|
|
+
|
|
|
+ private void createClusterFixture(String stackVersion) throws AmbariException {
|
|
|
+ createCluster("c1", stackVersion);
|
|
|
addHost("c6401","c1");
|
|
|
addHost("c6402","c1");
|
|
|
|
|
@@ -318,9 +329,9 @@ public class
|
|
|
host.setHostAttributes(hostAttributes);
|
|
|
}
|
|
|
|
|
|
- private void createCluster(String clusterName) throws AmbariException {
|
|
|
+ private void createCluster(String clusterName, String stackVersion) throws AmbariException {
|
|
|
ClusterRequest r = new ClusterRequest(null, clusterName, State.INSTALLED.name(),
|
|
|
- SecurityType.NONE, "HDP-2.0.6", null);
|
|
|
+ SecurityType.NONE, stackVersion, null);
|
|
|
controller.createCluster(r);
|
|
|
}
|
|
|
|