Skip to content

Commit

Permalink
#3941 version as a variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Suban05 committed Feb 27, 2025
1 parent 0c64608 commit 66ca67a
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions eo-maven-plugin/src/test/java/org/eolang/maven/ResolveMojoIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,25 @@
@SuppressWarnings({"JTCOP.RuleAllTestsHaveProductionClass", "JTCOP.RuleNotContainsTestWord"})
@ExtendWith({WeAreOnline.class, MktmpResolver.class, MayBeSlow.class})
final class ResolveMojoIT {

/**
* The EO runtime version.
*/
private static final String VERSION = "0.39.0";

@Test
void resolvesJarFile(@Mktmp final Path temp) throws IOException {
new Farea(temp).together(
f -> {
ResolveMojoIT.configureFarea(f);
ResolveMojoIT.configureFarea(f, ResolveMojoIT.VERSION);
f.exec("process-classes");
MatcherAssert.assertThat(
"the jar file was resolved and unpacked",
f.files().file(
String.format(
"target/eo/%s/org.eolang/eo-runtime/-/0.39.0/org/eolang/Phi.class",
ResolveMojo.DIR
"target/eo/%s/org.eolang/eo-runtime/-/%s/org/eolang/Phi.class",
ResolveMojo.DIR,
ResolveMojoIT.VERSION
)
).exists(),
Matchers.is(true)
Expand All @@ -49,7 +56,7 @@ void resolvesJarFile(@Mktmp final Path temp) throws IOException {
void removesOldJarFile(@Mktmp final Path temp) throws IOException {
new Farea(temp).together(
f -> {
ResolveMojoIT.configureFarea(f);
ResolveMojoIT.configureFarea(f, ResolveMojoIT.VERSION);
f.exec("process-classes");
f.dependencies()
.append("org.eolang", "eo-runtime", "0.40.0");
Expand All @@ -58,8 +65,9 @@ void removesOldJarFile(@Mktmp final Path temp) throws IOException {
"binary files from the old JAR were removed",
f.files().file(
String.format(
"target/eo/%s/org.eolang/eo-runtime/-/0.39.0",
ResolveMojo.DIR
"target/eo/%s/org.eolang/eo-runtime/-/%s",
ResolveMojo.DIR,
ResolveMojoIT.VERSION
)
).exists(),
Matchers.is(false)
Expand All @@ -68,10 +76,10 @@ void removesOldJarFile(@Mktmp final Path temp) throws IOException {
);
}

private static void configureFarea(final Farea farea) throws IOException {
private static void configureFarea(final Farea farea, final String version) throws IOException {
farea.clean();
farea.dependencies()
.append("org.eolang", "eo-runtime", "0.39.0");
.append("org.eolang", "eo-runtime", version);
farea.build()
.plugins()
.append(
Expand Down

0 comments on commit 66ca67a

Please sign in to comment.