org.jboss.forge.addon.ui.result.Failed Java Examples

The following examples show how to use org.jboss.forge.addon.ui.result.Failed. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NewComponentInstanceTest.java    From fabric8-forge with Apache License 2.0 6 votes vote down vote up
@Test
public void testSomething() throws Exception {
    File tempDir = OperatingSystemUtils.createTempDir();
    try {
        Project project = projectFactory.createTempProject();
        Assert.assertNotNull("Should have created a project", project);

        CommandController command = testHarness.createCommandController(CamelSetupCommand.class, project.getRoot());
        command.initialize();
        command.setValueFor("kind", "camel-spring");

        Result result = command.execute();
        Assert.assertFalse("Should setup Camel in the project", result instanceof Failed);

        command = testHarness.createCommandController(CamelGetComponentsCommand.class, project.getRoot());
        command.initialize();

        result = command.execute();
        Assert.assertFalse("Should not fail", result instanceof Failed);

        String message = result.getMessage();
        System.out.println(message);
    } finally {
        tempDir.delete();
    }
}
 
Example #2
Source File: NewNodeXmlTest.java    From fabric8-forge with Apache License 2.0 6 votes vote down vote up
protected List<ContextDto> getRoutesXml(Project project) throws Exception {
    CommandController command = testHarness.createCommandController(CamelGetRoutesXmlCommand.class, project.getRoot());
    command.initialize();
    command.setValueFor("format", "JSON");

    Result result = command.execute();
    assertFalse("Should not fail", result instanceof Failed);

    String message = result.getMessage();

    System.out.println();
    System.out.println();
    System.out.println("JSON: " + message);
    System.out.println();

    List<ContextDto> answer = NodeDtos.parseContexts(message);
    System.out.println();
    System.out.println();
    List<NodeDto> nodeList = NodeDtos.toNodeList(answer);
    for (NodeDto node : nodeList) {
        System.out.println(node.getLabel());
    }
    System.out.println();
    return answer;
}
 
Example #3
Source File: NewNodeXmlTest.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
protected void assertExecutes(WizardCommandController command) throws Exception {
    Result result = command.execute();
    assertFalse("Should not fail", result instanceof Failed);
    System.out.println();
    String message = getResultMessage(result);
    System.out.println("Add route result: " + message);
    System.out.println();
}
 
Example #4
Source File: NewNodeXmlTest.java    From fabric8-forge with Apache License 2.0 5 votes vote down vote up
protected static void assertValidAndExecutes(CommandController command) throws Exception {
    List<UIMessage> validate = command.validate();
    for (UIMessage uiMessage : validate) {
        System.out.println("Invalid value of input: " + uiMessage.getSource().getName() + " message: " + uiMessage.getDescription());
    }
    Result result = command.execute();
    String message = result.getMessage();
    assertFalse("Should not fail: " + message, result instanceof Failed);

    System.out.println(message);
}
 
Example #5
Source File: SetupCommandTest.java    From thorntail-addon with Eclipse Public License 1.0 5 votes vote down vote up
@Test
public void checkCommandShell() throws Exception
{
   shellTest.getShell().setCurrentResource(project.getRoot());
   Result result = shellTest.execute(("thorntail-setup"), 10, TimeUnit.SECONDS);

   Assert.assertThat(result, not(instanceOf(Failed.class)));
   Assert.assertTrue(project.hasFacet(ThorntailFacet.class));
}
 
Example #6
Source File: WindupUpdateRulesetCommandTest.java    From windup with Eclipse Public License 1.0 5 votes vote down vote up
@Test
@Ignore("Command can't be used currently as there's no way to run it from the UI."
            + " I'm leaving it here in case we needed the command again (maybe from a GUI?).")
public void testUpdateRulesetCommand() throws Exception
{
    // Extract the windup zip to a temp dir.
    File tempDir = OperatingSystemUtils.createTempDir();
    ZipUtil.unzipFromClassResource(WindupUpdateRulesetCommandTest.class, TEST_OLD_WINDUP, tempDir);

    // This may cause FileNotFound in Furnace if it's already running.
    System.setProperty("windup.home", new File(tempDir, "windup-old-ruleset").getAbsolutePath());

    try (CommandController controller = uiTestHarness.createCommandController(WindupUpdateRulesetCommand.class))
    {
        boolean rulesetNeedUpdate = updater.rulesetsNeedUpdate(true);
        Assert.assertTrue("Rulesets should need an update.", rulesetNeedUpdate);

        controller.initialize();
        Assert.assertTrue(controller.isEnabled());
        Result result = controller.execute();
        Assert.assertFalse(result instanceof Failed);
        rulesetNeedUpdate = updater.rulesetsNeedUpdate(true);
        Assert.assertFalse(rulesetNeedUpdate);
    }
    finally
    {
        FileUtils.deleteDirectory(tempDir);
        System.getProperties().remove("windup.home");
    }
}
 
Example #7
Source File: WindupCommandTest.java    From windup with Eclipse Public License 1.0 5 votes vote down vote up
@Test
public void testNewMigration() throws Exception
{
    Assert.assertNotNull(uiTestHarness);
    try (CommandController controller = uiTestHarness.createCommandController(WindupCommand.class))
    {
        File inputFile = File.createTempFile("windupwizardtest", ".jar");
        inputFile.deleteOnExit();
        try (InputStream iStream = getClass().getResourceAsStream("/test.jar"))
        {
            try (OutputStream oStream = new FileOutputStream(inputFile))
            {
                IOUtils.copy(iStream, oStream);
            }
        }

        File reportPath = new File(inputFile.getAbsoluteFile() + "_output");
        try
        {
            reportPath.mkdirs();

            setupController(controller, inputFile, reportPath);

            Result result = controller.execute();
            final String msg = "controller.execute() 'Failed': " + result.getMessage();
            Assert.assertFalse(msg, result instanceof Failed);
        }
        finally
        {
            inputFile.delete();
            FileUtils.deleteDirectory(reportPath);
        }
    }
}
 
Example #8
Source File: WindupUpdateDistributionCommandTest.java    From windup with Eclipse Public License 1.0 4 votes vote down vote up
@Test
@Ignore("The current implementation doesn't work as it tampers with addons loaded at the time."
            + " Even if it replaced all Windup addons, it would still fail on Windows as they keep the .jar's locked.")
public void testUpdateDistribution() throws Exception
{
    // Download and unzip an old distribution.
    final CoordinateBuilder coords = CoordinateBuilder.create()
                .setGroupId("org.jboss.windup")
                .setArtifactId("windup-distribution")
                .setClassifier("offline")
                .setVersion("2.2.0.Final")
                .setPackaging("zip");
    System.out.println("Downloading " + coords + ", may take a while.");
    List<Coordinate> results = resolver.resolveVersions(DependencyQueryBuilder.create(coords));

    File windupDir = OperatingSystemUtils.createTempDir();
    this.updater.extractArtifact(results.get(0), windupDir);
    windupDir = DistributionUpdater.getWindupDistributionSubdir(windupDir);
    Assert.assertTrue(windupDir.exists());
    System.setProperty(PathUtil.WINDUP_HOME, windupDir.getAbsolutePath());

    // Run the upgrader.
    distUpdater.replaceWindupDirectoryWithLatestDistribution();

    // Check the new version.
    String newUiVersion = getInstalledAddonVersion(windupDir.toPath().resolve("addons").toString(), WINDUP_UI_ADDON_NAME);
    Assert.assertTrue(SingleVersion.valueOf(newUiVersion).compareTo(SingleVersion.valueOf("2.2.0.Final")) > 0);

    // Try to run Windup from there.
    // TODO: I need to set the harness addons directory to the freshly created dir.
    UITestHarness harness = furnace.getAddonRegistry().getServices(UITestHarness.class).get();
    try (CommandController controller = harness.createCommandController(WindupCommand.class))
    {
        controller.initialize();
        controller.setValueFor(InputPathOption.NAME, Collections.singletonList(new File("src/test/resources/test.jar").getAbsolutePath()));
        final File resultDir = new File("target/testRunFromUpgraded");
        resultDir.mkdirs();
        controller.setValueFor(OutputPathOption.NAME, resultDir.getAbsolutePath());

        Result result = controller.execute();
        Assert.assertTrue(result.getMessage(), !(result instanceof Failed));
    }
    catch (Throwable ex)
    {
        throw new WindupException("Failed running Windup from the upgraded directory: " + ex.getMessage(), ex);
    }
}
 
Example #9
Source File: WindupUpdateDistributionCommandTest.java    From windup with Eclipse Public License 1.0 4 votes vote down vote up
@Test
@Ignore("Completely broken now. New Furnace doesn't deal well with setting windup.home like this.")
public void testUpdateDistributionCommand() throws Exception
{

    // Unzip the rulesets from a .zip in resources.

    File tempDir = OperatingSystemUtils.createTempDir();
    tempDir.deleteOnExit();
    File extractedPath = new File(tempDir, "extracted-rulesets");
    ZipUtil.unzipFromClassResource(getClass(), WindupUpdateDistributionCommandTest.TEST_RULESET_ZIP, extractedPath);

    String windupDir = extractedPath + "/windup-old-ruleset";
    System.setProperty(PathUtil.WINDUP_RULESETS_DIR_SYSPROP, windupDir);
    File addonsDir = new File(windupDir, "addons");
    addonsDir.mkdirs();

    String currentUiVersion = getInstalledAddonVersion(addon.getRepository().getRootDirectory().getPath(), WINDUP_UI_ADDON_NAME);
    installOldAddonVersion(currentUiVersion); // changeUiAddonVersion(addon.getRepository().getRootDirectory(),
                                              // currentUiVersion);
    waitForOldWindupUIAddon(furnace);

    boolean rulesetNeedUpdate = updater.rulesetsNeedUpdate(true);
    Assert.assertTrue(rulesetNeedUpdate);
    try (CommandController controller = uiTestHarness.createCommandController("Windup Update Distribution"))
    {
        try
        {
            controller.initialize();
            Assert.assertTrue(controller.isEnabled());
            // Actually runs the command.
            Result result = controller.execute();
            Assert.assertFalse("Windup Update Distribution command should suceed, but it failed.", result instanceof Failed);
            rulesetNeedUpdate = updater.rulesetsNeedUpdate(true);
            Assert.assertFalse("Ruleset should have already been updated to the latest version and as such should not need another update.",
                        rulesetNeedUpdate);

            checkWindupDirectory(windupDir);
        }
        finally
        {
            FileUtils.deleteDirectory(tempDir);
        }
    }
}
 
Example #10
Source File: WindupCommandTest.java    From windup with Eclipse Public License 1.0 4 votes vote down vote up
@Test
public void testOverwriteConfirmation() throws Exception
{
    String overwritePromptMessage = "Overwrite all contents of .*\\?";

    // Sets the overwrite response flag to false
    uiTestHarness.getPromptResults().put(overwritePromptMessage, "false");

    try (CommandController controller = uiTestHarness.createCommandController(WindupCommand.class))
    {
        File inputFile = File.createTempFile("windupwizardtest", "jar");
        inputFile.deleteOnExit();
        try (InputStream iStream = getClass().getResourceAsStream("/test.jar"))
        {
            try (OutputStream oStream = new FileOutputStream(inputFile))
            {
                IOUtils.copy(iStream, oStream);
            }
        }

        File reportPath = new File(inputFile.getAbsoluteFile() + "_output");
        try
        {
            reportPath.mkdirs();
            File newFileInOutputPath = new File(reportPath, "forceoverwriteprompt");
            // make sure that at least one file is in the output
            newFileInOutputPath.createNewFile();

            setupController(controller, inputFile, reportPath);

            Result result = controller.execute();

            // make sure that it failed to run (since the user's response to the overwrite question is false)
            Assert.assertTrue(result instanceof Failed);
            Assert.assertTrue(result.getMessage().contains("overwrite not specified"));
        }
        finally
        {
            inputFile.delete();
            FileUtils.deleteDirectory(reportPath);
        }
    }
}
 
Example #11
Source File: WindupCommandTest.java    From windup with Eclipse Public License 1.0 4 votes vote down vote up
@Test
public void testOutputDefaultValue() throws Exception
{
    Assert.assertNotNull(uiTestHarness);
    try (CommandController controller = uiTestHarness.createCommandController(WindupCommand.class))
    {
        File inputFile = File.createTempFile("windupwizardtest", ".jar");
        inputFile.deleteOnExit();
        try (InputStream iStream = getClass().getResourceAsStream("/test.jar"))
        {
            try (OutputStream oStream = new FileOutputStream(inputFile))
            {
                IOUtils.copy(iStream, oStream);
            }
        }

        try
        {

            setupController(controller, inputFile, null);

            Result result = controller.execute();
            Object outputDir = controller.getValueFor("output");
            Assert.assertTrue("The output should be a folder",
                        DirectoryResource.class.isAssignableFrom(outputDir.getClass()));
            Assert.assertTrue("The output should be created inside the .report folder by default",
                        ((DirectoryResource) outputDir).getName().endsWith(".report"));
            ArrayList<File> inputDirs = (ArrayList<File>) controller.getValueFor("input");
            Assert.assertEquals(1, inputDirs.size());

            File inputDirParent = inputDirs.get(0).getParentFile();
            File child = new File(inputDirParent, ((DirectoryResource) outputDir).getName());
            Assert.assertTrue("The output should be created near the ${input} folder by default", child.exists());
            Assert.assertTrue("The output should be created near the ${input} folder by default", child.isDirectory());
            final String msg = "controller.execute() 'Failed': " + result.getMessage();
            Assert.assertFalse(msg, result instanceof Failed);
        }
        finally
        {
            inputFile.delete();
        }
    }
}
 
Example #12
Source File: WindupCommandTest.java    From windup with Eclipse Public License 1.0 4 votes vote down vote up
@Test
public void testUserRulesDirMigration() throws Exception
{
    Assert.assertNotNull(uiTestHarness);
    try (CommandController controller = uiTestHarness.createCommandController(WindupCommand.class))
    {
        File outputFile = File.createTempFile("windupwizardtest", ".jar");
        outputFile.deleteOnExit();
        try (InputStream iStream = getClass().getResourceAsStream("/test.jar"))
        {
            try (OutputStream oStream = new FileOutputStream(outputFile))
            {
                IOUtils.copy(iStream, oStream);
            }
        }

        File reportPath = new File(outputFile.getAbsoluteFile() + "_output");
        try
        {
            reportPath.mkdirs();

            setupController(controller, outputFile, reportPath);

            File userRulesDir = FileUtils.getTempDirectory().toPath().resolve("Windup")
                        .resolve("windupcommanduserrules_" + RandomStringUtils.randomAlphanumeric(6)).toFile();
            userRulesDir.mkdirs();
            controller.setValueFor(UserRulesDirectoryOption.NAME, Collections.singletonList(userRulesDir));

            Result result = controller.execute();
            final String msg = "controller.execute() 'Failed': " + result.getMessage();
            Assert.assertFalse(msg, result instanceof Failed);

            WindupConfiguration windupConfiguration = (WindupConfiguration) controller.getContext()
                        .getAttributeMap()
                        .get(WindupConfiguration.class);
            List<File> resultUserSpecifiedRulesDirs = windupConfiguration.getOptionValue(UserRulesDirectoryOption.NAME);
            Assert.assertEquals(1, resultUserSpecifiedRulesDirs.size());

            Iterable<Path> allRulesPaths = windupConfiguration.getAllUserRulesDirectories();

            Path expectedUserHomeRulesDir = PathUtil.getUserRulesDir();
            Path expectedWindupHomeRulesDir = PathUtil.getWindupRulesDir();

            boolean foundUserSpecifiedPath = false;
            boolean foundUserHomeDirRulesPath = false;
            boolean foundWindupHomeDirRulesPath = false;
            int totalFound = 0;
            for (Path rulesPath : allRulesPaths)
            {
                totalFound++;
                if (rulesPath.equals(userRulesDir.toPath()))
                {
                    foundUserSpecifiedPath = true;
                }
                if (rulesPath.equals(expectedUserHomeRulesDir))
                {
                    foundUserHomeDirRulesPath = true;
                }
                if (rulesPath.equals(expectedWindupHomeRulesDir))
                {
                    foundWindupHomeDirRulesPath = true;
                }
            }
            Assert.assertTrue(foundUserSpecifiedPath);
            Assert.assertTrue(foundUserHomeDirRulesPath);
            Assert.assertTrue(foundWindupHomeDirRulesPath);
            Assert.assertEquals(3, totalFound);
        }
        finally
        {
            outputFile.delete();
            FileUtils.deleteDirectory(reportPath);
        }
    }
}
 
Example #13
Source File: WindupCommandTest.java    From windup with Eclipse Public License 1.0 4 votes vote down vote up
@Test
public void testDuplicateUserRulesDirMigration() throws Exception
{
    Assert.assertNotNull(uiTestHarness);
    try (CommandController controller = uiTestHarness.createCommandController(WindupCommand.class))
    {
        File outputFile = File.createTempFile("windupwizardtest", ".jar");
        outputFile.deleteOnExit();
        try (InputStream iStream = getClass().getResourceAsStream("/test.jar"))
        {
            try (OutputStream oStream = new FileOutputStream(outputFile))
            {
                IOUtils.copy(iStream, oStream);
            }
        }

        File reportPath = new File(outputFile.getAbsoluteFile() + "_output");
        try
        {
            reportPath.mkdirs();

            setupController(controller, outputFile, reportPath);

            Path expectedUserHomeRulesDir = PathUtil.getUserRulesDir();
            expectedUserHomeRulesDir.toFile().mkdirs();
            controller.setValueFor(UserRulesDirectoryOption.NAME, Collections.singletonList(expectedUserHomeRulesDir.toFile()));

            Result result = controller.execute();
            final String msg = "controller.execute() 'Failed': " + result.getMessage();
            Assert.assertFalse(msg, result instanceof Failed);

            WindupConfiguration windupConfiguration = (WindupConfiguration) controller.getContext()
                        .getAttributeMap()
                        .get(WindupConfiguration.class);
            Collection<File> resultUserSpecifiedRulesDirs = windupConfiguration.getOptionValue(UserRulesDirectoryOption.NAME);
            
            Assert.assertEquals(expectedUserHomeRulesDir.toFile(), resultUserSpecifiedRulesDirs.iterator().next());

            Iterable<Path> allRulesPaths = windupConfiguration.getAllUserRulesDirectories();

            Path expectedWindupHomeRulesDir = PathUtil.getWindupRulesDir();

            boolean foundUserHomeDirRulesPath = false;
            boolean foundWindupHomeDirRulesPath = false;
            int totalFound = 0;
            for (Path rulesPath : allRulesPaths)
            {
                totalFound++;
                if (rulesPath.equals(expectedUserHomeRulesDir))
                {
                    foundUserHomeDirRulesPath = true;
                }
                if (rulesPath.equals(expectedWindupHomeRulesDir))
                {
                    foundWindupHomeDirRulesPath = true;
                }
            }
            Assert.assertTrue(foundUserHomeDirRulesPath);
            Assert.assertTrue(foundWindupHomeDirRulesPath);
            Assert.assertEquals(2, totalFound);
        }
        finally
        {
            outputFile.delete();
            FileUtils.deleteDirectory(reportPath);
        }
    }
}
 
Example #14
Source File: WindupCommandTest.java    From windup with Eclipse Public License 1.0 4 votes vote down vote up
@Test
public void testUserIgnoreDirMigration() throws Exception
{
    Assert.assertNotNull(uiTestHarness);
    try (CommandController controller = uiTestHarness.createCommandController(WindupCommand.class))
    {
        File outputFile = File.createTempFile("windupwizardtest", ".jar");
        outputFile.deleteOnExit();
        File inputIgnoreFile = File.createTempFile("generated-windup-ignore", ".txt");
        inputIgnoreFile.deleteOnExit();
        try (InputStream iStream = getClass().getResourceAsStream("/test.jar"))
        {
            try (OutputStream oStream = new FileOutputStream(outputFile))
            {
                IOUtils.copy(iStream, oStream);
            }
        }
        try (InputStream iStream = getClass().getResourceAsStream(TEST_IGNORE_FILE))
        {
            try (OutputStream oStream = new FileOutputStream(inputIgnoreFile))
            {
                IOUtils.copy(iStream, oStream);
            }
        }

        File reportPath = new File(outputFile.getAbsoluteFile() + "_output");
        try
        {
            reportPath.mkdirs();

            setupController(controller, outputFile, reportPath);

            controller.setValueFor(UserIgnorePathOption.NAME, inputIgnoreFile);

            Result result = controller.execute();
            final String msg = "controller.execute() 'Failed': " + result.getMessage();
            Assert.assertFalse(msg, result instanceof Failed);

            WindupConfiguration windupConfiguration = (WindupConfiguration) controller.getContext()
                        .getAttributeMap()
                        .get(WindupConfiguration.class);
            File resultIgnoreFile = windupConfiguration.getOptionValue(UserIgnorePathOption.NAME);
            Assert.assertEquals(inputIgnoreFile, resultIgnoreFile);

            Iterable<Path> allIgnoreDirectories = windupConfiguration.getAllIgnoreDirectories();

            Path expectedUserHomeIgnoreDir = PathUtil.getUserIgnoreDir();
            Path expectedWindupHomeIgnoreDir = PathUtil.getWindupIgnoreDir();

            boolean foundUserSpecifiedPath = false;
            boolean foundUserHomeDirIgnorePath = false;
            boolean foundWindupHomeDirIgnorePath = false;
            int totalFound = 0;
            for (Path rulesPath : allIgnoreDirectories)
            {
                totalFound++;
                if (rulesPath.equals(resultIgnoreFile.toPath()))
                {
                    foundUserSpecifiedPath = true;
                }
                if (rulesPath.equals(expectedUserHomeIgnoreDir))
                {
                    foundUserHomeDirIgnorePath = true;
                }
                if (rulesPath.equals(expectedWindupHomeIgnoreDir))
                {
                    foundWindupHomeDirIgnorePath = true;
                }
            }
            Assert.assertTrue(foundUserSpecifiedPath);
            Assert.assertTrue(foundUserHomeDirIgnorePath);
            Assert.assertTrue(foundWindupHomeDirIgnorePath);
            Assert.assertEquals(3, totalFound);
            GraphContext context = (GraphContext) controller.getContext().getAttributeMap().get(GraphContext.class);
            GraphService<FileModel> service = new GraphService<>(context.load(), FileModel.class);
            Iterable<FileModel> findAll = service.findAll();
            boolean notEmpty = false;
            for (FileModel fileModel : findAll)
            {
                notEmpty = true;
                if (!(fileModel instanceof IgnoredFileModel) && (fileModel.getFileName().contains("META-INF")))
                {
                    Assert.fail("The file " + fileModel.getFileName() + " should be ignored");
                }
            }
            Assert.assertTrue("There should be some file models present in the graph", notEmpty);
        }
        finally
        {
            outputFile.delete();
            FileUtils.deleteDirectory(reportPath);
        }
    }
}
 
Example #15
Source File: WindupCommandRuleFilteringTest.java    From windup with Eclipse Public License 1.0 4 votes vote down vote up
private void setupAndRun(Set<String> includeTags, Set<String> excludeTags, Set<String> sources, Set<String> targets) throws Exception
{
    Assert.assertNotNull(uiTestHarness);

    this.tag1SourceGlassfishRuleProvider.executed = false;
    this.tag1SourceGlassfishTargetFooRuleProvider.executed = false;
    this.tag2SourceGlassfishTargetJBossRuleProvider.executed = false;
    this.tag3SourceOrionServerRuleProvider.executed = false;

    try (CommandController controller = uiTestHarness.createCommandController(WindupCommand.class))
    {
        File outputFile = File.createTempFile("windupwizardtest", ".jar");
        outputFile.deleteOnExit();
        File inputFile = File.createTempFile("windupwizardtest", ".jar");
        inputFile.deleteOnExit();
        try (InputStream iStream = getClass().getResourceAsStream("/test.jar"))
        {
            try (OutputStream oStream = new FileOutputStream(outputFile))
            {
                IOUtils.copy(iStream, oStream);
            }
        }

        File reportPath = new File(inputFile.getAbsoluteFile() + "_output");
        try
        {
            reportPath.mkdirs();

            controller.initialize();
            Assert.assertTrue(controller.isEnabled());
            //controller.setValueFor(InputPathOption.NAME, inputFile);
            controller.setValueFor(InputPathOption.NAME, Collections.singletonList(inputFile)); // FORGE-2524
            Object valueFor = controller.getValueFor(InputPathOption.NAME);///

            controller.setValueFor(OutputPathOption.NAME, outputFile);

            if (includeTags != null)
            {
                controller.setValueFor(IncludeTagsOption.NAME, includeTags);
            }

            if (excludeTags != null)
            {
                controller.setValueFor(ExcludeTagsOption.NAME, excludeTags);
            }

            if (sources != null)
            {
                controller.setValueFor(SourceOption.NAME, sources);
            }

            if (targets != null)
            {
                controller.setValueFor(TargetOption.NAME, targets);
            }
            Assert.assertTrue(controller.canExecute());

            Result result = controller.execute();
            final String msg = "controller.execute() 'Failed': " + result.getMessage();
            Assert.assertFalse(msg, result instanceof Failed);
        }
        finally
        {
            inputFile.delete();
            FileUtils.deleteDirectory(reportPath);
        }
    }
}