use of com.redhat.ceylon.tools.importjar.CeylonImportJarTool in project ceylon-compiler by ceylon.
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(), options("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 com.redhat.ceylon.tools.importjar.CeylonImportJarTool in project ceylon-compiler by ceylon.
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(), options("--dry-run", "--descriptor", "test/src/com/redhat/ceylon/tools/test/test-descriptor.properties", "importtest/1.0", "test/src/com/redhat/ceylon/tools/test/test2.jar"));
tool.run();
Assert.fail();
} catch (ToolUsageError e) {
Assert.assertEquals("Problems were found, aborting.", e.getMessage());
}
}
use of com.redhat.ceylon.tools.importjar.CeylonImportJarTool in project ceylon-compiler by ceylon.
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(), options("--force", "importtest/1.0", "test/src/com/redhat/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 com.redhat.ceylon.tools.importjar.CeylonImportJarTool in project ceylon-compiler by ceylon.
the class ImportJarToolTests method testVerbosePackageModuleVersionJar.
@Test
public void testVerbosePackageModuleVersionJar() throws Exception {
FileUtil.delete(destFile("importtest/imptest"));
ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
Assert.assertNotNull(model);
CeylonImportJarTool tool = pluginFactory.bindArguments(model, getMainTool(), options("--verbose", "--force", "importtest.imptest/1.0", "test/src/com/redhat/ceylon/tools/test/test.jar"));
tool.run();
File f1 = destFile("importtest/imptest/1.0/importtest.imptest-1.0.jar");
File f2 = destFile("importtest/imptest/1.0/importtest.imptest-1.0.jar.sha1");
Assert.assertTrue(f1.exists() && f2.exists());
}
use of com.redhat.ceylon.tools.importjar.CeylonImportJarTool in project ceylon-compiler by ceylon.
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(), options("--descriptor", "test/src/com/redhat/ceylon/tools/test/test-descriptor.xml", "importtest/1.0", "test/src/com/redhat/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());
}
Aggregations