maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r398500 - in /maven/plugins/trunk/maven-release-plugin/src: main/java/org/apache/maven/plugins/release/config/ test/java/org/apache/maven/plugins/release/phase/
Date Mon, 01 May 2006 01:53:53 GMT
Author: brett
Date: Sun Apr 30 18:53:52 2006
New Revision: 398500

URL: http://svn.apache.org/viewcvs?rev=398500&view=rev
Log:
[MRELEASE-98] fix tests failing internal assertions

Modified:
    maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStore.java
    maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/AbstractReleaseTestCase.java
    maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/AbstractRewritingReleasePhaseTestCase.java
    maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/CheckDependencySnapshotsPhaseTest.java
    maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/RewritePomsForDevelopmentPhaseTest.java
    maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/RewritePomsForReleasePhaseTest.java

Modified: maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStore.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStore.java?rev=398500&r1=398499&r2=398500&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStore.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/config/PropertiesReleaseConfigurationStore.java
Sun Apr 30 18:53:52 2006
@@ -109,14 +109,17 @@
                 {
                     String key = property.substring( "project.scm.".length(), index );
 
-                    Scm scm = new Scm();
-                    scm.setConnection( properties.getProperty( "project.scm." + key + ".connection"
) );
-                    scm.setDeveloperConnection(
-                        properties.getProperty( "project.scm." + key + ".developerConnection"
) );
-                    scm.setUrl( properties.getProperty( "project.scm." + key + ".url" ) );
-                    scm.setTag( properties.getProperty( "project.scm." + key + ".tag" ) );
+                    if ( !releaseConfiguration.getOriginalScmInfo().containsKey( key ) )
+                    {
+                        Scm scm = new Scm();
+                        scm.setConnection( properties.getProperty( "project.scm." + key +
".connection" ) );
+                        scm.setDeveloperConnection(
+                            properties.getProperty( "project.scm." + key + ".developerConnection"
) );
+                        scm.setUrl( properties.getProperty( "project.scm." + key + ".url"
) );
+                        scm.setTag( properties.getProperty( "project.scm." + key + ".tag"
) );
 
-                    releaseConfiguration.mapOriginalScmInfo( key, scm );
+                        releaseConfiguration.mapOriginalScmInfo( key, scm );
+                    }
                 }
             }
         }

Modified: maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/AbstractReleaseTestCase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/AbstractReleaseTestCase.java?rev=398500&r1=398499&r2=398500&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/AbstractReleaseTestCase.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/AbstractReleaseTestCase.java
Sun Apr 30 18:53:52 2006
@@ -112,7 +112,7 @@
         return map;
     }
 
-    protected ReleaseConfiguration createConfigurationFromProjects( String path, String subpath
)
+    protected ReleaseConfiguration createConfigurationFromProjects( String path, String subpath,
boolean copyFiles )
         throws Exception
     {
         File testFile = getTestFile( "target/test-classes/projects/" + path + subpath + "/pom.xml"
);

Modified: maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/AbstractRewritingReleasePhaseTestCase.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/AbstractRewritingReleasePhaseTestCase.java?rev=398500&r1=398499&r2=398500&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/AbstractRewritingReleasePhaseTestCase.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/AbstractRewritingReleasePhaseTestCase.java
Sun Apr 30 18:53:52 2006
@@ -118,7 +118,8 @@
     public void testRewritePomWithChangedInheritedVersion()
         throws Exception
     {
-        ReleaseConfiguration config = createConfigurationForPomWithParentAlternateNextVersion(
"pom-with-inherited-version" );
+        ReleaseConfiguration config =
+            createConfigurationForPomWithParentAlternateNextVersion( "pom-with-inherited-version"
);
 
         phase.execute( config );
 
@@ -408,18 +409,22 @@
     public void testRewriteAddSchema()
         throws Exception
     {
-        ReleaseConfiguration config = createConfigurationFromBasicPom();
-        mapNextVersion( config, "groupId:artifactId" );
-        config.setAddSchema( true );
+        boolean copyFiles = true;
 
         // Run a second time to check they are not duplicated
         for ( int i = 0; i < 2; i++ )
         {
+            ReleaseConfiguration config = createConfigurationFromBasicPom( copyFiles );
+            mapNextVersion( config, "groupId:artifactId" );
+            config.setAddSchema( true );
+
             phase.execute( config );
 
             String expected = readTestProjectFile( "basic-pom/expected-pom-with-schema.xml"
);
             String actual = readTestProjectFile( "basic-pom/pom.xml" );
             assertEquals( "Check the transformed POM", expected, actual );
+
+            copyFiles = false;
         }
     }
 
@@ -524,6 +529,12 @@
         return config;
     }
 
+    protected ReleaseConfiguration createConfigurationFromProjects( String path )
+        throws Exception
+    {
+        return createConfigurationFromProjects( path, true );
+    }
+
     private ReleaseConfiguration createDefaultConfiguration( String path )
         throws Exception
     {
@@ -551,6 +562,12 @@
         return config;
     }
 
+    protected ReleaseConfiguration createConfigurationFromBasicPom()
+        throws Exception
+    {
+        return createConfigurationFromBasicPom( true );
+    }
+
     protected abstract ReleaseConfiguration createConfigurationForWithParentNextVersion(
String path )
         throws Exception;
 
@@ -558,10 +575,10 @@
 
     protected abstract void mapNextVersion( ReleaseConfiguration config, String projectId
);
 
-    protected abstract ReleaseConfiguration createConfigurationFromProjects( String path
)
+    protected abstract ReleaseConfiguration createConfigurationFromProjects( String path,
boolean copyFiles )
         throws Exception;
 
-    protected abstract ReleaseConfiguration createConfigurationFromBasicPom()
+    protected abstract ReleaseConfiguration createConfigurationFromBasicPom( boolean copyFiles
)
         throws Exception;
 
     protected abstract String readTestProjectFile( String fileName )

Modified: maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/CheckDependencySnapshotsPhaseTest.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/CheckDependencySnapshotsPhaseTest.java?rev=398500&r1=398499&r2=398500&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/CheckDependencySnapshotsPhaseTest.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/CheckDependencySnapshotsPhaseTest.java
Sun Apr 30 18:53:52 2006
@@ -554,7 +554,7 @@
     private ReleaseConfiguration createConfigurationFromProjects( String path )
         throws Exception
     {
-        return createConfigurationFromProjects( "check-dependencies/", path );
+        return createConfigurationFromProjects( "check-dependencies/", path, true );
     }
 
 }

Modified: maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/RewritePomsForDevelopmentPhaseTest.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/RewritePomsForDevelopmentPhaseTest.java?rev=398500&r1=398499&r2=398500&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/RewritePomsForDevelopmentPhaseTest.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/RewritePomsForDevelopmentPhaseTest.java
Sun Apr 30 18:53:52 2006
@@ -52,20 +52,21 @@
         return FileUtils.fileRead( getTestFile( "target/test-classes/projects/rewrite-for-development/"
+ fileName ) );
     }
 
-    protected ReleaseConfiguration createConfigurationFromProjects( String path )
+    protected ReleaseConfiguration createConfigurationFromProjects( String path, boolean
copyFiles )
         throws Exception
     {
-        ReleaseConfiguration releaseConfiguration = createConfigurationFromProjects( "rewrite-for-development/",
path );
+        ReleaseConfiguration releaseConfiguration =
+            createConfigurationFromProjects( "rewrite-for-development/", path, copyFiles
);
         releaseConfiguration.setUrl( "scm:svn:file://localhost/tmp/scm-repo" );
         releaseConfiguration.setWorkingDirectory( getTestFile( "target/test/checkout" ) );
 
         return releaseConfiguration;
     }
 
-    protected ReleaseConfiguration createConfigurationFromBasicPom()
+    protected ReleaseConfiguration createConfigurationFromBasicPom( boolean copyFiles )
         throws Exception
     {
-        ReleaseConfiguration config = createConfigurationFromProjects( "basic-pom" );
+        ReleaseConfiguration config = createConfigurationFromProjects( "basic-pom", copyFiles
);
 
         mapScm( config );
 

Modified: maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/RewritePomsForReleasePhaseTest.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/RewritePomsForReleasePhaseTest.java?rev=398500&r1=398499&r2=398500&view=diff
==============================================================================
--- maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/RewritePomsForReleasePhaseTest.java
(original)
+++ maven/plugins/trunk/maven-release-plugin/src/test/java/org/apache/maven/plugins/release/phase/RewritePomsForReleasePhaseTest.java
Sun Apr 30 18:53:52 2006
@@ -41,10 +41,11 @@
         phase = (ReleasePhase) lookup( ReleasePhase.ROLE, "rewrite-poms-for-release" );
     }
 
-    protected ReleaseConfiguration createConfigurationFromProjects( String path )
+    protected ReleaseConfiguration createConfigurationFromProjects( String path, boolean
copyFiles )
         throws Exception
     {
-        ReleaseConfiguration releaseConfiguration = createConfigurationFromProjects( "rewrite-for-release/",
path );
+        ReleaseConfiguration releaseConfiguration = createConfigurationFromProjects( "rewrite-for-release/",
path,
+                                                                                     copyFiles
);
         releaseConfiguration.setUrl( "scm:svn:file://localhost/tmp/scm-repo" );
         releaseConfiguration.setReleaseLabel( "release-label" );
         releaseConfiguration.setWorkingDirectory( getTestFile( "target/test/checkout" ) );
@@ -58,10 +59,10 @@
         return FileUtils.fileRead( getTestFile( "target/test-classes/projects/rewrite-for-release/"
+ fileName ) );
     }
 
-    protected ReleaseConfiguration createConfigurationFromBasicPom()
+    protected ReleaseConfiguration createConfigurationFromBasicPom( boolean copyFiles )
         throws Exception
     {
-        return createConfigurationFromProjects( "basic-pom" );
+        return createConfigurationFromProjects( "basic-pom", copyFiles );
     }
 
     public void testSimulateRewrite()



Mime
View raw message