From 8e3adc631c80a1fb519b3ef821046b331d81fae6 Mon Sep 17 00:00:00 2001 From: Benjamin Bentmann Date: Sat, 10 Jan 2009 10:46:00 +0000 Subject: [PATCH] o Created UT for MNG-3979 git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@733262 13f79535-47bb-0310-9956-ffa450edef68 --- .../project/builder/PomConstructionTest.java | 10 +- .../pom.xml | 97 +++++++++++++++++++ .../sub/pom.xml | 84 ++++++++++++++++ 3 files changed, 190 insertions(+), 1 deletion(-) create mode 100644 maven-project/src/test/resources-project-builder/id-container-joining-with-empty-elements/pom.xml create mode 100644 maven-project/src/test/resources-project-builder/id-container-joining-with-empty-elements/sub/pom.xml diff --git a/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java b/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java index 636996ac76..6415124e48 100644 --- a/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java +++ b/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java @@ -418,7 +418,15 @@ public class PomConstructionTest assertEquals( pom.getBasedir(), new File( pom.getValue( "properties/prop0" ).toString() ) ); assertEquals( pom.getBasedir(), new File( pom.getValue( "properties/prop1" ).toString() ) ); } - + + /* FIXME: cf. MNG-3979 + public void testJoiningOfContainersWhenChildHasEmptyElements() + throws Exception + { + PomTestWrapper pom = buildPom( "id-container-joining-with-empty-elements/sub" ); + assertNotNull( pom ); + } + //*/ private PomArtifactResolver artifactResolver( String basedir ) { diff --git a/maven-project/src/test/resources-project-builder/id-container-joining-with-empty-elements/pom.xml b/maven-project/src/test/resources-project-builder/id-container-joining-with-empty-elements/pom.xml new file mode 100644 index 0000000000..ed95efb09d --- /dev/null +++ b/maven-project/src/test/resources-project-builder/id-container-joining-with-empty-elements/pom.xml @@ -0,0 +1,97 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3979 + parent + 0.1 + pom + + Maven Integration Test :: MNG-3979 + + Test that during inheritance the merging/joining of sub trees with equal identifier doesn't crash if the parent + POM has a non-empty element and the child POM has an empty element to join. + + + + test + + + + + equal-repo-id + http://maven.apache.org/null + + false + + + ignore + + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-log-file + 2.1-SNAPSHOT + + + equal-build-exec-id + initialize + + reset + + + target/exec.log + test + + + + + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-log-file + 2.1-SNAPSHOT + + + equal-report-exec-id + + reset + + + target/exec.log + test + + + + + + + diff --git a/maven-project/src/test/resources-project-builder/id-container-joining-with-empty-elements/sub/pom.xml b/maven-project/src/test/resources-project-builder/id-container-joining-with-empty-elements/sub/pom.xml new file mode 100644 index 0000000000..9bd61d0f62 --- /dev/null +++ b/maven-project/src/test/resources-project-builder/id-container-joining-with-empty-elements/sub/pom.xml @@ -0,0 +1,84 @@ + + + + + + 4.0.0 + + + org.apache.maven.its.mng3979 + parent + 0.1 + + + child + + Maven Integration Test :: MNG-3979 + + Test that during inheritance the merging/joining of sub trees with equal identifier doesn't crash if the parent + POM has a non-empty element and the child POM has an empty element to join. + + + + + + + equal-repo-id + file:///${basedir}/null + + + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-log-file + 2.1-SNAPSHOT + + + equal-build-exec-id + initialize + + + + + + + + + + + + org.apache.maven.its.plugins + maven-it-plugin-log-file + 2.1-SNAPSHOT + + + equal-report-exec-id + + + + + + + +