Search in sources :

Example 1 with SystemErrorException

use of com.redhat.ceylon.compiler.SystemErrorException in project ceylon-compiler by ceylon.

the class CompilerToolTests method testCompileWithOomeException.

@Test
public void testCompileWithOomeException() throws Exception {
    ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
    Assert.assertNotNull(model);
    CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--src=test/src", "com.redhat.ceylon.tools.test.oome"));
    try {
        tool.run();
        Assert.fail("Tool should have thrown an exception");
    } catch (SystemErrorException x) {
        Assert.assertEquals("java.lang.OutOfMemoryError", x.getMessage());
    }
}
Also used : CeylonCompileTool(com.redhat.ceylon.compiler.CeylonCompileTool) SystemErrorException(com.redhat.ceylon.compiler.SystemErrorException) Test(org.junit.Test)

Example 2 with SystemErrorException

use of com.redhat.ceylon.compiler.SystemErrorException in project ceylon-compiler by ceylon.

the class CompilerToolTests method testCompileWithStackOverflowError.

@Test
public void testCompileWithStackOverflowError() throws Exception {
    ToolModel<CeylonCompileTool> model = pluginLoader.loadToolModel("compile");
    Assert.assertNotNull(model);
    CeylonCompileTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--src=test/src", "com.redhat.ceylon.tools.test.stackoverflow"));
    try {
        tool.run();
        Assert.fail("Tool should have thrown an exception");
    } catch (SystemErrorException x) {
        Assert.assertEquals("java.lang.StackOverflowError", x.getMessage());
    }
}
Also used : CeylonCompileTool(com.redhat.ceylon.compiler.CeylonCompileTool) SystemErrorException(com.redhat.ceylon.compiler.SystemErrorException) Test(org.junit.Test)

Aggregations

CeylonCompileTool (com.redhat.ceylon.compiler.CeylonCompileTool)2 SystemErrorException (com.redhat.ceylon.compiler.SystemErrorException)2 Test (org.junit.Test)2