use of org.contextmapper.dsl.generator.ContextMapGenerator in project context-mapper-dsl by ContextMapper.
the class StandaloneAPITest method canCallGenerator.
@Test
public void canCallGenerator() {
// given
StandaloneContextMapperAPI contextMapper = ContextMapperStandaloneSetup.getStandaloneAPI();
CMLResource cml = contextMapper.loadCML("./integ-test-files/standalone/simple-context-map.cml");
File expectedOutput = new File("./src-gen/simple-context-map_ContextMap.png");
ensureFileDoesNotExist(expectedOutput);
// when
ContextMapGenerator generator = new ContextMapGenerator();
generator.setContextMapFormats(ContextMapFormat.PNG);
contextMapper.callGenerator(cml, generator);
// then
assertTrue(expectedOutput.exists());
}
use of org.contextmapper.dsl.generator.ContextMapGenerator in project context-mapper-dsl by ContextMapper.
the class StandaloneAPITest method canGenerateIntoCustomDirectory.
@Test
public void canGenerateIntoCustomDirectory() {
// given
StandaloneContextMapperAPI contextMapper = ContextMapperStandaloneSetup.getStandaloneAPI();
CMLResource cml = contextMapper.loadCML("./integ-test-files/standalone/simple-context-map.cml");
File expectedOutput = new File("./out/simple-context-map_ContextMap.png");
ensureFileDoesNotExist(expectedOutput);
// when
ContextMapGenerator generator = new ContextMapGenerator();
generator.setContextMapFormats(ContextMapFormat.PNG);
contextMapper.callGenerator(cml, generator, "./out");
// then
assertTrue(expectedOutput.exists());
}
Aggregations