use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testMdlDependenciesOverrideRemoveDep.
@Test
public void testMdlDependenciesOverrideRemoveDep() throws IOException {
CeyloncTaskImpl ceylonTask = getCompilerTask(Arrays.asList("-out", destDir, "-overrides", getPackagePath() + "/modules/overrides/overridesRemoveJavaBase.xml"), "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 testMdlAetherDependencyDefault.
@Test
public void testMdlAetherDependencyDefault() 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/aetherdefault/foo.ceylon");
assertEquals(Boolean.TRUE, ceylonTask.call());
// We're assuming a standard Maven configuration here!
File camelJar = new File(System.getProperty("user.home"), ".m2/repository/org/apache/camel/camel-core/2.9.2/camel-core-2.9.2.jar");
assertTrue(camelJar.exists());
}
use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testMdlJarDependency.
@Test
public void testMdlJarDependency() throws IOException {
// compile our java class
File classesOutputFolder = new File(destDir + "-jar-classes");
cleanCars(classesOutputFolder.getPath());
classesOutputFolder.mkdirs();
File jarOutputFolder = new File(destDir + "-jar");
cleanCars(jarOutputFolder.getPath());
jarOutputFolder.mkdirs();
compileJavaModule(jarOutputFolder, classesOutputFolder, moduleName + ".modules.jarDependency.java", "1.0", moduleName.replace('.', '/') + "/modules/jarDependency/java/JavaDependency.java");
// Try to compile the ceylon module
CeyloncTaskImpl ceylonTask = getCompilerTask(Arrays.asList("-out", destDir, "-rep", jarOutputFolder.getPath()), (DiagnosticListener<? super FileObject>) null, "modules/jarDependency/ceylon/module.ceylon", "modules/jarDependency/ceylon/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 testMdlImplicitAetherDependencyDefault.
@Test
public void testMdlImplicitAetherDependencyDefault() throws IOException {
// Try to compile the ceylon module
CeyloncTaskImpl ceylonTask = getCompilerTask(Arrays.asList("-out", destDir, "-verbose:cmr"), (DiagnosticListener<? super FileObject>) null, "modules/aetherdefault/module.ceylon", "modules/aetherdefault/foo.ceylon");
assertEquals(Boolean.TRUE, ceylonTask.call());
// We're assuming a standard Maven configuration here!
File camelJar = new File(System.getProperty("user.home"), ".m2/repository/org/apache/camel/camel-core/2.9.2/camel-core-2.9.2.jar");
assertTrue(camelJar.exists());
}
use of org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl in project ceylon by eclipse.
the class CMRTests method testMdlAetherMissingDependencies.
@Test
public void testMdlAetherMissingDependencies() throws IOException {
CompilerError[] expectedErrors = new CompilerError[] { new CompilerError(6, "Error while loading the org.apache.camel:camel-jetty/2.9.4 module:\n" + " Declaration 'org.apache.camel.component.http.HttpComponent' could not be found in module 'org.apache.camel:camel-jetty' or its imported modules"), new CompilerError(10, "argument must be assignable to parameter 'arg1' of 'addComponent' in 'DefaultCamelContext': 'JettyHttpComponent' is not assignable to 'Component?': Error while loading the org.apache.camel:camel-jetty/2.9.4 module:\n" + " Declaration 'org.apache.camel.component.http.HttpComponent' could not be found in module 'org.apache.camel:camel-jetty' or its imported modules") };
ErrorCollector collector = new ErrorCollector();
// Try to compile the ceylon module
CeyloncTaskImpl ceylonTask = getCompilerTask(Arrays.asList("-out", destDir, "-rep", "aether"), collector, "modules/bug1100/module.ceylon", "modules/bug1100/test.ceylon");
assertEquals("Compilation failed", Boolean.FALSE, ceylonTask.call());
TreeSet<CompilerError> actualErrors = collector.get(Diagnostic.Kind.ERROR);
compareErrors(actualErrors, expectedErrors);
}
Aggregations