use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testMdlEndsWithJava.
@Test
public void testMdlEndsWithJava() throws IOException {
List<String> options = new LinkedList<String>();
options.add("-src");
options.add(dir);
options.addAll(defaultOptions);
CeyloncTaskImpl task = getCompilerTask(options, null, Arrays.asList("org.eclipse.ceylon.compiler.java.test.cmr.modules.java"));
Boolean ret = task.call();
assertTrue(ret);
}
use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testNamespaceImports.
@Test
public void testNamespaceImports() throws IOException {
// Try to compile the ceylon module
CeyloncTaskImpl ceylonTask = getCompilerTask(Arrays.asList("-out", destDir, "-rep", "aether", "-verbose:cmr"), (DiagnosticListener<? super FileObject>) null, "modules/aetherdefault/module.ceylon", "modules/namespaces/foo.ceylon");
assertEquals(Boolean.TRUE, ceylonTask.call());
}
use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testMdlDependenciesNoOverride.
@Test
public void testMdlDependenciesNoOverride() throws IOException {
CeyloncTaskImpl ceylonTask = getCompilerTask(Arrays.asList("-out", destDir), "modules/overrides/module.ceylon", "modules/overrides/test.ceylon");
assertEquals("Compilation failed", Boolean.TRUE, ceylonTask.call());
}
use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testMdlDependenciesFromMavenWithOverrides.
@Test
public void testMdlDependenciesFromMavenWithOverrides() throws Throwable {
Assume.assumeTrue("Runs on JDK8", JDKUtils.jdk == JDKUtils.JDK.JDK8);
CeyloncTaskImpl ceylonTask = getCompilerTask(Arrays.asList("-out", destDir), "modules/sparkframework/module.ceylon", "modules/sparkframework/test.ceylon");
assertEquals("Compilation failed", Boolean.TRUE, ceylonTask.call());
runInJBossModules("run", "org.eclipse.ceylon.compiler.java.test.cmr.modules.sparkframework/1", Arrays.asList("--overrides", getPackagePath() + "/modules/sparkframework/overrides-fix.xml"));
}
use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class RecoveryTests method testMissingImport.
@Test
public void testMissingImport() throws IOException {
String subPath = "modules/missingImport";
String srcPath = getPackagePath() + subPath;
List<String> options = new LinkedList<String>();
options.add("-src");
options.add(srcPath);
options.addAll(defaultOptions);
options.add("-continue");
ErrorCollector c = new ErrorCollector();
CeyloncTaskImpl task = getCompilerTask(options, c, Arrays.asList("okmodule"), subPath + "/someok.ceylon");
Boolean ret = task.call();
assertFalse(ret);
TreeSet<CompilerError> actualErrors = c.get(Diagnostic.Kind.ERROR);
compareErrors(actualErrors, new CompilerError(21, "cannot find module artifact 'notfound-1(.car|.jar)'\n \t- dependency tree: 'okmodule/1.0.0' -> 'notfound/1'"));
File carFile = getModuleArchive("default", null);
assertTrue(carFile.exists());
JarFile car = new JarFile(carFile);
ZipEntry moduleClass = car.getEntry("foobar_.class");
assertNotNull(moduleClass);
car.close();
carFile = getModuleArchive("okmodule", "1.0.0");
assertFalse(carFile.exists());
}
Aggregations