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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations