Search in sources :

Example 1 with AllocateNodeAction

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);
}
Also used : SystemAdaptation(org.iobserve.planning.systemadaptation.SystemAdaptation) ExecutionPlan(org.iobserve.adaptation.executionplan.ExecutionPlan) AllocateNodeAction(org.iobserve.adaptation.executionplan.AllocateNodeAction) DeploymentNode(org.iobserve.adaptation.data.graph.DeploymentNode) ConnectNodeAction(org.iobserve.adaptation.executionplan.ConnectNodeAction) AllocateAction(org.iobserve.planning.systemadaptation.AllocateAction) Test(org.junit.Test)

Aggregations

DeploymentNode (org.iobserve.adaptation.data.graph.DeploymentNode)1 AllocateNodeAction (org.iobserve.adaptation.executionplan.AllocateNodeAction)1 ConnectNodeAction (org.iobserve.adaptation.executionplan.ConnectNodeAction)1 ExecutionPlan (org.iobserve.adaptation.executionplan.ExecutionPlan)1 AllocateAction (org.iobserve.planning.systemadaptation.AllocateAction)1 SystemAdaptation (org.iobserve.planning.systemadaptation.SystemAdaptation)1 Test (org.junit.Test)1