use of org.eclipse.ceylon.tools.importjar.CeylonImportJarTool in project ceylon by eclipse.
the class ImportJarToolTests method testJarOnly.
@Test
public void testJarOnly() {
ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
Assert.assertNotNull(model);
try {
CeylonImportJarTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("my.jar"));
Assert.fail();
} catch (OptionArgumentException e) {
Assert.assertEquals("Invalid value 'my.jar' given for argument 'module' to command 'import-jar'", e.getMessage());
}
}
use of org.eclipse.ceylon.tools.importjar.CeylonImportJarTool in project ceylon by eclipse.
the class ImportJarToolTests method testWithXmlDescriptor.
@Test
public void testWithXmlDescriptor() throws Exception {
FileUtil.delete(destFile("importtest"));
ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
Assert.assertNotNull(model);
CeylonImportJarTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("--descriptor", "test/src/org/eclipse/ceylon/tools/test/test-descriptor.xml", "importtest/1.0", "test/src/org/eclipse/ceylon/tools/test/test.jar"));
tool.run();
File f1 = destFile("importtest/1.0/importtest-1.0.jar");
File f2 = destFile("importtest/1.0/importtest-1.0.jar.sha1");
File f3 = destFile("importtest/1.0/module.xml");
Assert.assertTrue(f1.exists() && f2.exists());
Assert.assertTrue(f3.exists());
}
use of org.eclipse.ceylon.tools.importjar.CeylonImportJarTool in project ceylon by eclipse.
the class ImportJarToolTests method testSimpleModuleVersionJar.
@Test
public void testSimpleModuleVersionJar() throws Exception {
FileUtil.delete(destFile("importtest"));
ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
Assert.assertNotNull(model);
CeylonImportJarTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("--force", "importtest/1.0", "test/src/org/eclipse/ceylon/tools/test/test.jar"));
tool.run();
File f1 = destFile("importtest/1.0/importtest-1.0.jar");
File f2 = destFile("importtest/1.0/importtest-1.0.jar.sha1");
Assert.assertTrue(f1.exists() && f2.exists());
}
use of org.eclipse.ceylon.tools.importjar.CeylonImportJarTool in project ceylon by eclipse.
the class ImportJarToolTests method testDryRun.
@Test
public void testDryRun() throws Exception {
FileUtil.delete(destFile("importtest"));
ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
Assert.assertNotNull(model);
CeylonImportJarTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("--dry-run", "--descriptor", "test/src/org/eclipse/ceylon/tools/test/test-descriptor.properties", "importtest/1.0", "test/src/org/eclipse/ceylon/tools/test/test.jar"));
tool.run();
File f1 = destFile("importtest/1.0/importtest-1.0.jar");
File f2 = destFile("importtest/1.0/importtest-1.0.jar.sha1");
File f3 = destFile("importtest/1.0/module.properties");
File f4 = destFile("importtest/1.0/module.properties.sha1");
Assert.assertTrue(!f1.exists());
Assert.assertTrue(!f2.exists());
Assert.assertTrue(!f3.exists());
Assert.assertTrue(!f4.exists());
}
use of org.eclipse.ceylon.tools.importjar.CeylonImportJarTool in project ceylon by eclipse.
the class ImportJarToolTests method testBug1630.
@Test
public void testBug1630() throws Exception {
FileUtil.delete(destFile("importtest"));
ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
Assert.assertNotNull(model);
try {
CeylonImportJarTool tool = pluginFactory.bindArguments(model, getMainTool(), toolOptions("--dry-run", "--descriptor", "test/src/org/eclipse/ceylon/tools/test/test-descriptor.properties", "importtest/1.0", "test/src/org/eclipse/ceylon/tools/test/test2.jar"));
tool.run();
Assert.fail();
} catch (ToolUsageError e) {
Assert.assertEquals("Problems were found, aborting.", e.getMessage());
}
}
Aggregations