You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by si...@apache.org on 2009/01/26 02:23:26 UTC

svn commit: r737619 - in /maven/components/trunk: maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java

Author: sisbell
Date: Mon Jan 26 01:23:25 2009
New Revision: 737619

URL: http://svn.apache.org/viewvc?rev=737619&view=rev
Log:
Updated unit tests with assertions.

Modified:
    maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java
    maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java

Modified: maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java?rev=737619&r1=737618&r2=737619&view=diff
==============================================================================
--- maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java (original)
+++ maven/components/trunk/maven-project-builder/src/main/java/org/apache/maven/project/builder/PomTransformer.java Mon Jan 26 01:23:25 2009
@@ -352,7 +352,6 @@
         props.removeAll( removeProperties );
 
         //Execution Rule - extension for this needs to be pushed into model-builder
-
         dataSource = new DefaultModelDataSource( props, PomTransformer.MODEL_CONTAINER_FACTORIES );
 
         for(ModelContainer mc : dataSource.queryFor( ProjectUri.Build.Plugins.Plugin.xUri ))

Modified: maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java
URL: http://svn.apache.org/viewvc/maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java?rev=737619&r1=737618&r2=737619&view=diff
==============================================================================
--- maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java (original)
+++ maven/components/trunk/maven-project/src/test/java/org/apache/maven/project/builder/PomConstructionTest.java Mon Jan 26 01:23:25 2009
@@ -68,7 +68,7 @@
     // them into a resolver, create the expression to extract the data to validate the Model, and the URI
     // to validate the properties. We also need a way to navigate from the Tex specification documents to
     // the test in question and vice versa. A little Eclipse plugin would do the trick.
-    /*
+
     public void testThatExecutionsWithoutIdsAreMergedAndTheChildWins()
         throws Exception
     {
@@ -80,7 +80,7 @@
         PomTestWrapper tester = new PomTestWrapper( model );
         assertModelEquals( tester, "child-descriptor", "build/plugins[1]/executions[1]/goals[1]" );
     }
-      */
+
     public void testErroneousJoiningOfDifferentPluginsWithEqualDependencies()
         throws Exception
     {
@@ -91,7 +91,7 @@
         assertEquals( 1, ( (List<?>) pom.getValue( "build/plugins[1]/dependencies" ) ).size() );
     }
 
-    /** MNG-3821 -FIX---
+    /** MNG-3821 FIX THIS
     public void testErroneousJoiningOfDifferentPluginsWithEqualExecutionIds()
         throws Exception
     {
@@ -105,24 +105,31 @@
         assertEquals( "maven-it-plugin-b", pom.getValue( "reporting/plugins[2]/artifactId" ) );
         assertEquals( 1, ( (List<?>) pom.getValue( "reporting/plugins[1]/reportSets" ) ).size() );
     }
-    */
+      */
      /** MNG-3998 */
     public void testExecutionConfiguration()
         throws Exception
     {
         PomTestWrapper pom = buildPom( "execution-configuration" );
+        assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins[1]/executions[1]/configuration" ) ).size() );
     }
 
     public void testSingleConfigurationInheritance()
         throws Exception
     {
         PomTestWrapper pom = buildPom( "single-configuration-inheritance" );
+        assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins[1]/executions[1]/configuration[1]/rules" ) ).size() );
+        assertEquals("2.0.6", pom.getValue( "build/plugins[1]/executions[1]/configuration[1]/rules[1]/requireMavenVersion[1]/version" ) );
+        assertEquals("[2.0.6,)", pom.getValue( "build/plugins[1]/executions[1]/configuration[1]/rules[2]/requireMavenVersion[1]/version" ) );
     }
 
     public void testConfigWithPluginManagement()
         throws Exception
     {
         PomTestWrapper pom = buildPom( "config-with-plugin-mng" );
+        assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins[1]/executions" ) ).size() );
+        assertEquals( "src/main/mdo/security.xml", pom.getValue( "build/plugins[1]/executions[1]/configuration[1]/model" ) );
+        assertEquals( "1.0.8", pom.getValue( "build/plugins[1]/executions[2]/configuration[1]/version" ) );
     }
 
     /** MNG-3965 */
@@ -130,6 +137,7 @@
         throws Exception
     {
         PomTestWrapper pom = buildPom( "execution-configuration-subcollections" );
+        assertEquals( 2, ( (List<?>) pom.getValue( "build/plugins[1]/executions[1]/configuration[1]/rules[1]/bannedDependencies" ) ).size() );
     }
 
     /** MNG- */