Search in sources :

Example 26 with EffectiveModel

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

the class TemplateConverterTest method lampNoInputConverter.

@Test
public void lampNoInputConverter() {
    EffectiveModel model = new EffectiveModelFactory().create(TestCsars.VALID_LAMP_NO_INPUT_TEMPLATE, logMock());
    assertNotNull(model);
}
Also used : EffectiveModel(org.opentosca.toscana.model.EffectiveModel) EffectiveModelFactory(org.opentosca.toscana.model.EffectiveModelFactory) BaseUnitTest(org.opentosca.toscana.core.BaseUnitTest) Test(org.junit.Test)

Example 27 with EffectiveModel

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

the class TemplateConverterTest method lampInputConverter.

@Test
public void lampInputConverter() {
    EffectiveModel model = new EffectiveModelFactory().create(TestCsars.VALID_LAMP_INPUT_TEMPLATE, logMock());
    assertNotNull(model);
}
Also used : EffectiveModel(org.opentosca.toscana.model.EffectiveModel) EffectiveModelFactory(org.opentosca.toscana.model.EffectiveModelFactory) BaseUnitTest(org.opentosca.toscana.core.BaseUnitTest) Test(org.junit.Test)

Example 28 with EffectiveModel

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

the class TemplateConverterTest method taskTranslatorConverter.

@Test
public void taskTranslatorConverter() {
    EffectiveModel model = new EffectiveModelFactory().create(TestCsars.VALID_TASKTRANSLATOR_TEMPLATE, logMock());
    assertNotNull(model);
}
Also used : EffectiveModel(org.opentosca.toscana.model.EffectiveModel) EffectiveModelFactory(org.opentosca.toscana.model.EffectiveModelFactory) BaseUnitTest(org.opentosca.toscana.core.BaseUnitTest) Test(org.junit.Test)

Example 29 with EffectiveModel

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

the class TransformationDaoUnitTest method setUp.

@Before
public void setUp() throws IOException, InvalidCsarException {
    when(platformService.findPlatformById(PLATFORM1.id)).thenReturn(Optional.ofNullable(PLATFORM1));
    when(preferences.getDataDir()).thenReturn(tmpdir);
    Log log = logMock();
    csar = spy(new CsarImpl(new File(""), "csarIdentifier", log));
    doReturn(new File("")).when(csar).getTemplate();
    File csarTransformationDir = new File(tmpdir, "transformationDir");
    csarTransformationDir.mkdir();
    when(csarDao.getTransformationsDir(csar)).thenReturn(csarTransformationDir);
    platformDir = new File(csarTransformationDir, PLATFORM1.id);
    platformDir.mkdir();
    File someTransformationFile = new File(platformDir, "some-file");
    someTransformationFile.createNewFile();
    EffectiveModelFactory modelFactory = mock(EffectiveModelFactory.class);
    EffectiveModel model = modelMock();
    when(modelFactory.create(any(File.class), any(Log.class))).thenReturn(model);
    dao = new TransformationFilesystemDao(platformService, modelFactory);
    dao.setCsarDao(csarDao);
}
Also used : Log(org.opentosca.toscana.core.transformation.logging.Log) CsarImpl(org.opentosca.toscana.core.csar.CsarImpl) File(java.io.File) EffectiveModelFactory(org.opentosca.toscana.model.EffectiveModelFactory) EffectiveModel(org.opentosca.toscana.model.EffectiveModel) Before(org.junit.Before)

Example 30 with EffectiveModel

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

the class TransformationFilesystemDaoTest method setUp.

@Before
public void setUp() throws InvalidCsarException {
    csar = spy(new CsarImpl(new File(""), "csar1", logMock()));
    doReturn(new File("")).when(csar).getTemplate();
    EffectiveModelFactory modelFactory = mock(EffectiveModelFactory.class);
    EffectiveModel model = modelMock();
    when(modelFactory.create(any(File.class), any(Log.class))).thenReturn(model);
    transformationDao = new TransformationFilesystemDao(platformService, modelFactory);
    transformationDao.setCsarDao(csarDao);
    transformation = new TransformationImpl(csar, PLATFORM1, logMock(), modelMock());
    transformationRootDir = transformationDao.getRootDir(transformation);
}
Also used : Log(org.opentosca.toscana.core.transformation.logging.Log) CsarImpl(org.opentosca.toscana.core.csar.CsarImpl) File(java.io.File) EffectiveModelFactory(org.opentosca.toscana.model.EffectiveModelFactory) EffectiveModel(org.opentosca.toscana.model.EffectiveModel) Before(org.junit.Before)

Aggregations

EffectiveModel (org.opentosca.toscana.model.EffectiveModel)33 EffectiveModelFactory (org.opentosca.toscana.model.EffectiveModelFactory)31 Test (org.junit.Test)22 BaseUnitTest (org.opentosca.toscana.core.BaseUnitTest)22 File (java.io.File)9 Before (org.junit.Before)9 PluginFileAccess (org.opentosca.toscana.core.plugin.PluginFileAccess)5 Database (org.opentosca.toscana.model.node.Database)5 Application (org.opentosca.toscana.plugins.cloudfoundry.application.Application)5 Log (org.opentosca.toscana.core.transformation.logging.Log)4 WebApplication (org.opentosca.toscana.model.node.WebApplication)4 Artifact (org.opentosca.toscana.model.artifact.Artifact)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 PropertyInstance (org.opentosca.toscana.core.transformation.properties.PropertyInstance)2 EndpointCapability (org.opentosca.toscana.model.capability.EndpointCapability)2 Compute (org.opentosca.toscana.model.node.Compute)2 RootNode (org.opentosca.toscana.model.node.RootNode)2