This is an automated email from the ASF dual-hosted git repository.
michaelo pushed a commit to branch MNG-6386
in repository https://gitbox.apache.org/repos/asf/maven.git
The following commit(s) were added to refs/heads/MNG-6386 by this push:
new b10e8b5 Added a test for Windows
b10e8b5 is described below
commit b10e8b5089a5ad3d7d29d649638adca91ec8de6d
Author: Michael Osipov <[email protected]>
AuthorDate: Tue May 1 23:15:49 2018 +0200
Added a test for Windows
---
.../apache/maven/project/PomConstructionTest.java | 79 ++++++++++++----------
.../pom.xml | 0
.../AbstractStringBasedModelInterpolator.java | 2 +-
3 files changed, 45 insertions(+), 36 deletions(-)
diff --git
a/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java
b/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java
index 4e94dca..59a700d 100644
--- a/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java
+++ b/maven-core/src/test/java/org/apache/maven/project/PomConstructionTest.java
@@ -140,9 +140,9 @@ public class PomConstructionTest
/*MNG-3900*/
public void testProfilePropertiesInterpolation()
- throws Exception
+ throws Exception
{
- PomTestWrapper pom = buildPom( "profile-properties-interpolation",
"interpolation-profile" );
+ PomTestWrapper pom = buildPom( "profile-properties-interpolation",
"interpolation-profile" );
assertEquals( "PASSED", pom.getValue( "properties[1]/test" ) );
assertEquals( "PASSED", pom.getValue( "properties[1]/property" ) );
}
@@ -1082,13 +1082,22 @@ public class PomConstructionTest
}
/* MNG-3760*/
- public void testInterpolationOfBaseUrl()
+ public void testInterpolationOfBaseUri()
throws Exception
{
- PomTestWrapper pom = buildPom( "baseurl-interpolation/pom.xml" );
- assertEquals( pom.getBasedir().toPath().toUri().toString(),
pom.getValue( "properties/prop1" ).toString() );
+ PomTestWrapper pom = buildPom( "baseuri-interpolation/pom.xml" );
+ assertEquals( pom.getBasedir().toURI().toString(), pom.getValue(
"properties/prop1" ).toString() );
}
+ /* MNG-6386 */
+ public void testInterpolationOfValidBaseUri()
+ throws Exception
+ {
+ PomTestWrapper pom = buildPom( "baseuri-interpolation/pom.xml" );
+ String prop1 = pom.getValue( "properties/prop1" ).toString();
+ assertEquals( pom.getBasedir().toPath().toUri().toString(), prop1 );
+ assertEquals( pom.getBasedir().toURI().toString(), prop1 );
+ }
/* MNG-3811*/
public void testReportingPluginConfig()
throws Exception
@@ -1103,9 +1112,9 @@ public class PomConstructionTest
}
public void testPropertiesNoDuplication()
- throws Exception
+ throws Exception
{
- PomTestWrapper pom = buildPom( "properties-no-duplication/sub" );
+ PomTestWrapper pom = buildPom( "properties-no-duplication/sub" );
assertEquals( 1, ( (Properties) pom.getValue( "properties" ) ).size()
);
assertEquals( "child", pom.getValue( "properties/pomProfile" ) );
}
@@ -1416,9 +1425,9 @@ public class PomConstructionTest
/*MNG-1957*/
public void testJdkActivation()
- throws Exception
- {
- Properties props = new Properties();
+ throws Exception
+ {
+ Properties props = new Properties();
props.put( "java.version", "1.5.0_15" );
PomTestWrapper pom = buildPom( "jdk-activation", props );
@@ -1426,7 +1435,7 @@ public class PomConstructionTest
assertEquals( "PASSED", pom.getValue( "properties/jdkProperty3" ) );
assertEquals( "PASSED", pom.getValue( "properties/jdkProperty2" ) );
assertEquals( "PASSED", pom.getValue( "properties/jdkProperty1" ) );
- }
+ }
/* MNG-2174 */
public void testProfilePluginMngDependencies()
@@ -1464,54 +1473,54 @@ public class PomConstructionTest
}
public void testProfilePlugins()
- throws Exception
- {
+ throws Exception
+ {
PomTestWrapper pom = this.buildPom( "profile-plugins", "standard" );
assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins" ) ).size()
);
assertEquals( "maven-assembly2-plugin", pom.getValue(
"build/plugins[2]/artifactId" ) );
- }
+ }
public void testPluginInheritanceSimple()
- throws Exception
- {
+ throws Exception
+ {
PomTestWrapper pom = this.buildPom( "plugin-inheritance-simple/sub" );
- assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins" )
).size() );
- }
+ assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins" ) ).size()
);
+ }
public void testPluginManagementDuplicate()
- throws Exception
- {
+ throws Exception
+ {
PomTestWrapper pom = this.buildPom( "plugin-management-duplicate/sub"
);
assertEquals( 12, ( (List<?>) pom.getValue(
"build/pluginManagement/plugins" ) ).size() );
- }
+ }
public void testDistributionManagement()
- throws Exception
- {
+ throws Exception
+ {
PomTestWrapper pom = this.buildPom( "distribution-management" );
assertEquals( "legacy", pom.getValue(
"distributionManagement/repository/layout" ) );
- }
+ }
public void testDependencyScopeInheritance()
- throws Exception
- {
+ throws Exception
+ {
PomTestWrapper pom = buildPom( "dependency-scope-inheritance/sub" );
String scope = (String) pom.getValue( "dependencies[1]/scope" );
assertEquals( "compile", scope );
- }
+ }
public void testDependencyScope()
- throws Exception
- {
- buildPom( "dependency-scope/sub" );
- }
+ throws Exception
+ {
+ buildPom( "dependency-scope/sub" );
+ }
//This will fail on a validation error if incorrect
public void testDependencyManagementWithInterpolation()
- throws Exception
- {
- buildPom( "dependency-management-with-interpolation/sub" );
- }
+ throws Exception
+ {
+ buildPom( "dependency-management-with-interpolation/sub" );
+ }
public void testInterpolationWithSystemProperty()
throws Exception
diff --git
a/maven-core/src/test/resources-project-builder/baseurl-interpolation/pom.xml
b/maven-core/src/test/resources-project-builder/baseuri-interpolation/pom.xml
similarity index 100%
rename from
maven-core/src/test/resources-project-builder/baseurl-interpolation/pom.xml
rename to
maven-core/src/test/resources-project-builder/baseuri-interpolation/pom.xml
diff --git
a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java
b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java
index ff094d4..bf82835 100644
---
a/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java
+++
b/maven-model-builder/src/main/java/org/apache/maven/model/interpolation/AbstractStringBasedModelInterpolator.java
@@ -61,7 +61,7 @@ public abstract class AbstractStringBasedModelInterpolator
public static final String CHANGELIST_PROPERTY = "changelist";
public static final String REVISION_PROPERTY = "revision";
-
+
private static final List<String> PROJECT_PREFIXES = Arrays.asList(
"pom.", "project." );
private static final Collection<String> TRANSLATED_PATH_EXPRESSIONS;
--
To stop receiving notification emails like this one, please contact
[email protected].