Search in sources :

Example 1 with Allocation

use of org.palladiosimulator.pcm.allocation.Allocation in project Palladio-Editors-Sirius by PalladioSimulator.

the class AllocationCreationWizard method init.

@Override
protected void init(IStructuredSelection selection) {
    String viewpointName = Activator.VIEWPOINT_NAME;
    viewpoint = Activator.getDefault().getViewpoint();
    String ext = Activator.getDefault().getViewpoint().getModelFileExtension();
    modelCreationPage = new ModelCreationPage(selection, viewpointName + " Creation Wizard", "new" + viewpointName, ext);
    representationDescription = Activator.getDefault().getRepresentationDescription();
    String defaultRepresentationName = "new " + Activator.REPRESENTATION_NAME;
    this.representationCreationPage.setDefaultRepresentationName(defaultRepresentationName);
    resourceEnvironmentSelectorpage = new ResourceEnvironmentSelectorPage();
    systemSelectorPage = new SystemSelectorPage();
    additionalPages.add(resourceEnvironmentSelectorpage);
    additionalPages.add(systemSelectorPage);
    Allocation obj = AllocationFactory.eINSTANCE.createAllocation();
    obj.setEntityName("New Allocation");
    modelObject = obj;
}
Also used : ModelCreationPage(org.palladiosimulator.editors.sirius.ui.wizard.model.ModelCreationPage) Allocation(org.palladiosimulator.pcm.allocation.Allocation)

Example 2 with Allocation

use of org.palladiosimulator.pcm.allocation.Allocation in project iobserve-analysis by research-iobserve.

the class AllocationModelProviderTest method createThenReadByName.

@Override
@Test
public void createThenReadByName() {
    final ModelProvider<Allocation> modelProvider = new ModelProvider<>(AllocationModelProviderTest.graph);
    final Allocation writtenModel = new TestModelBuilder().getAllocation();
    final List<Allocation> readModels;
    modelProvider.createComponent(writtenModel);
    readModels = modelProvider.readOnlyComponentByName(Allocation.class, writtenModel.getEntityName());
    for (final Allocation readModel : readModels) {
        Assert.assertTrue(this.equalityHelper.equals(writtenModel, readModel));
    }
}
Also used : Allocation(org.palladiosimulator.pcm.allocation.Allocation) Test(org.junit.Test)

Example 3 with Allocation

use of org.palladiosimulator.pcm.allocation.Allocation in project iobserve-analysis by research-iobserve.

the class AllocationModelProviderTest method createThenReadRoot.

@Override
@Test
public void createThenReadRoot() {
    final ModelProvider<Allocation> modelProvider = new ModelProvider<>(AllocationModelProviderTest.graph);
    final Allocation writtenModel = new TestModelBuilder().getAllocation();
    final Allocation readModel;
    modelProvider.createComponent(writtenModel);
    readModel = modelProvider.readOnlyRootComponent(Allocation.class);
    Assert.assertTrue(this.equalityHelper.equals(writtenModel, readModel));
}
Also used : Allocation(org.palladiosimulator.pcm.allocation.Allocation) Test(org.junit.Test)

Example 4 with Allocation

use of org.palladiosimulator.pcm.allocation.Allocation in project iobserve-analysis by research-iobserve.

the class AllocationModelProviderTest method createThenReadById.

@Override
@Test
public void createThenReadById() {
    final ModelProvider<Allocation> modelProvider = new ModelProvider<>(AllocationModelProviderTest.graph);
    final Allocation writtenModel = new TestModelBuilder().getAllocation();
    final Allocation readModel;
    modelProvider.createComponent(writtenModel);
    readModel = modelProvider.readOnlyComponentById(Allocation.class, writtenModel.getId());
    Assert.assertTrue(this.equalityHelper.equals(writtenModel, readModel));
}
Also used : Allocation(org.palladiosimulator.pcm.allocation.Allocation) Test(org.junit.Test)

Example 5 with Allocation

use of org.palladiosimulator.pcm.allocation.Allocation in project iobserve-analysis by research-iobserve.

the class AllocationModelProviderTest method createThenCloneThenRead.

@Override
@Test
public void createThenCloneThenRead() {
    final ModelProvider<Allocation> modelProvider1 = new ModelProvider<>(AllocationModelProviderTest.graph);
    final ModelProvider<Allocation> modelProvider2;
    final Allocation writtenModel = new TestModelBuilder().getAllocation();
    final Allocation readModel;
    final Graph graph2;
    modelProvider1.createComponent(writtenModel);
    graph2 = modelProvider1.cloneNewGraphVersion(Allocation.class);
    modelProvider2 = new ModelProvider<>(graph2);
    readModel = modelProvider2.readOnlyRootComponent(Allocation.class);
    graph2.getGraphDatabaseService().shutdown();
    Assert.assertTrue(this.equalityHelper.equals(writtenModel, readModel));
}
Also used : Allocation(org.palladiosimulator.pcm.allocation.Allocation) Test(org.junit.Test)

Aggregations

Allocation (org.palladiosimulator.pcm.allocation.Allocation)26 Test (org.junit.Test)11 ResourceEnvironment (org.palladiosimulator.pcm.resourceenvironment.ResourceEnvironment)7 AssemblyContext (org.palladiosimulator.pcm.core.composition.AssemblyContext)6 ResourceContainer (org.palladiosimulator.pcm.resourceenvironment.ResourceContainer)6 PCMModelHandler (org.iobserve.model.PCMModelHandler)4 SystemadaptationFactory (org.iobserve.planning.systemadaptation.SystemadaptationFactory)4 AllocationContext (org.palladiosimulator.pcm.allocation.AllocationContext)4 System (org.palladiosimulator.pcm.system.System)4 File (java.io.File)2 IOException (java.io.IOException)2 URI (org.eclipse.emf.common.util.URI)2 Graph (org.iobserve.model.provider.neo4j.Graph)2 GraphLoader (org.iobserve.model.provider.neo4j.GraphLoader)2 IModelProvider (org.iobserve.model.provider.neo4j.IModelProvider)2 ModelProvider (org.iobserve.model.provider.neo4j.ModelProvider)2 AssemblyConnector (org.palladiosimulator.pcm.core.composition.AssemblyConnector)2 Connector (org.palladiosimulator.pcm.core.composition.Connector)2 Repository (org.palladiosimulator.pcm.repository.Repository)2 LinkingResource (org.palladiosimulator.pcm.resourceenvironment.LinkingResource)2