You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2023/05/20 11:49:01 UTC
[maven-checkstyle-plugin] branch dep created (now 6f5111b)
This is an automated email from the ASF dual-hosted git repository.
elharo pushed a change to branch dep
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git
at 6f5111b remove unnecessary code
This branch includes the following new commits:
new 6f5111b remove unnecessary code
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[maven-checkstyle-plugin] 01/01: remove unnecessary code
Posted by el...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
elharo pushed a commit to branch dep
in repository https://gitbox.apache.org/repos/asf/maven-checkstyle-plugin.git
commit 6f5111bcbf6235f737bcd694a3d46b30aba008b5
Author: Elliotte Rusty Harold <el...@ibiblio.org>
AuthorDate: Sat May 20 07:48:55 2023 -0400
remove unnecessary code
---
.../plugins/checkstyle/AbstractCheckstyleTestCase.java | 6 +++---
.../plugins/checkstyle/stubs/MinMavenProjectStub.java | 11 +++++------
.../plugins/checkstyle/stubs/ModuleMavenProjectStub.java | 15 +++++++--------
.../plugins/checkstyle/stubs/MultiMavenProjectStub.java | 5 ++---
4 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/src/test/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleTestCase.java b/src/test/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleTestCase.java
index c7e2fbe..9db52c9 100644
--- a/src/test/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleTestCase.java
+++ b/src/test/java/org/apache/maven/plugins/checkstyle/AbstractCheckstyleTestCase.java
@@ -44,7 +44,7 @@ public abstract class AbstractCheckstyleTestCase extends AbstractMojoTestCase {
private ArtifactStubFactory artifactStubFactory;
/**
- * The current project to be test.
+ * The project to test.
*/
private MavenProject testMavenProject;
@@ -80,9 +80,9 @@ public abstract class AbstractCheckstyleTestCase extends AbstractMojoTestCase {
/**
* Get the generated report as file in the test maven project.
*
- * @param name the name of the report.
+ * @param name the name of the report
* @return the generated report as file
- * @throws IOException if the return file doesnt exist
+ * @throws IOException if the return file doesn't exist
*/
protected File getGeneratedReport(String name) throws IOException {
String outputDirectory = getBasedir() + "/target/test/test-harness/"
diff --git a/src/test/java/org/apache/maven/plugins/checkstyle/stubs/MinMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/checkstyle/stubs/MinMavenProjectStub.java
index aaaaf5d..a076dbf 100644
--- a/src/test/java/org/apache/maven/plugins/checkstyle/stubs/MinMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/checkstyle/stubs/MinMavenProjectStub.java
@@ -27,7 +27,6 @@ import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.model.Build;
import org.apache.maven.model.Organization;
import org.apache.maven.model.ReportPlugin;
-import org.codehaus.plexus.PlexusTestCase;
/**
* @author Edwin Punzalan
@@ -42,25 +41,25 @@ public class MinMavenProjectStub extends CheckstyleProjectStub {
/** {@inheritDoc} */
public List<String> getTestClasspathElements() throws DependencyResolutionRequiredException {
List<String> list = new ArrayList<>(getCompileClasspathElements());
- list.add(PlexusTestCase.getBasedir() + "/target/test-classes");
+ list.add("target/test-classes");
return list;
}
/** {@inheritDoc} */
public List<String> getCompileSourceRoots() {
- return Collections.singletonList(PlexusTestCase.getBasedir() + "/target/classes");
+ return Collections.singletonList("target/classes");
}
/** {@inheritDoc} */
public List<String> getTestCompileSourceRoots() {
List<String> list = new ArrayList<>(getCompileSourceRoots());
- list.add(PlexusTestCase.getBasedir() + "/target/test-classes");
+ list.add("target/test-classes");
return list;
}
/** {@inheritDoc} */
public File getBasedir() {
- return new File(PlexusTestCase.getBasedir());
+ return new File(".");
}
/** {@inheritDoc} */
@@ -90,7 +89,7 @@ public class MinMavenProjectStub extends CheckstyleProjectStub {
public Build getBuild() {
Build build = new Build();
- build.setDirectory(PlexusTestCase.getBasedir() + "/target/test-harness/checkstyle/min");
+ build.setDirectory("target/test-harness/checkstyle/min");
return build;
}
diff --git a/src/test/java/org/apache/maven/plugins/checkstyle/stubs/ModuleMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/checkstyle/stubs/ModuleMavenProjectStub.java
index b879a3b..0511285 100644
--- a/src/test/java/org/apache/maven/plugins/checkstyle/stubs/ModuleMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/checkstyle/stubs/ModuleMavenProjectStub.java
@@ -27,7 +27,6 @@ import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.model.Build;
import org.apache.maven.model.Organization;
import org.apache.maven.model.ReportPlugin;
-import org.codehaus.plexus.PlexusTestCase;
/**
* @author Edwin Punzalan
@@ -43,25 +42,25 @@ public class ModuleMavenProjectStub extends CheckstyleProjectStub {
/** {@inheritDoc} */
public List<String> getTestClasspathElements() throws DependencyResolutionRequiredException {
List<String> list = new ArrayList<>(getCompileClasspathElements());
- list.add(PlexusTestCase.getBasedir() + "/target/test-classes");
+ list.add("target/test-classes");
return list;
}
/** {@inheritDoc} */
public List<String> getCompileSourceRoots() {
- return Collections.singletonList(PlexusTestCase.getBasedir() + "/target/classes");
+ return Collections.singletonList("target/classes");
}
/** {@inheritDoc} */
public List<String> getTestCompileSourceRoots() {
List<String> list = new ArrayList<>(getCompileSourceRoots());
- list.add(PlexusTestCase.getBasedir() + "/target/test-classes");
+ list.add("target/test-classes");
return list;
}
/** {@inheritDoc} */
public File getBasedir() {
- return new File(PlexusTestCase.getBasedir());
+ return new File(".");
}
/** {@inheritDoc} */
@@ -91,9 +90,9 @@ public class ModuleMavenProjectStub extends CheckstyleProjectStub {
public Build getBuild() {
Build build = new Build();
- build.setDirectory(PlexusTestCase.getBasedir() + "/target/test-harness/checkstyle/multi");
- build.setSourceDirectory(PlexusTestCase.getBasedir() + "/src/test/test-sources");
- build.setTestSourceDirectory(PlexusTestCase.getBasedir() + "/src/test/java");
+ build.setDirectory("target/test-harness/checkstyle/multi");
+ build.setSourceDirectory("src/test/test-sources");
+ build.setTestSourceDirectory("src/test/java");
return build;
}
diff --git a/src/test/java/org/apache/maven/plugins/checkstyle/stubs/MultiMavenProjectStub.java b/src/test/java/org/apache/maven/plugins/checkstyle/stubs/MultiMavenProjectStub.java
index 63e4abe..adeed8f 100644
--- a/src/test/java/org/apache/maven/plugins/checkstyle/stubs/MultiMavenProjectStub.java
+++ b/src/test/java/org/apache/maven/plugins/checkstyle/stubs/MultiMavenProjectStub.java
@@ -27,7 +27,6 @@ import org.apache.maven.model.Build;
import org.apache.maven.model.Organization;
import org.apache.maven.model.ReportPlugin;
import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.PlexusTestCase;
/**
*
@@ -65,7 +64,7 @@ public class MultiMavenProjectStub extends CheckstyleProjectStub {
/** {@inheritDoc} */
public File getBasedir() {
- return new File(PlexusTestCase.getBasedir());
+ return new File(".");
}
/** {@inheritDoc} */
@@ -95,7 +94,7 @@ public class MultiMavenProjectStub extends CheckstyleProjectStub {
public Build getBuild() {
Build build = new Build();
- build.setDirectory(PlexusTestCase.getBasedir() + "/target/test-harness/checkstyle/multi");
+ build.setDirectory("target/test-harness/checkstyle/multi");
return build;
}