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

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


                new CompilerError(22, "value is not an uninitialized reference, and may not be annotated late"));
    }

    @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 yet supported on this platform"));
    }
View Full Code Here


        compareWithJavaSource("bug18xx/bug1825/Bug1825");
    }
   
    @Test
    public void testBug1830() {
        ErrorCollector collector = new ErrorCollector();
        CeyloncTaskImpl task = getCompilerTask(defaultOptions, collector, "bug18xx/Bug1830.ceylon");
        ExitState call2 = task.call2();
        Assert.assertEquals(CeylonState.ERROR, call2.ceylonState);
        Assert.assertEquals(Main.EXIT_ERROR, call2.javacExitCode);
    }
View Full Code Here

        compareWithJavaSource("bug18xx/Bug1831");
    }
   
    @Test
    public void testBug1836() {
        ErrorCollector collector = new ErrorCollector();
        CeyloncTaskImpl task = getCompilerTask(defaultOptions, collector, "bug18xx/Bug1836.ceylon");
        ExitState call2 = task.call2();
        Assert.assertEquals(CeylonState.ERROR, call2.ceylonState);
        Assert.assertEquals(Main.EXIT_ERROR, call2.javacExitCode);
    }
View Full Code Here

                +"   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
        CeyloncTaskImpl ceylonTask = getCompilerTask(Arrays.asList("-out", destDir, "-rep", "aether"/*, "-verbose:cmr"*/),
                collector,
                "modules/bug1100/module.ceylon", "modules/bug1100/test.ceylon");
        assertEquals("Compilation failed", Boolean.FALSE, ceylonTask.call());

        TreeSet<CompilerError> actualErrors = collector.get(Diagnostic.Kind.ERROR);
        compareErrors(actualErrors, expectedErrors);
    }
View Full Code Here

        // Compile module A/1
        Boolean result = getCompilerTask(Arrays.asList("-src", getPackagePath()+"/modules/multiversion/a1"),
                "modules/multiversion/a1/a/module.ceylon", "modules/multiversion/a1/a/package.ceylon", "modules/multiversion/a1/a/A.ceylon").call();
        Assert.assertEquals(Boolean.TRUE, result);
       
        ErrorCollector collector = new ErrorCollector();
        // Compile module A/2 with B importing A/1
        result = getCompilerTask(Arrays.asList("-src", getPackagePath()+"/modules/multiversion/a2"+File.pathSeparator+getPackagePath()+"/modules/multiversion/b"),
                collector,
                "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

        // Compile module A/2
        result = getCompilerTask(Arrays.asList("-src", getPackagePath()+"/modules/multiversion/a2"),
                "modules/multiversion/a2/a/module.ceylon", "modules/multiversion/a2/a/package.ceylon", "modules/multiversion/a2/a/A.ceylon").call();
        Assert.assertEquals(Boolean.TRUE, result);

        ErrorCollector collector = new ErrorCollector();
        // Compile module cImportsATwice which imports both A/1 and A/2
        result = getCompilerTask(Arrays.asList("-src", getPackagePath()+"/modules/multiversion/c"),
                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

        result = getCompilerTask(Arrays.asList("-src", getPackagePath()+"/modules/multiversion/b"),
                "modules/multiversion/b/bExportsA1/module.ceylon", "modules/multiversion/b/bExportsA1/package.ceylon", "modules/multiversion/b/bExportsA1/B.ceylon").call();
        Assert.assertEquals(Boolean.TRUE, result);

        // Compile module cImportsABIndirectlyFail which imports both A/1 and A/2
        ErrorCollector collector = new ErrorCollector();
        result = getCompilerTask(Arrays.asList("-src", getPackagePath()+"/modules/multiversion/c"),
                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

        assertEquals(moduleVersion, bundleVersionWithoutQualifier);
    }

    @Test
    public void testMdlOsgiManifestDisabled() throws IOException {
        ErrorCollector c = new ErrorCollector();
        List<String> options = new ArrayList<String>(defaultOptions.size()+1);
        options.addAll(defaultOptions);
        options.add("-noosgi");
        assertCompilesOk(c, getCompilerTask(options, c, "modules/osgi/a/module.ceylon",
                "modules/osgi/a/package.ceylon",
View Full Code Here

        car.close();
    }

    @Test
    public void testMdlNoPomManifest() throws IOException {
        ErrorCollector c = new ErrorCollector();
        assertCompilesOk(c, getCompilerTask(Arrays.asList("-nopom", "-out", destDir), c, "modules/pom/a/module.ceylon",
                "modules/pom/b/module.ceylon").call2());

        final String moduleName = "com.redhat.ceylon.compiler.java.test.cmr.modules.pom.b";
        final String moduleVersion = "1";
View Full Code Here

TOP

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

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.