use of functionaltests.utils.RMTHelper in project scheduling by ow2-proactive.
the class RecoverDefaultInfrastructureTest method restartRmAndCheckFinalState.
private void restartRmAndCheckFinalState() throws Exception {
// restart RM
this.rmHelper = new RMTHelper();
this.startRmWithConfig(RESTART_CONFIG);
assertThat(PAResourceManagerProperties.RM_PRESERVE_NODES_ON_SHUTDOWN.getValueAsBoolean()).isFalse();
assertThat(this.rmHelper.isRMStarted()).isTrue();
// re-snapshot the RM state
RMMonitorEventReceiver resourceManagerMonitor = (RMMonitorEventReceiver) this.resourceManager;
List<RMNodeSourceEvent> nodeSourceEvent = resourceManagerMonitor.getInitialState().getNodeSourceEvents();
// the node source has been recovered on restart: we should have one node source with the same name
assertThat(nodeSourceEvent.size()).isEqualTo(1);
assertThat(nodeSourceEvent.get(0).getSourceName()).isEqualTo(NODE_SOURCE_NAME);
assertThat(nodeSourceEvent.get(0).getNodeSourceDescription().contains(NODE_SOURCE_USER_ACCESS_TYPE));
}
use of functionaltests.utils.RMTHelper in project scheduling by ow2-proactive.
the class RecoverLocalInfrastructureTest method restartRmAndCheckFinalState.
private void restartRmAndCheckFinalState() throws Exception {
// restart RM
this.rmHelper = new RMTHelper();
this.startRmWithConfig(RESTART_CONFIG);
assertThat(PAResourceManagerProperties.RM_PRESERVE_NODES_ON_SHUTDOWN.getValueAsBoolean()).isFalse();
assertThat(this.rmHelper.isRMStarted()).isTrue();
// re-snapshot the RM state
RMMonitorEventReceiver resourceManagerMonitor = (RMMonitorEventReceiver) this.resourceManager;
List<RMNodeSourceEvent> nodeSourceEvent = resourceManagerMonitor.getInitialState().getNodeSourceEvents();
// the node source has been recovered on restart: we should have one node source with the same name
assertThat(nodeSourceEvent.size()).isEqualTo(1);
assertThat(nodeSourceEvent.get(0).getSourceName()).isEqualTo(NODE_SOURCE_NAME);
assertThat(nodeSourceEvent.get(0).getNodeSourceDescription().contains(NODE_SOURCE_USER_ACCESS_TYPE));
}
Aggregations