Package com.redhat.ceylon.tools.importjar

Examples of com.redhat.ceylon.tools.importjar.CeylonImportJarTool


    @Test
    public void testWithXmlDescriptor() throws IOException {
        FileUtil.delete(destFile("importtest"));
        ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
        Assert.assertNotNull(model);
        CeylonImportJarTool tool = pluginFactory.bindArguments(model, 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());
View Full Code Here


    @Test
    public void testWithPropertiesDescriptor() throws IOException {
        FileUtil.delete(destFile("importtest"));
        ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
        Assert.assertNotNull(model);
        CeylonImportJarTool tool = pluginFactory.bindArguments(model, options(
                "--descriptor", "test/src/com/redhat/ceylon/tools/test/test-descriptor.properties",
                "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.properties");
        Assert.assertTrue(f1.exists() && f2.exists());
        Assert.assertTrue(f3.exists());
View Full Code Here

    public void testWithUnknownModule() throws IOException {
        FileUtil.delete(destFile("importtest"));
        ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
        Assert.assertNotNull(model);
        try {
            CeylonImportJarTool tool = pluginFactory.bindArguments(model, options(
                    "--descriptor", "test/src/com/redhat/ceylon/tools/test/test-descriptor-unknown.properties",
                    "importtest/1.0", "test/src/com/redhat/ceylon/tools/test/test.jar"));
            tool.run();
            Assert.fail();
        } catch (ToolUsageError e) {
            Assert.assertEquals("Problems were found, aborting.", e.getMessage());
        }
    }
View Full Code Here

    @Test
    public void testDryRun() throws IOException {
        FileUtil.delete(destFile("importtest"));
        ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
        Assert.assertNotNull(model);
        CeylonImportJarTool tool = pluginFactory.bindArguments(model, options(
                "--dry-run",
                "--descriptor", "test/src/com/redhat/ceylon/tools/test/test-descriptor.properties",
                "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.properties");
        Assert.assertTrue(!f1.exists() && !f2.exists());
        Assert.assertTrue(!f3.exists());
View Full Code Here

    public void testBug1630() throws IOException {
        FileUtil.delete(destFile("importtest"));
        ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
        Assert.assertNotNull(model);
        try {
            CeylonImportJarTool tool = pluginFactory.bindArguments(model, 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());
        }
    }
View Full Code Here

        FileUtil.copyAll(new File("test/src/com/redhat/ceylon/tools/test/test-descriptor.properties"), destDir);
        FileUtil.copyAll(new File("test/src/com/redhat/ceylon/tools/test/test.jar"), destDir);
       
        ToolModel<CeylonImportJarTool> model = pluginLoader.loadToolModel("import-jar");
        Assert.assertNotNull(model);
        CeylonImportJarTool tool = pluginFactory.bindArguments(model, Arrays.asList(
                "--cwd", destDir.getPath(),
                "--descriptor", "test-descriptor.properties",
                "importtest/1.0", "test.jar"));
        tool.run();
        File f1 = destFile("importtest/modules/importtest/1.0/importtest-1.0.jar");
        File f2 = destFile("importtest/modules/importtest/1.0/importtest-1.0.jar.sha1");
        File f3 = destFile("importtest/modules/importtest/1.0/module.properties");
        Assert.assertTrue(f1.exists() && f2.exists());
        Assert.assertTrue(f3.exists());
View Full Code Here

TOP

Related Classes of com.redhat.ceylon.tools.importjar.CeylonImportJarTool

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.