@@ -0,0 +1,2828 @@
+/**%0A * Copyright (c) 2016, German Neuroinformatics Node (G-Node)%0A *%0A * All rights reserved.%0A *%0A * Redistribution and use in source and binary forms, with or without%0A * modification, are permitted under the terms of the BSD License. See%0A * LICENSE file in the root of the Project.%0A */%0A%0Apackage org.g_node.mergers;%0A%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.PrintStream;%0Aimport java.nio.file.Files;%0Aimport java.nio.file.Path;%0Aimport java.nio.file.Paths;%0Aimport static org.assertj.core.api.Assertions.assertThat;%0Aimport org.apache.commons.io.FileUtils;%0Aimport org.apache.log4j.ConsoleAppender;%0Aimport org.apache.log4j.Level;%0Aimport org.apache.log4j.Logger;%0Aimport org.apache.log4j.PatternLayout;%0Aimport org.g_node.App;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0A/**%0A * Unit tests for the LktCliController class. Output and Error streams are redirected%0A * from the console to a different PrintStream and reset after tests are finished%0A * to avoid mixing tool error messages with actual test error messages.%0A *%0A * @author Michael Sonntag (sonntag@bio.lmu.de)%0A */%0Apublic class LktCliControllerTest %7B%0A%0A    private ByteArrayOutputStream outStream;%0A    private PrintStream stdout;%0A%0A    private final String tmpRoot = System.getProperty(%22java.io.tmpdir%22);%0A    private final String testFolderName = %22LktCliControllerTest%22;%0A    private final Path testFileFolder = Paths.get(tmpRoot, testFolderName);%0A%0A    /**%0A     * Redirect Error and Out stream.%0A     * @throws Exception%0A     */%0A    @Before%0A    public void setUp() throws Exception %7B%0A        this.stdout = System.out;%0A        this.outStream = new ByteArrayOutputStream();%0A        System.setOut(new PrintStream(this.outStream));%0A%0A        Logger rootLogger = Logger.getRootLogger();%0A        rootLogger.setLevel(Level.INFO);%0A        rootLogger.addAppender(%0A                new ConsoleAppender(%0A                        new PatternLayout(%22%5B%25-5p%5D %25m%25n%22)%0A                )%0A        );%0A    %7D%0A%0A    /**%0A     * Reset Out stream to the console after the tests are done.%0A     * @throws Exception%0A     */%0A    @After%0A    public void tearDown() throws Exception %7B%0A        System.setOut(this.stdout);%0A%0A        if (Files.exists(this.testFileFolder)) %7B%0A            FileUtils.deleteDirectory(this.testFileFolder.toFile());%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void testRunNonExistingMergeFile() %7B%0A        final String useCase = %22lkt%22;%0A        final String testFileName = %22iDoNotExist%22;%0A%0A        final String%5B%5D cliArgs = new String%5B5%5D;%0A        cliArgs%5B0%5D = useCase;%0A        cliArgs%5B1%5D = %22-m%22;%0A        cliArgs%5B2%5D = testFileName;%0A        cliArgs%5B3%5D = %22-i%22;%0A        cliArgs%5B4%5D = testFileName;%0A%0A        App.main(cliArgs);%0A        assertThat(this.outStream.toString()).contains(%0A                String.join(%22%22, %22File %22, testFileName, %22 does not exist.%22)%0A        );%0A    %7D%0A%0A%7D%0A

Add LktCliController test file