Search in sources :

Example 1 with CompilerError

use of com.redhat.ceylon.compiler.java.test.CompilerError in project ceylon-compiler by ceylon.

the class ModelLoaderTests method bogusModelAnnotationsTopLevelMethod.

@Test
public void bogusModelAnnotationsTopLevelMethod() {
    compile("bogusTopLevelMethodNoMethod_.java", "bogusTopLevelMethodMissingType_.java", "bogusTopLevelMethodInvalidType_.java", "bogusTopLevelMethodNotStatic_.java");
    assertErrors("bogusTopLevelMethodUser", new CompilerError(2, "Error while loading the com.redhat.ceylon.compiler.java.test.model/1 module:\n" + "   Error while resolving toplevel method com.redhat.ceylon.compiler.java.test.model::bogusTopLevelMethodNoMethod: static method missing"), new CompilerError(2, "Error while loading the com.redhat.ceylon.compiler.java.test.model/1 module:\n" + "   Error while resolving toplevel method com.redhat.ceylon.compiler.java.test.model::bogusTopLevelMethodNotStatic: method is not static"), new CompilerError(2, "Error while loading the com.redhat.ceylon.compiler.java.test.model/1 module:\n" + "   Error while resolving type of toplevel method for com.redhat.ceylon.compiler.java.test.model::bogusTopLevelMethodMissingType:\n" + "   Could not find type 'com.redhat.ceylon.compiler.java.test.model.MissingType'"), new CompilerError(2, "Error while loading the com.redhat.ceylon.compiler.java.test.model/1 module:\n" + "   Error while parsing type of toplevel method for com.redhat.ceylon.compiler.java.test.model::bogusTopLevelMethodInvalidType:\n" + "   Expecting word but got AND"), new CompilerError(3, "could not determine type of function or value reference: 'bogusTopLevelMethodNoMethod': Error while loading the com.redhat.ceylon.compiler.java.test.model/1 module:\n" + "   Error while resolving toplevel method com.redhat.ceylon.compiler.java.test.model::bogusTopLevelMethodNoMethod: static method missing"), new CompilerError(4, "could not determine type of function or value reference: 'bogusTopLevelMethodNotStatic': Error while loading the com.redhat.ceylon.compiler.java.test.model/1 module:\n" + "   Error while resolving toplevel method com.redhat.ceylon.compiler.java.test.model::bogusTopLevelMethodNotStatic: method is not static"), new CompilerError(5, "could not determine type of function or value reference: 'bogusTopLevelMethodMissingType': Error while loading the com.redhat.ceylon.compiler.java.test.model/1 module:\n" + "   Error while resolving type of toplevel method for com.redhat.ceylon.compiler.java.test.model::bogusTopLevelMethodMissingType:\n" + "   Could not find type 'com.redhat.ceylon.compiler.java.test.model.MissingType'"), new CompilerError(6, "could not determine type of function or value reference: 'bogusTopLevelMethodInvalidType': Error while loading the com.redhat.ceylon.compiler.java.test.model/1 module:\n" + "   Error while parsing type of toplevel method for com.redhat.ceylon.compiler.java.test.model::bogusTopLevelMethodInvalidType:\n" + "   Expecting word but got AND"));
}
Also used : CompilerError(com.redhat.ceylon.compiler.java.test.CompilerError) Test(org.junit.Test)

Example 2 with CompilerError

use of com.redhat.ceylon.compiler.java.test.CompilerError in project ceylon-compiler by ceylon.

the class IssuesTests_1500_1999 method testBug1882_JDK8.

@Test
public void testBug1882_JDK8() {
    Assume.assumeTrue("Runs on JDK8", JDKUtils.jdk == JDKUtils.JDK.JDK8);
    assertErrors("bug18xx/bug1882/module", new CompilerError(Kind.WARNING, "module.ceylon", 3, "You import JDK7, which is provided by the JDK8 you are running on, but we cannot check that you are not using any JDK8-specific classes or methods. Upgrade your import to JDK8 if you depend on JDK8 classes or methods."));
}
Also used : CompilerError(com.redhat.ceylon.compiler.java.test.CompilerError) Test(org.junit.Test)

Example 3 with CompilerError

use of com.redhat.ceylon.compiler.java.test.CompilerError in project ceylon-compiler by ceylon.

the class IssuesTests_1000_1499 method testBug1180.

@Test
public void testBug1180() {
    compile("bug11xx/Bug1180_1.ceylon");
    assertErrors("bug11xx/Bug1180_2", new CompilerError(25, "ambiguous invocation of overloaded method or class: there must be exactly one overloaded declaration of 'ArrayList' that accepts the given argument types '{Bug1180Person*}'"), new CompilerError(25, "class alias may not alias overloaded class"));
}
Also used : CompilerError(com.redhat.ceylon.compiler.java.test.CompilerError) Test(org.junit.Test)

Example 4 with CompilerError

use of com.redhat.ceylon.compiler.java.test.CompilerError in project ceylon-compiler by ceylon.

the class InteropTests method testIopCallsDefaultAccessClassInAnotherPkg.

@Test
public void testIopCallsDefaultAccessClassInAnotherPkg() {
    compile("access/JavaAccessModifiers.java");
    compile("access/JavaDefaultAccessClass3.java");
    assertErrors("CallsDefaultAccessClassInAnotherPkg", new CompilerError(21, "imported declaration is not shared: 'JavaDefaultAccessClass'"), new CompilerError(22, "imported declaration is not shared: 'JavaDefaultAccessClass2'"), new CompilerError(28, "type is not visible: 'JavaDefaultAccessClass'"), new CompilerError(29, "type is not visible: 'JavaDefaultAccessClass2'"), new CompilerError(30, "type constructor is not visible: 'JavaDefaultAccessClass3'"));
}
Also used : CompilerError(com.redhat.ceylon.compiler.java.test.CompilerError) Test(org.junit.Test)

Example 5 with CompilerError

use of com.redhat.ceylon.compiler.java.test.CompilerError in project ceylon-compiler by ceylon.

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'"));
}
Also used : CompilerError(com.redhat.ceylon.compiler.java.test.CompilerError) Test(org.junit.Test)

Aggregations

CompilerError (com.redhat.ceylon.compiler.java.test.CompilerError)47 Test (org.junit.Test)47 ErrorCollector (com.redhat.ceylon.compiler.java.test.ErrorCollector)15 File (java.io.File)13 CeyloncTaskImpl (com.redhat.ceylon.compiler.java.tools.CeyloncTaskImpl)11 JarFile (java.util.jar.JarFile)11 ZipEntry (java.util.zip.ZipEntry)7 LinkedList (java.util.LinkedList)6 ZipFile (java.util.zip.ZipFile)4 HttpServer (com.sun.net.httpserver.HttpServer)2 FileInputStream (java.io.FileInputStream)2 FileOutputStream (java.io.FileOutputStream)2 JarOutputStream (java.util.jar.JarOutputStream)2 CompilationTask (javax.tools.JavaCompiler.CompilationTask)2 ExitState (com.redhat.ceylon.compiler.java.launcher.Main.ExitState)1 Module (com.redhat.ceylon.model.typechecker.model.Module)1 FileWriter (java.io.FileWriter)1 Writer (java.io.Writer)1 Ignore (org.junit.Ignore)1