Examples of CeylonCompileTool


Examples of com.redhat.ceylon.compiler.CeylonCompileTool

    @Test
    public void testCompileNoSuchModule()  throws Exception {
        ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
        Assert.assertNotNull(model);
        try {
            CeylonCompileTool tool = pluginFactory.bindArguments(model,
                    options("--src=test/src", "com.redhat.ceylon.tools.test.nosuchmodule"));
            Assert.fail();
        } catch (OptionArgumentException e) {
            Assert.assertEquals("Module com.redhat.ceylon.tools.test.nosuchmodule not found in source directories: test" + File.separator + "src", e.getMessage());  
        }
View Full Code Here

Examples of com.redhat.ceylon.compiler.CeylonCompileTool

    @Test
    public void testCompileNoSuchModuleDotJava()  throws Exception {
        ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
        Assert.assertNotNull(model);
        try {
            CeylonCompileTool tool = pluginFactory.bindArguments(model,
                    options("--src=test/src", "com.redhat.ceylon.tools.test.nosuchmodule.java"));
            Assert.fail();
        } catch (OptionArgumentException e) {
            Assert.assertEquals("file not found: com.redhat.ceylon.tools.test.nosuchmodule.java", e.getMessage());  
        }
View Full Code Here

Examples of com.redhat.ceylon.compiler.CeylonCompileTool

    @Test
    public void testCompileNoSuchModuleDotCeylon()  throws Exception {
        ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
        Assert.assertNotNull(model);
        try {
            CeylonCompileTool tool = pluginFactory.bindArguments(model,
                    options("--src=test/src", "com.redhat.ceylon.tools.test.nosuchmodule.ceylon"));
            Assert.fail();
        } catch (OptionArgumentException e) {
            Assert.assertEquals("file not found: com.redhat.ceylon.tools.test.nosuchmodule.ceylon", e.getMessage());  
        }
View Full Code Here

Examples of com.redhat.ceylon.compiler.CeylonCompileTool

   
    @Test
    public void testCompileValidEncoding()  throws Exception {
        ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
        Assert.assertNotNull(model);       
        CeylonCompileTool tool = pluginFactory.bindArguments(model,
                options("--src=test/src", "--encoding=UTF-8", "com.redhat.ceylon.tools.test.ceylon"));
    }
View Full Code Here

Examples of com.redhat.ceylon.compiler.CeylonCompileTool

    @Test
    public void testCompileNoSuchEncoding()  throws Exception {
        ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
        Assert.assertNotNull(model);
        try {
            CeylonCompileTool tool = pluginFactory.bindArguments(model,
                    options("--src=test/src", "--encoding=foo", "com.redhat.ceylon.tools.test.ceylon"));
            Assert.fail();
        } catch (OptionArgumentException e) {
            Assert.assertEquals("Unsupported encoding: foo", e.getMessage());  
        }
View Full Code Here

Examples of com.redhat.ceylon.compiler.CeylonCompileTool

    @Test
    public void testCompileModuleAndVersion()  throws Exception {
        ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
        Assert.assertNotNull(model);
        try {
            CeylonCompileTool tool = pluginFactory.bindArguments(model,
                    options("--src=test/src", "com.redhat.ceylon.tools.test.ceylon/1.0"));
            Assert.fail();
        } catch (OptionArgumentException e) {
            Assert.assertEquals("Invalid module name or source file: com.redhat.ceylon.tools.test.ceylon/1.0\n"
                                +"Module names should not contain any version part.\n"
View Full Code Here

Examples of com.redhat.ceylon.compiler.CeylonCompileTool

   
    @Test
    public void testCompileWithSyntaxErrors()  throws Exception {
        ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
        Assert.assertNotNull(model);
        CeylonCompileTool tool = pluginFactory.bindArguments(model,
                options("--src=test/src", "com.redhat.ceylon.tools.test.syntax"));
        try{
            tool.run();
            Assert.fail("Tool should have thrown an exception");
        }catch(CompilerErrorException x){
            Assert.assertEquals("There was 1 error", x.getMessage());
        }catch(Throwable t){
            t.printStackTrace();
View Full Code Here

Examples of com.redhat.ceylon.compiler.CeylonCompileTool

   
    @Test
    public void testCompileWithAnalysisErrors()  throws Exception {
        ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
        Assert.assertNotNull(model);
        CeylonCompileTool tool = pluginFactory.bindArguments(model,
                options("--src=test/src", "com.redhat.ceylon.tools.test.analysis"));
        try{
            tool.run();
            Assert.fail("Tool should have thrown an exception");
        }catch(CompilerErrorException x){
            Assert.assertEquals("There were 3 errors", x.getMessage());
        }catch(Throwable t){
            t.printStackTrace();
View Full Code Here

Examples of com.redhat.ceylon.compiler.CeylonCompileTool

 
    @Test
    public void testCompileWithErroneous()  throws Exception {
        ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
        Assert.assertNotNull(model);
        CeylonCompileTool tool = pluginFactory.bindArguments(model,
                options("--src=test/src", "com.redhat.ceylon.tools.test.erroneous"));
        try{
            tool.run();
            Assert.fail("Tool should have thrown an exception");
        }catch(CompilerErrorException x){
            Assert.assertEquals("There was 1 error", x.getMessage());
        }catch(Throwable t){
            t.printStackTrace();
View Full Code Here

Examples of com.redhat.ceylon.compiler.CeylonCompileTool

   
    @Test
    public void testCompileWithRuntimeException()  throws Exception {
        ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
        Assert.assertNotNull(model);
        CeylonCompileTool tool = pluginFactory.bindArguments(model,
                options("--src=test/src", "com.redhat.ceylon.tools.test.runtimeex"));
        try{
            tool.run();
            Assert.fail("Tool should have thrown an exception");
        }catch(CompilerErrorException x){
            Assert.assertEquals("There was 1 error", x.getMessage());
        }catch(Throwable t){
            t.printStackTrace();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.