use of com.cloud.agent.api.CheckHealthCommand in project cosmic by MissionCriticalCloud.
the class NiciraCheckHealthCommandWrapperTest method tetsExecuteWhenClusterIsNotStable.
@Test
public void tetsExecuteWhenClusterIsNotStable() throws Exception {
when(niciraApi.getControlClusterStatus()).thenReturn(new ControlClusterStatus());
final NiciraCheckHealthCommandWrapper commandWrapper = new NiciraCheckHealthCommandWrapper();
final Answer answer = commandWrapper.execute(new CheckHealthCommand(), niciraResource);
assertThat(answer.getResult(), equalTo(false));
}
use of com.cloud.agent.api.CheckHealthCommand in project cosmic by MissionCriticalCloud.
the class NiciraCheckHealthCommandWrapperTest method tetsExecuteWhenClusterIsStable.
@Test
public void tetsExecuteWhenClusterIsStable() throws Exception {
final ControlClusterStatus statusValue = mock(ControlClusterStatus.class);
when(statusValue.getClusterStatus()).thenReturn("stable");
when(niciraApi.getControlClusterStatus()).thenReturn(statusValue);
final NiciraCheckHealthCommandWrapper commandWrapper = new NiciraCheckHealthCommandWrapper();
final Answer answer = commandWrapper.execute(new CheckHealthCommand(), niciraResource);
assertThat(answer.getResult(), equalTo(true));
}
use of com.cloud.agent.api.CheckHealthCommand in project cosmic by MissionCriticalCloud.
the class NiciraCheckHealthCommandWrapperTest method tetsExecuteWhenApiThrowsException.
@Test
public void tetsExecuteWhenApiThrowsException() throws Exception {
when(niciraApi.getControlClusterStatus()).thenThrow(NiciraNvpApiException.class);
final NiciraCheckHealthCommandWrapper commandWrapper = new NiciraCheckHealthCommandWrapper();
final Answer answer = commandWrapper.execute(new CheckHealthCommand(), niciraResource);
assertThat(answer.getResult(), equalTo(false));
}
use of com.cloud.agent.api.CheckHealthCommand in project cosmic by MissionCriticalCloud.
the class NotAValidCommand method testCheckHealthCommand.
@Test
public void testCheckHealthCommand() {
final CheckHealthCommand checkHealthCommand = new CheckHealthCommand();
final CitrixRequestWrapper wrapper = CitrixRequestWrapper.getInstance();
assertNotNull(wrapper);
final Answer answer = wrapper.execute(checkHealthCommand, citrixResourceBase);
assertFalse(answer.getResult());
}
use of com.cloud.agent.api.CheckHealthCommand in project cloudstack by apache.
the class Ovm3HypervisorSupportTest method checkHealthTest.
@Test
public void checkHealthTest() throws ConfigurationException {
con = prepare();
CheckHealthCommand cmd = new CheckHealthCommand();
Answer ra = hypervisor.executeRequest(cmd);
results.basicBooleanTest(ra.getResult());
}
Aggregations