use of org.eclipse.ceylon.compiler.java.test.ErrorCollector in project ceylon by eclipse.
the class CMRTests method testOverridesCeylonModuleVersionAlterdPackageSharing.
@Test
public void testOverridesCeylonModuleVersionAlterdPackageSharing() {
setupBinaryModulesForOverridesCeylonModuleTests();
ErrorCollector collector = new ErrorCollector();
CeyloncTaskImpl compilerTask = getCompilerTask(Arrays.asList("-src", getPackagePath() + "/modules", "-overrides", getPackagePath() + "modules/overridesCeylonModule/overrides-b-version.xml"), collector, "modules/overridesCeylonModule/module.ceylon", "modules/overridesCeylonModule/testImportHiddenPackage.ceylon");
ModulesRetriever modulesRetriever = new ModulesRetriever(compilerTask.getContext());
compilerTask.setTaskListener(modulesRetriever);
Boolean result = compilerTask.call();
Assert.assertEquals(Boolean.FALSE, result);
compareErrors(collector.get(Diagnostic.Kind.ERROR), new CompilerError(2, "imported package is not visible: package 'b.hidden' is not shared by module 'b'"));
}
use of org.eclipse.ceylon.compiler.java.test.ErrorCollector in project ceylon by eclipse.
the class CMRTests method testMdlNoPomManifest.
@Test
public void testMdlNoPomManifest() throws IOException {
ErrorCollector c = new ErrorCollector();
assertCompilesOk(c, getCompilerTask(Arrays.asList("-nopom", "-out", destDir), c, "modules/pom/a/module.ceylon", "modules/pom/b/module.ceylon").call2());
final String moduleName = "org.eclipse.ceylon.compiler.java.test.cmr.modules.pom.b";
final String moduleVersion = "1";
File carFile = getModuleArchive(moduleName, moduleVersion);
assertTrue(carFile.exists());
JarFile car = new JarFile(carFile);
ZipEntry pomFile = car.getEntry("META-INF/maven/org.eclipse.ceylon.compiler.java.test.cmr.modules.pom/b/pom.xml");
assertNull(pomFile);
ZipEntry propertiesFile = car.getEntry("META-INF/maven/org.eclipse.ceylon.compiler.java.test.cmr.modules.pom/b/pom.properties");
assertNull(propertiesFile);
car.close();
}
use of org.eclipse.ceylon.compiler.java.test.ErrorCollector in project ceylon by eclipse.
the class IssuesTests_1000_1499 method testBug1347.
@Test
public void testBug1347() {
Assume.assumeTrue("Runs on JDK8", JDKUtils.jdk == JDKUtils.JDK.JDK8);
assertErrors("bug13xx/bug1347/bug1347", Arrays.asList("-out", destDir, "-rep", "test/java8/modules"), null, new CompilerError(12, "call to a static interface member is not allowed unless you set the -target flag to 8: --javac=-target=8"), new CompilerError(14, "call to a static interface member is not allowed unless you set the -target flag to 8: --javac=-target=8"), new CompilerError(16, "call to a static interface member is not allowed unless you set the -target flag to 8: --javac=-target=8"), new CompilerError(28, "call to a static interface member is not allowed unless you set the -target flag to 8: --javac=-target=8"), new CompilerError(30, "call to a static interface member is not allowed unless you set the -target flag to 8: --javac=-target=8"));
ErrorCollector c = new ErrorCollector();
assertCompilesOk(c, getCompilerTask(Arrays.asList("-target", "8", "-out", destDir, "-rep", "test/java8/modules"), c, "bug13xx/bug1347/bug1347.ceylon").call2());
run("org.eclipse.ceylon.compiler.java.test.issues.bug13xx.bug1347.test", new ModuleWithArtifact("org.eclipse.ceylon.compiler.java.test.issues.bug13xx.bug1347", "1"), new ModuleWithArtifact("com.ceylon.java8", "1", "test/java8/modules", "jar"));
}
use of org.eclipse.ceylon.compiler.java.test.ErrorCollector in project ceylon by eclipse.
the class IssuesTests_1500_1999 method testBug1631.
@Ignore("Used for benchmarking")
@Test
public void testBug1631() throws Exception {
// System.err.println("Press enter to continue");
// System.in.read();
// System.err.println("Let's go");
long totals = 0;
int runs = 1;
for (int i = 0; i < runs; i++) {
long start = System.nanoTime();
ErrorCollector c = new ErrorCollector();
assertCompilesOk(c, getCompilerTask(Arrays.asList(/*"-verbose:benchmark", */
"-out", destDir), c, "bug16xx/bug1631/run.ceylon").call2());
// benchmarkParse("bug16xx/bug1631/run.ceylon");
long end = System.nanoTime();
long total = end - start;
System.err.println("Took " + (total / 1_000_000) + "ms");
totals += total;
}
System.err.println("Average " + ((totals / 1_000_000) / runs) + "ms");
// System.err.println("Press enter to quit");
// System.in.read();
// System.err.println("Done");
}
use of org.eclipse.ceylon.compiler.java.test.ErrorCollector in project ceylon by eclipse.
the class IssuesTests_1500_1999 method testBug1830.
@Test
public void testBug1830() {
ErrorCollector collector = new ErrorCollector();
CeyloncTaskImpl task = getCompilerTask(defaultOptions, collector, "bug18xx/Bug1830.ceylon");
ExitState call2 = task.call2();
Assert.assertEquals(CeylonState.ERROR, call2.ceylonState);
Assert.assertEquals(Main.EXIT_ERROR, call2.javacExitCode.exitCode);
}
Aggregations