Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unnecessary I/O indirections #119

Merged
merged 2 commits into from
May 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -80,9 +80,9 @@ protected MavenProject getTestMavenProject() {
/**
* 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/"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
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
Expand All @@ -42,27 +41,22 @@ public List<String> getCompileClasspathElements() throws DependencyResolutionReq
/** {@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());
}

/** {@inheritDoc} */
public List<ReportPlugin> getReportPlugins() {
ReportPlugin jxrPlugin = new ReportPlugin();
Expand Down Expand Up @@ -90,7 +84,7 @@ public String getInceptionYear() {
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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
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
Expand All @@ -43,27 +42,22 @@ public List<String> getCompileClasspathElements() throws DependencyResolutionReq
/** {@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());
}

/** {@inheritDoc} */
public List<ReportPlugin> getReportPlugins() {
ReportPlugin jxrPlugin = new ReportPlugin();
Expand Down Expand Up @@ -91,9 +85,9 @@ public String getInceptionYear() {
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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.apache.maven.model.Organization;
import org.apache.maven.model.ReportPlugin;
import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.PlexusTestCase;

/**
*
Expand Down Expand Up @@ -63,11 +62,6 @@ public List<String> getTestCompileSourceRoots() {
return Collections.emptyList();
}

/** {@inheritDoc} */
public File getBasedir() {
return new File(PlexusTestCase.getBasedir());
}

/** {@inheritDoc} */
public List<ReportPlugin> getReportPlugins() {
ReportPlugin jxrPlugin = new ReportPlugin();
Expand Down Expand Up @@ -95,7 +89,7 @@ public String getInceptionYear() {
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;
}
Expand Down