Search in sources :

Example 6 with ImportJarException

use of org.eclipse.ceylon.tools.importjar.ImportJarException in project ceylon by eclipse.

the class ImportJarToolTests method testWithInvalidXmlDescriptor.

@Test
public void testWithInvalidXmlDescriptor() throws Exception {
    FileUtil.delete(destFile("importtest"));
    ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
    Assert.assertNotNull(model);
    try {
        CeylonImportJarTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("--descriptor", "test/src/org/eclipse/ceylon/tools/test/test-descriptor-broken.xml", "importtest/1.0", "test/src/org/eclipse/ceylon/tools/test/test.jar"));
        tool.run();
        Assert.fail();
    } catch (ImportJarException e) {
        Assert.assertEquals("Descriptor file test/src/org/eclipse/ceylon/tools/test/test-descriptor-broken.xml is not a valid module.xml file: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.", e.getMessage().replace('\\', '/'));
    }
}
Also used : ImportJarException(org.eclipse.ceylon.tools.importjar.ImportJarException) CeylonImportJarTool(org.eclipse.ceylon.tools.importjar.CeylonImportJarTool) Test(org.junit.Test)

Aggregations

CeylonImportJarTool (org.eclipse.ceylon.tools.importjar.CeylonImportJarTool)6 ImportJarException (org.eclipse.ceylon.tools.importjar.ImportJarException)6 Test (org.junit.Test)6