use of org.iobserve.adaptation.executionplan.DeallocateNodeAction in project iobserve-analysis by research-iobserve.
the class AtomicActionComputationTest method testDeallocateAction2AtomicActions.
/**
* deallocate action conversion to atomic actions.
*
* @throws Exception
* on internal errors
*/
@Test
public void testDeallocateAction2AtomicActions() throws Exception {
final SystemAdaptation systemAdaptationModel = SystemadaptationFactory.eINSTANCE.createSystemAdaptation();
final ExecutionPlan executionPlan;
final DeploymentNode runtimeNode;
final DeallocateAction deallocateAction;
// Deallocation specific setup ((simulated by an allocation in the runtime model)
this.runtimeModel.allocateResourceContainerR3();
this.initializeModelGraphs();
runtimeNode = this.findDeploymentNodeByID(this.runtimeModel.getRc3().getId(), this.runtimeModelGraph.getServers());
deallocateAction = ResourceContainerActionFactory.createDeallocateAction(runtimeNode);
systemAdaptationModel.getActions().add(deallocateAction);
// Execute stage
executionPlan = this.executeStage(systemAdaptationModel);
// Basic verification
Assert.assertThat(executionPlan.getActions().size(), Matchers.is(2));
Assert.assertTrue(executionPlan.getActions().get(0) instanceof DisconnectNodeAction);
Assert.assertTrue(executionPlan.getActions().get(1) instanceof DeallocateNodeAction);
}
Aggregations