Search in sources :

Example 31 with CompilerError

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

the class StaticTests method testStaticInterfaceMethods.

@Test
public void testStaticInterfaceMethods() {
    assertErrors("klass/StaticInterfaceMethods", Arrays.asList("-target", "7", "-source", "7"), null, new CompilerError(23, "declaration of static interface member is not allowed unless you set the -target flag to 8: --javac=-target=8"), new CompilerError(25, "declaration of static interface member is not allowed unless you set the -target flag to 8: --javac=-target=8"), new CompilerError(29, "declaration of static interface member is not allowed unless you set the -target flag to 8: --javac=-target=8"), new CompilerError(31, "declaration of static interface member is not allowed unless you set the -target flag to 8: --javac=-target=8"), new CompilerError(34, "declaration of static interface member is not allowed unless you set the -target flag to 8: --javac=-target=8"));
    compile(Arrays.asList("-target", "8", "-source", "8"), "klass/StaticInterfaceMethods.ceylon");
}
Also used : CompilerError(org.eclipse.ceylon.compiler.java.test.CompilerError) Test(org.junit.Test)

Example 32 with CompilerError

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

the class IssuesTests_1000_1499 method testBug1185.

@Test
public void testBug1185() {
    compareWithJavaSource("bug11xx/Bug1185");
    run("org.eclipse.ceylon.compiler.java.test.issues.bug11xx.bug1185");
    assertErrors("bug11xx/Bug1185_errors", new CompilerError(3, "literal outside representable range: '9223372036854775808' is too large to be represented as an 'Integer'"), new CompilerError(4, "literal outside representable range: '-9223372036854775809' is too large to be represented as an 'Integer'"), new CompilerError(5, "invalid hexadecimal literal: '#10000000000000000' has more than 64 bits"), new CompilerError(6, "invalid binary literal: '$10000000000000000000000000000000000000000000000000000000000000000' has more than 64 bits"));
}
Also used : CompilerError(org.eclipse.ceylon.compiler.java.test.CompilerError) Test(org.junit.Test)

Example 33 with CompilerError

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

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"));
}
Also used : ExitState(org.eclipse.ceylon.compiler.java.launcher.Main.ExitState) ErrorCollector(org.eclipse.ceylon.compiler.java.test.ErrorCollector) CompilerError(org.eclipse.ceylon.compiler.java.test.CompilerError) CeyloncTaskImpl(org.eclipse.ceylon.compiler.java.tools.CeyloncTaskImpl) Test(org.junit.Test)

Example 34 with CompilerError

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

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(org.eclipse.ceylon.compiler.java.test.CompilerError) Test(org.junit.Test)

Example 35 with CompilerError

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

the class IssuesTests_6500_6999 method testBug6916.

@Test
public void testBug6916() throws Throwable {
    assertErrors("bug69xx/bug6916/Bug6916", Arrays.asList("-flat-classpath"), null, new CompilerError(5, "Failed to determine if getConverter is overriding a super method: class file for org.apache.wicket.util.convert.IConverter not found"), new CompilerError(5, "formal member 'canCallListenerInterfaceAfterExpiry' of 'IRequestableComponent' not implemented for concrete class 'HelloWorld': 'HelloWorld' neither directly implements nor inherits a concrete implementation of 'canCallListenerInterfaceAfterExpiry'"), new CompilerError(5, "formal member 'equals' of 'Object' not implemented for concrete class 'HelloWorld': 'HelloWorld' neither directly implements nor inherits a concrete implementation of 'equals'"), new CompilerError(5, "formal member 'getBehaviorById' of 'IRequestableComponent' not implemented for concrete class 'HelloWorld': 'HelloWorld' neither directly implements nor inherits a concrete implementation of 'getBehaviorById'"), new CompilerError(5, "formal member 'getBehaviorId' of 'IRequestableComponent' not implemented for concrete class 'HelloWorld': 'HelloWorld' neither directly implements nor inherits a concrete implementation of 'getBehaviorId'"), new CompilerError(5, "formal member 'hash' of 'Object' not implemented for concrete class 'HelloWorld': 'HelloWorld' neither directly implements nor inherits a concrete implementation of 'hash'"));
    compile(Arrays.asList("-fully-export-maven-dependencies"), "bug69xx/bug6916/Bug6916.ceylon");
}
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