String javaFilename = "inmemory/gxp/test/Main.java";
String xmbFilename = "inmemory/gxp/test/Main.xmb";
// Generate the code
AlertSetBuilder javaBuilder = new AlertSetBuilder();
testCodeGenPath(gxpSource, filterAlertSink(javaBuilder),
OutputLanguage.JAVA);
try {
getCodeFor(javaFilename);
fail("Exception expected");
} catch (IOException expected) {
// expected
}
AlertSet javaAlertSet = javaBuilder.buildAndClear();
AlertSetBuilder xmbBuilder = new AlertSetBuilder();
testCodeGenPath(gxpSource, filterAlertSink(xmbBuilder), OutputLanguage.XMB);
try {
getCodeFor(xmbFilename);
fail("Exception expected");
} catch (IOException expected) {
// expected
}
AlertSet xmbAlertSet = xmbBuilder.buildAndClear();
assertEquals(javaAlertSet, xmbAlertSet);
AlertSetBuilder dualLanguageBuilder = new AlertSetBuilder();
testCodeGenPath(gxpSource, filterAlertSink(dualLanguageBuilder),
OutputLanguage.JAVA, OutputLanguage.XMB);
try {
getCodeFor(javaFilename);
fail("Exception expected");
} catch (IOException expected) {
// expected
}
try {
getCodeFor(xmbFilename);
fail("Exception expected");
} catch (IOException expected) {
// expected
}
assertEquals(dualLanguageBuilder.buildAndClear(), javaAlertSet);
}