Skip to content

Commit

Permalink
[MNG-8281] Change the outcome of an IT wrt interpolation (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet authored Oct 2, 2024
1 parent be7ad32 commit cfbed99
Showing 1 changed file with 23 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
import org.apache.maven.shared.verifier.util.ResourceExtractor;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertThrows;

/**
* This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-3535">MNG-3535</a>.
*
*
*/
public class MavenITmng3535SelfReferentialPropertiesTest extends AbstractMavenIntegrationTestCase {

Expand All @@ -45,29 +45,36 @@ public void testitMNG3535_ShouldSucceed() throws Exception {

verifier.setAutoclean(false);
verifier.addCliArgument("verify");
verifier.execute();

verifier.verifyErrorFreeLog();
if (matchesVersionRange("[4.0.0-beta-5,)")) {
assertThrows(
Exception.class,
() -> {
verifier.execute();
verifier.verifyErrorFreeLog();
},
"There is a self-referential property in this build; it should fail.");
} else {
verifier.execute();
verifier.verifyErrorFreeLog();
}
}

@Test
public void testitMNG3535_ShouldFail() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-3535/failure");

Verifier verifier = newVerifier(testDir.getAbsolutePath());

verifier.addCliArgument("-X");

verifier.setAutoclean(false);
verifier.addCliArgument("-X");
verifier.addCliArgument("verify");

try {
verifier.addCliArgument("verify");
verifier.execute();

verifier.verifyErrorFreeLog();
fail("There is a self-referential property in this build; it should fail.");
} catch (Exception e) {
// should fail this verification, because there truly is a self-referential property.
}
assertThrows(
Exception.class,
() -> {
verifier.execute();
verifier.verifyErrorFreeLog();
},
"There is a self-referential property in this build; it should fail.");
}
}

0 comments on commit cfbed99

Please sign in to comment.