Fix deprecations

This commit is contained in:
Andreas Dangel
2018-02-18 20:25:42 +01:00
parent 2087dd9472
commit 18c79a34f4
4 changed files with 13 additions and 13 deletions

View File

@ -21,12 +21,12 @@ import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import net.sourceforge.pmd.PMD;
import net.sourceforge.pmd.PMDVersion;
public class BinaryDistributionIT {
private static File getBinaryDistribution() {
return new File(".", "target/pmd-bin-" + PMD.VERSION + ".zip");
return new File(".", "target/pmd-bin-" + PMDVersion.VERSION + ".zip");
}
/**
@ -57,13 +57,13 @@ public class BinaryDistributionIT {
private Set<String> getExpectedFileNames() {
Set<String> result = new HashSet<>();
String basedir = "pmd-bin-" + PMD.VERSION + "/";
String basedir = "pmd-bin-" + PMDVersion.VERSION + "/";
result.add(basedir);
result.add(basedir + "bin/run.sh");
result.add(basedir + "bin/pmd.bat");
result.add(basedir + "bin/cpd.bat");
result.add(basedir + "lib/pmd-core-" + PMD.VERSION + ".jar");
result.add(basedir + "lib/pmd-java-" + PMD.VERSION + ".jar");
result.add(basedir + "lib/pmd-core-" + PMDVersion.VERSION + ".jar");
result.add(basedir + "lib/pmd-java-" + PMDVersion.VERSION + ".jar");
return result;
}

View File

@ -10,7 +10,7 @@ import java.util.Arrays;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.SystemUtils;
import net.sourceforge.pmd.PMD;
import net.sourceforge.pmd.PMDVersion;
/**
* Executes CPD from command line. Deals with the differences, when CPD is run on Windows or on Linux.
@ -25,7 +25,7 @@ public class CpdExecutor {
}
private static ExecutionResult runCpdUnix(Path tempDir, String ... arguments) throws Exception {
String cmd = tempDir.resolve(PMD_BIN_PREFIX + PMD.VERSION + "/bin/run.sh").toAbsolutePath().toString();
String cmd = tempDir.resolve(PMD_BIN_PREFIX + PMDVersion.VERSION + "/bin/run.sh").toAbsolutePath().toString();
ProcessBuilder pb = new ProcessBuilder(cmd, "cpd");
pb.command().addAll(Arrays.asList(arguments));
pb.redirectErrorStream(true);
@ -37,7 +37,7 @@ public class CpdExecutor {
}
private static ExecutionResult runCpdWindows(Path tempDir, String ... arguments) throws Exception {
String cmd = tempDir.resolve(PMD_BIN_PREFIX + PMD.VERSION + "/bin/cpd.bat").toAbsolutePath().toString();
String cmd = tempDir.resolve(PMD_BIN_PREFIX + PMDVersion.VERSION + "/bin/cpd.bat").toAbsolutePath().toString();
ProcessBuilder pb = new ProcessBuilder(cmd);
pb.command().addAll(Arrays.asList(arguments));
pb.redirectErrorStream(true);

View File

@ -10,7 +10,7 @@ import java.util.Arrays;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.SystemUtils;
import net.sourceforge.pmd.PMD;
import net.sourceforge.pmd.PMDVersion;
/**
* Executes PMD from command line. Deals with the differences, when PMD is run on Windows or on Linux.
@ -29,7 +29,7 @@ public class PMDExecutor {
}
private static ExecutionResult runPMDUnix(Path tempDir, String ... arguments) throws Exception {
String cmd = tempDir.resolve(PMD_BIN_PREFIX + PMD.VERSION + "/bin/run.sh").toAbsolutePath().toString();
String cmd = tempDir.resolve(PMD_BIN_PREFIX + PMDVersion.VERSION + "/bin/run.sh").toAbsolutePath().toString();
ProcessBuilder pb = new ProcessBuilder(cmd, "pmd");
pb.command().addAll(Arrays.asList(arguments));
pb.redirectErrorStream(true);
@ -41,7 +41,7 @@ public class PMDExecutor {
}
private static ExecutionResult runPMDWindows(Path tempDir, String ... arguments) throws Exception {
String cmd = tempDir.resolve(PMD_BIN_PREFIX + PMD.VERSION + "/bin/pmd.bat").toAbsolutePath().toString();
String cmd = tempDir.resolve(PMD_BIN_PREFIX + PMDVersion.VERSION + "/bin/pmd.bat").toAbsolutePath().toString();
ProcessBuilder pb = new ProcessBuilder(cmd);
pb.command().addAll(Arrays.asList(arguments));
pb.redirectErrorStream(true);

View File

@ -10,11 +10,11 @@ import java.io.File;
import org.junit.Test;
import net.sourceforge.pmd.PMD;
import net.sourceforge.pmd.PMDVersion;
public class SourceDistributionIT {
private File getSourceDistribution() {
return new File(".", "target/pmd-src-" + PMD.VERSION + ".zip");
return new File(".", "target/pmd-src-" + PMDVersion.VERSION + ".zip");
}
@Test