Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Dec 4, 2023
2 parents f350e2f + f96ab07 commit cde58ba
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,6 @@ public final class AssembleMojo extends SafeMojo {
@Parameter(property = "eo.discoverSelf", required = true, defaultValue = "false")
private boolean discoverSelf;

/**
* Track optimization steps into intermediate XML files?
* @checkstyle MemberNameCheck (7 lines)
* @since 0.24.0
*/
@SuppressWarnings("PMD.LongVariable")
@Parameter(property = "eo.trackOptimizationSteps", required = true, defaultValue = "false")
private boolean trackOptimizationSteps;

/**
* Whether we should fail on error.
* @checkstyle MemberNameCheck (7 lines)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,30 @@ void assemblesSuccessfullyInOfflineMode(final Logs out, @TempDir final Path temp
);
}

@Test
@Disabled
void configuresChildParameters(@TempDir final Path temp) throws IOException {
final Map<String, Path> res = new FakeMaven(temp)
.withHelloWorld()
.with("trackOptimizationSteps", true)
.execute(AssembleMojo.class)
.result();
MatcherAssert.assertThat(
"AssembleMojo should have configured parameters within the Mojos that it uses, but it didn't",
res,
Matchers.hasKey(
String.format("target/%s/foo/x/main/01-not-empty-atoms.xml", OptimizeMojo.STEPS)
)
);
MatcherAssert.assertThat(
"AssembleMojo should have configured parameters within the Mojos that it uses, but it didn't",
res,
Matchers.hasKey(
String.format("target/%s/foo/x/main.%s", OptimizeMojo.DIR, TranspileMojo.EXT)
)
);
}

private static String joinedWithUnderscore(final String first, final String second) {
return String.join("_", first, second);
}
Expand Down
7 changes: 7 additions & 0 deletions eo-maven-plugin/src/test/java/org/eolang/maven/FakeMaven.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@
* their behaviour and results.
* NOT thread-safe.
* @since 0.28.12
* @todo #2406:30min Fix {@link FakeMaven#allowedParams(Class)}
* This function configures parameters of executed Mojo in {@link FakeMaven#execute(Class)}
* and parameters those Mojos which are inside this executed Mojo.
* If executed Mojo doesn't have parameters that are inside other Mojos,
* other Mojos parameters will not be configured.
* We need to make sure that custom parameters can be configured too.
* We need to enable the test {@link AssembleMojoTest#configuresChildParameters(Path)}.
*/
@SuppressWarnings({
"PMD.TooManyMethods",
Expand Down

0 comments on commit cde58ba

Please sign in to comment.