Skip to content

Commit

Permalink
WIP 314 Increase test coverage on mojo Part III
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Ruhroth committed Dec 19, 2024
1 parent 30a6543 commit 4204fd2
Showing 1 changed file with 8 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,12 @@ static PerRunResults performChekcs(Configuration myConfig) throws MojoExecutionE

// tag::maven-plugin-implementation[]
public void execute() throws MojoExecutionException {
logBuildParameter();

// Setup configuration
Configuration myConfig = setupConfiguration();

execute(myConfig);

execute(setupConfiguration());
}

void execute(Configuration myConfig) throws MojoExecutionException {
// Check if configuration is valid
logBuildParameter(myConfig);
try {
myConfig.validate();
} catch (MisconfigurationException e) {
Expand Down Expand Up @@ -245,15 +240,15 @@ void createoutputDirs(File dir, String failMessage) throws MojoExecutionExceptio
}


void logBuildParameter() {
void logBuildParameter(Configuration myConfig) {
// Log build parameters
getLog().info(String.join("", Collections.nCopies(70, "=")));
getLog().info("Parameters given to sanityCheck plugin from Maven buildfile...");
getLog().info("Files to check : " + sourceDocuments);
getLog().info("Source directory: " + sourceDir);
getLog().info("Results dir : " + checkingResultsDir);
getLog().info("JUnit dir : " + junitResultsDir);
getLog().info("Fail on errors : " + failOnErrors);
getLog().info("Files to check : " + myConfig.getSourceDocuments());
getLog().info("Source directory: " + myConfig.getSourceDir());
getLog().info("Results dir : " + myConfig.getCheckingResultsDir());
getLog().info("JUnit dir : " + myConfig.getJunitResultsDir());
getLog().info("Fail on errors : " + myConfig.getFailOnErrors());
}

protected Configuration setupConfiguration() {
Expand Down

0 comments on commit 4204fd2

Please sign in to comment.