Search in sources :

Example 36 with EffectiveModelFactory

use of org.opentosca.toscana.model.EffectiveModelFactory in project TOSCAna by StuPro-TOSCAna.

the class FileCreatorTest method setUp.

@Before
public void setUp() throws IOException {
    EffectiveModel lamp = new EffectiveModelFactory().create(TestCsars.VALID_LAMP_NO_INPUT_TEMPLATE, logMock());
    this.context = setUpMockTransformationContext(lamp);
    appName = "testApp";
    testApp = new Application("testApp", 1, context);
    testApp.setName(appName);
    File sourceDir = new File(tmpdir, "sourceDir");
    targetDir = new File(tmpdir, "targetDir");
    sourceDir.mkdir();
    targetDir.mkdir();
    fileAccess = new PluginFileAccess(sourceDir, targetDir, logMock());
    List<Application> applications = new ArrayList<>();
    applications.add(testApp);
    fileCreator = new FileCreator(fileAccess, applications, context);
}
Also used : PluginFileAccess(org.opentosca.toscana.core.plugin.PluginFileAccess) FileCreator(org.opentosca.toscana.plugins.cloudfoundry.filecreator.FileCreator) ArrayList(java.util.ArrayList) Application(org.opentosca.toscana.plugins.cloudfoundry.application.Application) WebApplication(org.opentosca.toscana.model.node.WebApplication) File(java.io.File) EffectiveModel(org.opentosca.toscana.model.EffectiveModel) EffectiveModelFactory(org.opentosca.toscana.model.EffectiveModelFactory) Before(org.junit.Before)

Example 37 with EffectiveModelFactory

use of org.opentosca.toscana.model.EffectiveModelFactory in project TOSCAna by StuPro-TOSCAna.

the class CsarServiceImplIT method setUp.

@Before
public void setUp() throws InvalidCsarException {
    EffectiveModelFactory modelFactory = mock(EffectiveModelFactory.class);
    EffectiveModel model = modelMock();
    when(modelFactory.create(any(Csar.class))).thenReturn(model);
    csarService = new CsarServiceImpl(csarDao);
    Log log = new LogImpl(new File(tmpdir, "log"));
    csar = new CsarImpl(new File(""), identifier, log);
}
Also used : Log(org.opentosca.toscana.core.transformation.logging.Log) LogImpl(org.opentosca.toscana.core.transformation.logging.LogImpl) File(java.io.File) EffectiveModelFactory(org.opentosca.toscana.model.EffectiveModelFactory) EffectiveModel(org.opentosca.toscana.model.EffectiveModel) Before(org.junit.Before)

Aggregations

EffectiveModelFactory (org.opentosca.toscana.model.EffectiveModelFactory)37 EffectiveModel (org.opentosca.toscana.model.EffectiveModel)31 Test (org.junit.Test)25 BaseUnitTest (org.opentosca.toscana.core.BaseUnitTest)22 File (java.io.File)10 Before (org.junit.Before)10 PluginFileAccess (org.opentosca.toscana.core.plugin.PluginFileAccess)6 Database (org.opentosca.toscana.model.node.Database)5 Application (org.opentosca.toscana.plugins.cloudfoundry.application.Application)5 WebApplication (org.opentosca.toscana.model.node.WebApplication)4 BaseSpringTest (org.opentosca.toscana.core.BaseSpringTest)3 Csar (org.opentosca.toscana.core.csar.Csar)3 Log (org.opentosca.toscana.core.transformation.logging.Log)3 Artifact (org.opentosca.toscana.model.artifact.Artifact)3 RootNode (org.opentosca.toscana.model.node.RootNode)3 WebServer (org.opentosca.toscana.model.node.WebServer)3 FileCreator (org.opentosca.toscana.plugins.cloudfoundry.filecreator.FileCreator)3 ArrayList (java.util.ArrayList)2 CsarImpl (org.opentosca.toscana.core.csar.CsarImpl)2 TransformationContext (org.opentosca.toscana.core.transformation.TransformationContext)2