From b5eee08e3f5037e146047af757933ee9fbcb57e3 Mon Sep 17 00:00:00 2001 From: Herve Boutemy Date: Wed, 21 Nov 2012 21:36:19 +0000 Subject: [PATCH] [MNG-5380] check that whitespace can be preserved in Maven plugin configuration when building MavenProject (still need to check if content is not trimmed when injected into plugin) git-svn-id: https://svn.apache.org/repos/asf/maven/maven-3/trunk@1412310 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/maven/project/PomConstructionTest.java | 3 ++- .../org/apache/maven/project/harness/Xpp3DomNodePointer.java | 4 ++-- .../reporting-plugin-config/sub/pom.xml | 5 +++-- 3 files changed, 7 insertions(+), 5 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 26990d3190..8012124fe0 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 @@ -1083,9 +1083,10 @@ public class PomConstructionTest { PomTestWrapper pom = buildPom( "reporting-plugin-config/sub" ); - assertEquals( 2, ( (List) pom.getValue( "reporting/plugins[1]/configuration/stringParams" ) ).size() ); + assertEquals( 3, ( (List) pom.getValue( "reporting/plugins[1]/configuration/stringParams" ) ).size() ); assertEquals( "parentParam", pom.getValue( "reporting/plugins[1]/configuration/stringParams[1]/stringParam[1]" ) ); assertEquals( "childParam", pom.getValue( "reporting/plugins[1]/configuration/stringParams[1]/stringParam[2]" ) ); + assertEquals( " preserve space ", pom.getValue( "reporting/plugins[1]/configuration/stringParams[1]/stringParam[3]" ) ); assertEquals( "true", pom.getValue( "reporting/plugins[1]/configuration/booleanParam" ) ); } diff --git a/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomNodePointer.java b/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomNodePointer.java index a628edcd0e..59ce300eac 100644 --- a/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomNodePointer.java +++ b/maven-core/src/test/java/org/apache/maven/project/harness/Xpp3DomNodePointer.java @@ -78,14 +78,14 @@ class Xpp3DomNodePointer @Override public Object getValue() { - return getValue(node); + return getValue( node ); } private static Object getValue( Xpp3Dom node ) { if ( node.getValue() != null ) { - return node.getValue().trim(); + return node.getValue(); } else { diff --git a/maven-core/src/test/resources-project-builder/reporting-plugin-config/sub/pom.xml b/maven-core/src/test/resources-project-builder/reporting-plugin-config/sub/pom.xml index e6018dd604..b0768271f5 100644 --- a/maven-core/src/test/resources-project-builder/reporting-plugin-config/sub/pom.xml +++ b/maven-core/src/test/resources-project-builder/reporting-plugin-config/sub/pom.xml @@ -36,8 +36,9 @@ maven-it-plugin-configuration 2.1-SNAPSHOT - - childParam + + childParam + preserve space