use of com.redhat.ceylon.compiler.java.test.CompilerError in project ceylon-compiler by ceylon.
the class CMRTests method testMdlBug1062IncompatibleSharedImport.
@Test
public void testMdlBug1062IncompatibleSharedImport() 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-module-export-src"), new File[] { new File(jarOutputFolder, "bug1062/javaA/1/bug1062.javaA-1.jar") }, "bug1062/javaB/JavaB.java");
// ceylon module imports JavaA/2 and JavaB/1
// JavaB/1 shared imports JavaA/1
assertErrors("modules/bug1062/ceylon/test", Arrays.asList("-rep", jarOutputFolder.getPath()), null, new CompilerError(2, "module (transitively) imports conflicting versions of dependency 'bug1062.javaA': version '1' and version '2'"), new CompilerError(2, "source code imports two different versions of module 'bug1062.javaA': version '1' and version '2'"));
}
use of com.redhat.ceylon.compiler.java.test.CompilerError in project ceylon-compiler by ceylon.
the class IssuesTests_1500_1999 method testBug1773.
@Test
public void testBug1773() {
ErrorCollector collector = new ErrorCollector();
CeyloncTaskImpl task = getCompilerTask(defaultOptions, collector, "bug17xx/Bug1773.ceylon");
// now compile it all the way
ExitState exitState = task.call2();
Assert.assertEquals(ExitState.CeylonState.ERROR, exitState.ceylonState);
// make sure we only got one, do not trust actualErrors.size() for that since it's a Set so
// two methods with same contents would count as one.
Assert.assertEquals(1, exitState.errorCount);
TreeSet<CompilerError> actualErrors = collector.get(Diagnostic.Kind.ERROR);
compareErrors(actualErrors, new CompilerError(22, "dynamic is not supported on the JVM"));
}
use of com.redhat.ceylon.compiler.java.test.CompilerError in project ceylon-compiler by ceylon.
the class InteropTests method testIopExtendsDefaultAccessClassInAnotherPkg.
@Test
public void testIopExtendsDefaultAccessClassInAnotherPkg() {
compile("access/JavaAccessModifiers.java");
compile("access/JavaDefaultAccessClass3.java");
assertErrors("ExtendsDefaultAccessClassInAnotherPkg", new CompilerError(21, "imported declaration is not shared: 'JavaDefaultAccessClass'"), new CompilerError(22, "imported declaration is not shared: 'JavaDefaultAccessClass2'"), new CompilerError(27, "supertype is not visible everywhere type 'ExtendsDefaultAccessClassInAnotherPkg' is visible: 'JavaDefaultAccessClass' involves an unshared type declaration"), new CompilerError(27, "type is not visible: 'JavaDefaultAccessClass'"), new CompilerError(29, "supertype is not visible everywhere type 'ExtendsDefaultAccessClassInAnotherPkg2' is visible: 'JavaDefaultAccessClass2' involves an unshared type declaration"), new CompilerError(29, "type is not visible: 'JavaDefaultAccessClass2'"), new CompilerError(31, "package private constructor is not visible: 'JavaDefaultAccessClass3'"));
}
use of com.redhat.ceylon.compiler.java.test.CompilerError in project ceylon-compiler by ceylon.
the class InteropTests method testIopCallsDefaultAccessMethodInAnotherPkg.
@Test
public void testIopCallsDefaultAccessMethodInAnotherPkg() {
compile("access/JavaAccessModifiers.java");
assertErrors("CallsDefaultAccessMethodInAnotherPkg", new CompilerError(25, "protected method or attribute is not visible: 'protectedAccessMethod' of type 'JavaAccessModifiers'"), new CompilerError(27, "package private method or attribute is not visible: 'defaultAccessMethod' of type 'JavaAccessModifiers'"), new CompilerError(36, "package private function or value is not visible: 'defaultAccessMethod'"));
}
use of com.redhat.ceylon.compiler.java.test.CompilerError in project ceylon-compiler by ceylon.
the class InteropTests method testIopCallsDefaultAccessClassWithOverloading.
@Test
public void testIopCallsDefaultAccessClassWithOverloading() {
compile("access/JavaDefaultAccessClass4.java");
assertErrors("access/CallsDefaultAccessClassWithOverloading", new CompilerError(22, "class cannot be instantiated: 'JavaDefaultAccessClass4' does not have a default constructor"), new CompilerError(22, "ambiguous invocation of overloaded method or class: there must be exactly one overloaded declaration of 'JavaDefaultAccessClass4' that accepts the given argument types ''"));
}
Aggregations