Skip to content

Commit

Permalink
[MNG-8347] Additional tests
Browse files Browse the repository at this point in the history
As original test is not the full story.

---

https://issues.apache.org/jira/browse/MNG-8347
  • Loading branch information
cstamas committed Oct 28, 2024
1 parent 556107e commit 5ca6af2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,34 @@ void transitiveDependencyManager() throws Exception {
}
}

/**
* Mimic bnd-maven-plugin:7.0.0: have direct dependency on plexus-build-api:0.0.7 and observe plexus-utils.
* Beta-5 makes it 1.5.5 while correct version is 1.5.8.
*/
@Test
void useCaseBndPlugin() throws Exception {
File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-8347-bnd-plugin");

Verifier verifier = new Verifier(testDir.getAbsolutePath());
verifier.addCliArgument("-V");
verifier.addCliArgument("dependency:3.8.0:tree");
verifier.addCliArgument("-Dmaven.repo.local.tail=" + testDir + "/local-repo");
verifier.addCliArgument("-Dmaven.repo.local.tail.ignoreAvailability");
verifier.execute();
verifier.verifyErrorFreeLog();

List<String> l = verifier.loadLines(verifier.getLogFileName(), "UTF-8");
if (matchesVersionRange("[4.0.0-beta-5]")) {
a(l, "[INFO] org.apache.maven.it.mresolver614:root:jar:1.0.0");
a(l, "[INFO] \\- org.sonatype.plexus:plexus-build-api:jar:0.0.7:compile");
a(l, "[INFO] \\- org.codehaus.plexus:plexus-utils:jar:1.5.5:compile");
} else {
a(l, "[INFO] org.apache.maven.it.mresolver614:root:jar:1.0.0");
a(l, "[INFO] \\- org.sonatype.plexus:plexus-build-api:jar:0.0.7:compile");
a(l, "[INFO] \\- org.codehaus.plexus:plexus-utils:jar:1.5.8:compile");
}
}

/**
* Assert true, log lines contains string...
*/
Expand Down
17 changes: 17 additions & 0 deletions core-it-suite/src/test/resources/mng-8347-bnd-plugin/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>org.apache.maven.it.mresolver614</groupId>
<artifactId>root</artifactId>
<version>1.0.0</version>

<dependencies>
<dependency>
<groupId>org.sonatype.plexus</groupId>
<artifactId>plexus-build-api</artifactId>
<version>0.0.7</version>
</dependency>
</dependencies>
</project>

0 comments on commit 5ca6af2

Please sign in to comment.