Search in sources :

Example 16 with CompilerError

use of org.eclipse.ceylon.compiler.java.test.CompilerError in project ceylon by eclipse.

the class InteropTests method testIopExtendsDefaultAccessClassWithOverloading.

@Test
public void testIopExtendsDefaultAccessClassWithOverloading() {
    compile("access/JavaDefaultAccessClass4.java");
    assertErrors("access/ExtendsDefaultAccessClassWithOverloading", new CompilerError(21, "illegal argument types in invocation of overloaded method or class: there must be exactly one overloaded declaration of 'JavaDefaultAccessClass4' which accepts the given argument types ''"));
}
Also used : CompilerError(org.eclipse.ceylon.compiler.java.test.CompilerError) Test(org.junit.Test)

Example 17 with CompilerError

use of org.eclipse.ceylon.compiler.java.test.CompilerError in project ceylon by eclipse.

the class InteropTests method testIopOverrideStaticMethods.

@Test
public void testIopOverrideStaticMethods() {
    compile("JavaWithStaticMembers.java");
    assertErrors("OverrideStaticMethods", new CompilerError(26, "member refines a non-default, non-formal member: 'topMethod' in 'StaticMethodsOverriding' refines 'topMethod' in 'JavaWithStaticMembers' which is not annotated 'formal' or 'default'"), new CompilerError(28, "member refines a non-default, non-formal member: 'topField' in 'StaticMethodsOverriding' refines 'topField' in 'JavaWithStaticMembers' which is not annotated 'formal' or 'default'"));
}
Also used : CompilerError(org.eclipse.ceylon.compiler.java.test.CompilerError) Test(org.junit.Test)

Example 18 with CompilerError

use of org.eclipse.ceylon.compiler.java.test.CompilerError in project ceylon by eclipse.

the class InteropTests method testSealedInterop.

@Test
public void testSealedInterop() {
    compile("access/JavaSealed.java");
    assertErrors("Sealed", new CompilerError(27, "constructor is not visible: 'JavaSealed' is package private"), new CompilerError(29, "class cannot be instantiated: 'Runtime' does not have a default constructor"), new CompilerError(30, "type constructor is not visible: 'JavaSealed'"));
}
Also used : CompilerError(org.eclipse.ceylon.compiler.java.test.CompilerError) Test(org.junit.Test)

Example 19 with CompilerError

use of org.eclipse.ceylon.compiler.java.test.CompilerError in project ceylon by eclipse.

the class InteropTests method testIopDeclareOverloadedMethods.

@Test
public void testIopDeclareOverloadedMethods() {
    assertErrors("DeclareOverloadedMethodsErrors", new CompilerError(22, "duplicate declaration: the name 'method' is not unique in this scope (overloaded function must be declared with the 'overloaded' annotation in 'java.lang')"), new CompilerError(23, "duplicate declaration: the name 'method' is not unique in this scope (overloaded function must be declared with the 'overloaded' annotation in 'java.lang')"));
    compareWithJavaSource("DeclareOverloadedMethods");
}
Also used : CompilerError(org.eclipse.ceylon.compiler.java.test.CompilerError) Test(org.junit.Test)

Example 20 with CompilerError

use of org.eclipse.ceylon.compiler.java.test.CompilerError in project ceylon by eclipse.

the class InteropTests method testIopRefinesDefaultAccessMethodWithShared.

@Test
public void testIopRefinesDefaultAccessMethodWithShared() {
    compile("access/JavaAccessModifiers.java");
    assertErrors("access/RefinesDefaultAccessMethodWithShared", new CompilerError(22, "non-actual member collides with an inherited member: 'defaultAccessMethod' in 'RefinesDefaultAccessMethodWithShared' refines 'defaultAccessMethod' in 'JavaAccessModifiers' but is not annotated 'actual'"));
}
Also used : CompilerError(org.eclipse.ceylon.compiler.java.test.CompilerError) Test(org.junit.Test)

Aggregations

CompilerError (org.eclipse.ceylon.compiler.java.test.CompilerError)55 Test (org.junit.Test)54 ErrorCollector (org.eclipse.ceylon.compiler.java.test.ErrorCollector)19 File (java.io.File)15 CeyloncTaskImpl (org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl)12 JarFile (java.util.jar.JarFile)11 ZipEntry (java.util.zip.ZipEntry)8 LinkedList (java.util.LinkedList)7 ZipFile (java.util.zip.ZipFile)5 FileInputStream (java.io.FileInputStream)2 FileOutputStream (java.io.FileOutputStream)2 JarOutputStream (java.util.jar.JarOutputStream)2 ExitState (org.eclipse.ceylon.compiler.java.launcher.Main.ExitState)2 CompilationTask (org.eclipse.ceylon.javax.tools.JavaCompiler.CompilationTask)2 Ignore (org.junit.Ignore)2 HttpServer (com.sun.net.httpserver.HttpServer)1 FileWriter (java.io.FileWriter)1 Writer (java.io.Writer)1 TreeSet (java.util.TreeSet)1 JarEntry (java.util.jar.JarEntry)1