use of org.eclipse.ceylon.compiler.java.test.CompilerError in project ceylon by eclipse.
the class InteropTests method testIopRefinesDefaultAccessMethodInAnotherPkg.
@Test
public void testIopRefinesDefaultAccessMethodInAnotherPkg() {
compile("access/JavaAccessModifiers.java");
assertErrors("RefinesDefaultAccessMethodInAnotherPkg", new CompilerError(27, "refined declaration is not visible: 'defaultAccessMethod' in 'RefinesDefaultAccessMethodInAnotherPkg' refines 'defaultAccessMethod' in 'JavaAccessModifiers' which is package private"));
}
use of org.eclipse.ceylon.compiler.java.test.CompilerError in project ceylon by eclipse.
the class InteropTests method testIopCallsDefaultAccessMethodInAnotherPkg.
@Test
public void testIopCallsDefaultAccessMethodInAnotherPkg() {
compile("access/JavaAccessModifiers.java");
assertErrors("CallsDefaultAccessMethodInAnotherPkg", new CompilerError(25, "method or attribute is not visible: 'protectedAccessMethod' of type 'JavaAccessModifiers' is protected"), new CompilerError(27, "method or attribute is not visible: 'defaultAccessMethod' of type 'JavaAccessModifiers' is package private"), new CompilerError(36, "function or value is not visible: 'defaultAccessMethod' is package private"));
}
use of org.eclipse.ceylon.compiler.java.test.CompilerError in project ceylon by eclipse.
the class InteropTests method testIopRefinesDefaultAccessMethodWithActual.
@Test
public void testIopRefinesDefaultAccessMethodWithActual() {
compile("access/JavaAccessModifiers.java");
assertErrors("access/RefinesDefaultAccessMethodWithActual", new CompilerError(22, "actual declaration must be shared: 'defaultAccessMethod'"));
}
use of org.eclipse.ceylon.compiler.java.test.CompilerError in project ceylon by eclipse.
the class CMRTests method testMdlCarWithInvalidSHA1.
@Ignore("See https://github.com/ceylon/ceylon/issues/6027")
@Test
public void testMdlCarWithInvalidSHA1() throws IOException {
compile("modules/single/module.ceylon");
File carFile = getModuleArchive("org.eclipse.ceylon.compiler.java.test.cmr.modules.single", "6.6.6");
assertTrue(carFile.exists());
JarFile car = new JarFile(carFile);
// just to be sure
ZipEntry moduleClass = car.getEntry("org/eclipse/ceylon/compiler/java/test/cmr/modules/single/$module_.class");
assertNotNull(moduleClass);
car.close();
// now let's break the SHA1
File shaFile = getArchiveName("org.eclipse.ceylon.compiler.java.test.cmr.modules.single", "6.6.6", destDir, "car.sha1");
Writer w = new FileWriter(shaFile);
w.write("fubar");
w.flush();
w.close();
// now try to compile the subpackage with a broken SHA1
String carName = "/org/eclipse/ceylon/compiler/java/test/cmr/modules/single/6.6.6/org.eclipse.ceylon.compiler.java.test.cmr.modules.single-6.6.6.car";
carName = carName.replace('/', File.separatorChar);
assertErrors("modules/single/subpackage/Subpackage", new CompilerError(-1, "Module car " + carName + " obtained from repository " + (new File(destDir).getAbsolutePath()) + " has an invalid SHA1 signature: you need to remove it and rebuild the archive, since it may be corrupted."));
}
use of org.eclipse.ceylon.compiler.java.test.CompilerError in project ceylon by eclipse.
the class CMRTests method testMdlBug1062IncompatibleMissingImport.
@Test
public void testMdlBug1062IncompatibleMissingImport() 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, "bug1062.javaA", "1", new File(getPackagePath(), "modules/bug1062/javaA1-src"), new File[0], "bug1062/javaA/JavaA.java");
compileJavaModule(jarOutputFolder, classesOutputFolder, "bug1062.javaA", "2", new File(getPackagePath(), "modules/bug1062/javaA2-src"), new File[0], "bug1062/javaA/JavaA.java");
compileJavaModule(jarOutputFolder, classesOutputFolder, "bug1062.javaB", "1", new File(getPackagePath(), "modules/bug1062/javaB-nomodule-src"), new File[] { new File(jarOutputFolder, "bug1062/javaA/1/bug1062.javaA-1.jar") }, "bug1062/javaB/JavaB.java");
assertErrors("modules/bug1062/ceylon/test", Arrays.asList("-rep", jarOutputFolder.getPath()), null, new CompilerError(5, "could not determine type of method or attribute reference: 'method' of 'JavaB' is ambiguous - Error while loading the bug1062.javaB/1 module:\n" + " Declaration 'bug1062.javaA.JavaA' could not be found in module 'bug1062.javaB' or its imported modules but was found in the non-imported module 'bug1062.javaA'"), new CompilerError(5, "parameter type could not be determined: 'arg0' of 'method' in 'JavaB' - Error while loading the bug1062.javaB/1 module:\n" + " Declaration 'bug1062.javaA.JavaA' could not be found in module 'bug1062.javaB' or its imported modules but was found in the non-imported module 'bug1062.javaA'"));
}
Aggregations