Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MNG-5840] Add tests for when the parent version is a range.
Maven 3.3.0 through 3.3.3 are expected to have the following tests fail: ``` mng5840ParentVersionRanges(ParentRangeRelativePathPointsToWrongVersion) mng5840ParentVersionRanges(ParentRangeRelativePathPointsToCorrectVersion) mng5840RelativePathReactorMatching(RelativePathPointsToWrongVersion) ``` Maven 3.3.4 through 3.3.5 are expected to have the following tests fail: ``` mng5840ParentVersionRanges(ParentRangeRelativePathPointsToWrongVersion) mng5840ParentVersionRanges(ParentRangeRelativePathPointsToCorrectVersion) ``` As of 25f5143169d39075cee67d9f4d11649cce0fafa0 in the Maven core repo the following test results are expected and observed: ``` mng2199ParentVersionRange(ValidParentVersionRangeWithInclusiveUpperBound)OK (3.3 s) mng2199ParentVersionRange(ValidParentVersionRangeWithExclusiveUpperBound)OK (1.7 s) mng2199ParentVersionRange(InvalidParentVersionRange)........OK (0.7 s) mng2199ParentVersionRange(ValidParentVersionRangeInvalidVersionExpression)OK (0.4 s) mng2199ParentVersionRange(ValidParentVersionRangeInvalidVersionInheritance)OK (0.5 s) mng2199ParentVersionRange(ValidLocalParentVersionRange).....OK (0.4 s) mng5840ParentVersionRanges(ParentRangeRelativePathPointsToWrongVersion)FAILURE (0.4 s) mng5840ParentVersionRanges(ParentRangeRelativePathPointsToCorrectVersion)OK (0.4 s) mng5840RelativePathReactorMatching(RelativePathPointsToWrongVersion)OK (0.4 s) ``` With the one failure: mng5840ParentVersionRanges(ParentRangeRelativePathPointsToWrongVersion) expected as the rumoured [validation in the workspace resolver](https://github.com/apache/maven/blob/25f5143169d39075cee67d9f4d11649cce0fafa0/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelBuilder.java#L938) does not actually exist.
- Loading branch information
Showing
8 changed files
with
182 additions
and
2 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5840ParentVersionRanges.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.apache.maven.it; | ||
|
||
import org.apache.maven.it.util.ResourceExtractor; | ||
|
||
import java.io.File; | ||
|
||
public class MavenITmng5840ParentVersionRanges | ||
extends AbstractMavenIntegrationTestCase | ||
{ | ||
public MavenITmng5840ParentVersionRanges() | ||
{ | ||
super( "[3.3,)" ); | ||
} | ||
|
||
public void testParentRangeRelativePathPointsToWrongVersion() | ||
throws Exception | ||
{ | ||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5840-relative-path-range-negative" ); | ||
|
||
Verifier verifier = newVerifier( new File( testDir, "parent-1" ).getAbsolutePath(), "remote" ); | ||
verifier.executeGoal( "install" ); | ||
verifier.verifyErrorFreeLog(); | ||
verifier.resetStreams(); | ||
|
||
verifier = newVerifier( new File( testDir, "child" ).getAbsolutePath(), "remote" ); | ||
verifier.executeGoal( "validate" ); | ||
verifier.verifyErrorFreeLog(); | ||
verifier.resetStreams(); | ||
} | ||
|
||
public void testParentRangeRelativePathPointsToCorrectVersion() | ||
throws Exception | ||
{ | ||
File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-5840-relative-path-range-positive" ); | ||
|
||
Verifier verifier = newVerifier( new File( testDir, "parent-1" ).getAbsolutePath(), "remote" ); | ||
verifier.executeGoal( "install" ); | ||
verifier.verifyErrorFreeLog(); | ||
verifier.resetStreams(); | ||
|
||
verifier = newVerifier( new File( testDir, "child" ).getAbsolutePath(), "remote" ); | ||
verifier.executeGoal( "validate" ); | ||
verifier.verifyErrorFreeLog(); | ||
verifier.resetStreams(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
core-it-suite/src/test/resources/mng-5840-relative-path-range-negative/child/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?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 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>mng-5840-relative-path-negative</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>[1,2)</version> | ||
<relativePath>../parent/pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>child</artifactId> | ||
<version>1-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-enforcer-plugin</artifactId> | ||
<version>1.4</version> | ||
<executions> | ||
<execution> | ||
<inherited>false</inherited> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>enforce</goal> | ||
</goals> | ||
<configuration> | ||
<rules> | ||
<alwaysFail/> | ||
</rules> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
14 changes: 14 additions & 0 deletions
14
core-it-suite/src/test/resources/mng-5840-relative-path-range-negative/parent-1/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?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 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>mng-5840-relative-path-negative</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1</version> | ||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<enforcer.skip>true</enforcer.skip> | ||
</properties> | ||
|
||
</project> |
14 changes: 14 additions & 0 deletions
14
core-it-suite/src/test/resources/mng-5840-relative-path-range-negative/parent/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?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 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>mng-5840-relative-path-negative</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>3-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<!--<enforcer.skip>true</enforcer.skip>--> | ||
</properties> | ||
|
||
</project> |
39 changes: 39 additions & 0 deletions
39
core-it-suite/src/test/resources/mng-5840-relative-path-range-positive/child/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?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 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>mng-5840-relative-path-positive</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>[1.5,3-SNAPSHOT)</version> | ||
<relativePath>../parent/pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>child</artifactId> | ||
<version>1-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-enforcer-plugin</artifactId> | ||
<version>1.4</version> | ||
<executions> | ||
<execution> | ||
<inherited>false</inherited> | ||
<phase>validate</phase> | ||
<goals> | ||
<goal>enforce</goal> | ||
</goals> | ||
<configuration> | ||
<rules> | ||
<alwaysFail/> | ||
</rules> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
14 changes: 14 additions & 0 deletions
14
core-it-suite/src/test/resources/mng-5840-relative-path-range-positive/parent-1/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?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 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>mng-5840-relative-path-positive</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1</version> | ||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<!-- <enforcer.skip>true</enforcer.skip> --> | ||
</properties> | ||
|
||
</project> |
14 changes: 14 additions & 0 deletions
14
core-it-suite/src/test/resources/mng-5840-relative-path-range-positive/parent/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?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 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>mng-5840-relative-path-positive</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>2-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<properties> | ||
<enforcer.skip>true</enforcer.skip> | ||
</properties> | ||
|
||
</project> |