Package com.redhat.ceylon.compiler.java.test

Examples of com.redhat.ceylon.compiler.java.test.CompilerError


    }

    @Test
    public void testMdlAetherMissingDependencies() throws IOException{
        CompilerError[] expectedErrors = new CompilerError[]{
        new CompilerError(5, "Error while loading the org.apache.camel:camel-jetty/2.9.4 module:\n"
                +"   Error while resolving extended type of org.apache.camel.component.jetty::JettyHttpComponent:\n"
                +"   Failed to find declaration for org.apache.camel.component.http.HttpComponent"),
        new CompilerError(10, "argument must be assignable to parameter 'arg1' of 'addComponent' in 'DefaultCamelContext': 'JettyHttpComponent' is not assignable to 'Component?'"),
        };

        ErrorCollector collector = new ErrorCollector();

        // Try to compile the ceylon module
View Full Code Here


    public void testMdlAetherMissingDependencies2() throws IOException{

        // Try to compile the ceylon module
        assertErrors("modules/bug1104/test",
                Arrays.asList("-out", destDir, "-rep", "aether"/*, "-verbose:cmr"*/), null,
                new CompilerError(5, "Error while loading the org.apache.camel.camel-jetty/2.9.4 module:\n"
                        +"   Error while resolving extended type of org.apache.camel.component.jetty::JettyHttpComponent:\n"
                        +"   Failed to find declaration for org.apache.camel.component.http.HttpComponent"),
                new CompilerError(10, "argument must be assignable to parameter 'arg1' of 'addComponent' in 'DefaultCamelContext': 'JettyHttpComponent' is not assignable to 'Component?'")
        );
    }
View Full Code Here

                "modules/multiversion/a2/a/module.ceylon", "modules/multiversion/a2/a/package.ceylon", "modules/multiversion/a2/a/A.ceylon",
                "modules/multiversion/b/b/module.ceylon", "modules/multiversion/b/b/B.ceylon").call();
        Assert.assertEquals(Boolean.FALSE, result);
       
        compareErrors(collector.get(Diagnostic.Kind.ERROR),
                new CompilerError(20, "source code imports two different versions of module 'a': version \"1\" and version \"2\""));
    }
View Full Code Here

                collector,
                "modules/multiversion/c/cImportsATwice/module.ceylon", "modules/multiversion/c/cImportsATwice/C.ceylon").call();
        Assert.assertEquals(Boolean.FALSE, result);
       
        compareErrors(collector.get(Diagnostic.Kind.ERROR),
                new CompilerError(20, "module (transitively) imports conflicting versions of dependency 'a': version '1' and version '2'"),
                new CompilerError(20, "source code imports two different versions of module 'a': version \"1\" and version \"2\""),
                new CompilerError(22, "duplicate module import: 'a'")
        );
    }
View Full Code Here

                collector,
                "modules/multiversion/c/cImportsABIndirectlyFail/module.ceylon", "modules/multiversion/c/cImportsABIndirectlyFail/C.ceylon").call();
        Assert.assertEquals(Boolean.FALSE, result);
       
        compareErrors(collector.get(Diagnostic.Kind.ERROR),
                new CompilerError(20, "module (transitively) imports conflicting versions of dependency 'a': version '1' and version '2'"),
                new CompilerError(20, "source code imports two different versions of module 'a': version \"1\" and version \"2\"")
        );
    }
View Full Code Here

    }

    @Test
    public void testMdlUsesJavaWithoutImportingIt() throws IOException{
        assertErrors("modules/jdk/usesJavaWithoutImportingIt/Foo",
                new CompilerError(20, "package not found in imported modules: 'java.lang' (add module import to module descriptor of 'com.redhat.ceylon.compiler.java.test.cmr.modules.jdk.usesJavaWithoutImportingIt')"),
                new CompilerError(23, "function or value does not exist: 'nanoTime'"));
    }
View Full Code Here

        options.add("-src");
        options.add(getPackagePath()+"/modules/jdk/defaultUsesJavaWithoutImportingIt");
        options.addAll(defaultOptions);
       
        assertErrors("modules/jdk/defaultUsesJavaWithoutImportingIt/Foo",
                new CompilerError(20, "package not found in imported modules: 'java.lang' (define a module and add module import to its module descriptor)"),
                new CompilerError(23, "function or value does not exist: 'nanoTime'"));
    }
View Full Code Here

                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'"),
                new CompilerError(5, "parameter type could not be determined: 'arg0' of 'method'")
                );
    }
View Full Code Here

       
        // ceylon module imports JavaA/2 and JavaB/1
        // JavaB/1 imports JavaA/1
        assertErrors("modules/bug1062/ceylon/test",
                Arrays.asList("-rep", jarOutputFolder.getPath(), "-cp", getClassPathAsPath()), null,
                new CompilerError(5, "could not determine type of method or attribute reference: 'method' of 'JavaB'"),
                new CompilerError(5, "parameter type could not be determined: 'arg0' of 'method'")
                );
    }
View Full Code Here

       
        // 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(1, "module (transitively) imports conflicting versions of dependency 'bug1062.javaA': version '1' and version '2'"),
                new CompilerError(1, "source code imports two different versions of module 'bug1062.javaA': version \"1\" and version \"2\"")
                );
    }
View Full Code Here

TOP

Related Classes of com.redhat.ceylon.compiler.java.test.CompilerError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.