Cleanup code

This commit is contained in:
Juan Martín Sotuyo Dodero
2022-08-18 00:27:32 -03:00
parent f250701c73
commit 85e45dcfef
4 changed files with 15 additions and 7 deletions

View File

@ -1,3 +1,7 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.cli;
import static org.junit.jupiter.api.Assertions.assertEquals;
@ -29,5 +33,5 @@ abstract class BaseCliTest {
});
}
abstract protected List<String> cliStandardArgs();
protected abstract List<String> cliStandardArgs();
}

View File

@ -70,12 +70,12 @@ class CpdCliTest extends BaseCliTest {
@Test
void testEmptyResultRendering() throws Exception {
final String stdout = SystemLambda.tapSystemErrAndOut(() -> {
final String stdout = SystemLambda.tapSystemOut(() -> {
SystemLambda.tapSystemErr(() -> {
final int statusCode = SystemLambda.catchSystemExit(() -> {
PmdCli.main(new String[] {
"cpd", "--minimum-tokens", "340", "--language", "java", "--dir",
SRC_DIR, "--format", "xml"
SRC_DIR, "--format", "xml",
});
});
assertEquals(ExecutionResult.OK.getExitCode(), statusCode);

View File

@ -1,3 +1,7 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.cli.commands.internal;
import static org.hamcrest.MatcherAssert.assertThat;

View File

@ -14,15 +14,15 @@ import java.util.Map.Entry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.ParameterException;
import net.sourceforge.pmd.PMD;
import net.sourceforge.pmd.PMDVersion;
import net.sourceforge.pmd.annotation.InternalApi;
import net.sourceforge.pmd.cli.internal.CliMessages;
import net.sourceforge.pmd.cpd.CPD.StatusCode;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.ParameterException;
/**
* @deprecated Internal API. Use {@link CPD#runCpd(String...)} or {@link CPD#main(String[])}
* in order to execute CPD.