use of functionaltests.nodesource.TestSSHInfrastructureV2 in project scheduling by ow2-proactive.
the class RecoverSSHInfrastructureV2Test method startRmAndCheckInitialState.
private void startRmAndCheckInitialState() throws Exception {
// start RM
startRmWithConfig(START_CONFIG);
assertThat(PAResourceManagerProperties.RM_PRESERVE_NODES_ON_SHUTDOWN.getValueAsBoolean()).isTrue();
assertThat(rmHelper.isRMStarted()).isTrue();
// check the initial state of the RM
assertThat(resourceManager.getState().getAllNodes().size()).isEqualTo(0);
resourceManager.createNodeSource(NODE_SOURCE_NAME, SSHInfrastructureV2.class.getName(), TestSSHInfrastructureV2.infraParams, StaticPolicy.class.getName(), TestSSHInfrastructureV2.policyParameters, NODES_RECOVERABLE);
RMTHelper.waitForNodeSourceCreation(NODE_SOURCE_NAME, TestSSHInfrastructureV2.NB_NODES, this.rmHelper.getMonitorsHandler());
RMMonitorEventReceiver resourceManagerMonitor = (RMMonitorEventReceiver) resourceManager;
List<RMNodeSourceEvent> nodeSourceEvent = resourceManagerMonitor.getInitialState().getNodeSourceEvents();
assertThat(nodeSourceEvent.size()).isEqualTo(1);
assertThat(nodeSourceEvent.get(0).getSourceName()).isEqualTo(NODE_SOURCE_NAME);
assertThat(resourceManagerMonitor.getState().getAllNodes().size()).isEqualTo(TestSSHInfrastructureV2.NB_NODES);
}
Aggregations