Search in sources :

Example 1 with SystemErrorException

use of org.eclipse.ceylon.compiler.SystemErrorException in project ceylon by eclipse.

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(), toolOptions("--src=test/src", "org.eclipse.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(org.eclipse.ceylon.compiler.CeylonCompileTool) SystemErrorException(org.eclipse.ceylon.compiler.SystemErrorException) Test(org.junit.Test)

Example 2 with SystemErrorException

use of org.eclipse.ceylon.compiler.SystemErrorException in project ceylon by eclipse.

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(), toolOptions("--src=test/src", "org.eclipse.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(org.eclipse.ceylon.compiler.CeylonCompileTool) SystemErrorException(org.eclipse.ceylon.compiler.SystemErrorException) Test(org.junit.Test)

Aggregations

CeylonCompileTool (org.eclipse.ceylon.compiler.CeylonCompileTool)2 SystemErrorException (org.eclipse.ceylon.compiler.SystemErrorException)2 Test (org.junit.Test)2