use of org.iobserve.adaptation.executionplan.AllocateNodeAction in project iobserve-analysis by research-iobserve.
the class AtomicActionComputationTest method testAllocateAction2AtomicActions.
/**
* allocate action conversion to atomic actions.
*
* @throws Exception
* on internal errors
*/
@Test
public void testAllocateAction2AtomicActions() throws Exception {
final SystemAdaptation systemAdaptationModel = SystemadaptationFactory.eINSTANCE.createSystemAdaptation();
final ExecutionPlan executionPlan;
final DeploymentNode redeploymentNode;
final AllocateAction allocateAction;
// Allocation specific setup
this.redeploymentModel.allocateResourceContainerR3();
this.initializeModelGraphs();
redeploymentNode = this.findDeploymentNodeByID(this.redeploymentModel.getRc3().getId(), this.redeploymentModelGraph.getServers());
allocateAction = ResourceContainerActionFactory.createAllocateAction(redeploymentNode);
systemAdaptationModel.getActions().add(allocateAction);
// Execute stage
executionPlan = this.executeStage(systemAdaptationModel);
// Basic verification
Assert.assertThat(executionPlan.getActions().size(), Matchers.is(2));
Assert.assertTrue(executionPlan.getActions().get(0) instanceof AllocateNodeAction);
Assert.assertTrue(executionPlan.getActions().get(1) instanceof ConnectNodeAction);
}
Aggregations