You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by de...@apache.org on 2013/10/12 00:18:55 UTC
svn commit: r1531451 [2/15] - in /maven/release/trunk: ./
maven-release-manager/src/main/java/org/apache/maven/shared/release/
maven-release-manager/src/main/java/org/apache/maven/shared/release/scm/
maven-release-manager/src/main/resources/ maven-rele...
Modified: maven/release/trunk/maven-release-manager/src/main/resources/release-messages_en.properties
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/resources/release-messages_en.properties?rev=1531451&r1=1531450&r2=1531451&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/resources/release-messages_en.properties (original)
+++ maven/release/trunk/maven-release-manager/src/main/resources/release-messages_en.properties Fri Oct 11 22:18:49 2013
@@ -1,23 +1,23 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# NOTE:
-# This bundle is intentionally empty because English strings are provided by the base bundle via the parent chain. It
-# must be provided nevertheless such that a request for locale "en" will not errorneously pick up the bundle for the
-# JVM's default locale (which need not be "en"). See the method javadoc about
-# ResourceBundle.getBundle(String, Locale, ClassLoader)
-# for a full description of the lookup strategy.
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# NOTE:
+# This bundle is intentionally empty because English strings are provided by the base bundle via the parent chain. It
+# must be provided nevertheless such that a request for locale "en" will not errorneously pick up the bundle for the
+# JVM's default locale (which need not be "en"). See the method javadoc about
+# ResourceBundle.getBundle(String, Locale, ClassLoader)
+# for a full description of the lookup strategy.
Propchange: maven/release/trunk/maven-release-manager/src/main/resources/release-messages_en.properties
------------------------------------------------------------------------------
svn:eol-style = native
Modified: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/exec/AbstractMavenExecutorTest.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/exec/AbstractMavenExecutorTest.java?rev=1531451&r1=1531450&r2=1531451&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/exec/AbstractMavenExecutorTest.java (original)
+++ maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/exec/AbstractMavenExecutorTest.java Fri Oct 11 22:18:49 2013
@@ -1,109 +1,109 @@
-package org.apache.maven.shared.release.exec;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import static org.mockito.Matchers.eq;
-import static org.mockito.Matchers.isA;
-import static org.mockito.Matchers.isNull;
-import static org.mockito.Mockito.reset;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.verify;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.apache.maven.shared.release.ReleaseResult;
-import org.apache.maven.shared.release.env.ReleaseEnvironment;
-
-public class AbstractMavenExecutorTest
- extends TestCase
-{
-
- public void testGoalSeparation()
- throws MavenExecutorException
- {
- AbstractMavenExecutor executor = spy( new AbstractMavenExecutorSpy() );
-
- executor.executeGoals( null, null, true, null, null );
- verify( executor ).executeGoals( isNull( File.class ), eq( new ArrayList<String>() ),
- isA( ReleaseEnvironment.class ), eq( true ), isNull( String.class ),
- isNull( String.class ), isNull( ReleaseResult.class ) );
- reset( executor );
-
- executor.executeGoals( null, " clean verify ", true, null, null );
- verify( executor ).executeGoals( isNull( File.class ),
- eq( Arrays.asList( "clean", "verify" ) ),
- isA( ReleaseEnvironment.class ), eq( true ), isNull( String.class ),
- isNull( String.class ), isNull( ReleaseResult.class ) );
- reset( executor );
-
- executor.executeGoals( null, ",clean,verify,", true, null, null );
- verify( executor ).executeGoals( isNull( File.class ),
- eq( Arrays.asList( "clean", "verify" ) ),
- isA( ReleaseEnvironment.class ), eq( true ), isNull( String.class ),
- isNull( String.class ), isNull( ReleaseResult.class ) );
- reset( executor );
-
- executor.executeGoals( null, "\nclean\nverify\n", true, null, null );
- verify( executor ).executeGoals( isNull( File.class ),
- eq( Arrays.asList( "clean", "verify" ) ),
- isA( ReleaseEnvironment.class ), eq( true ), isNull( String.class ),
- isNull( String.class ), isNull( ReleaseResult.class ) );
- reset( executor );
-
- executor.executeGoals( null, "\rclean\rverify\r", true, null, null );
- verify( executor ).executeGoals( isNull( File.class ),
- eq( Arrays.asList( "clean", "verify" ) ),
- isA( ReleaseEnvironment.class ), eq( true ), isNull( String.class ),
- isNull( String.class ), isNull( ReleaseResult.class ) );
- reset( executor );
-
- executor.executeGoals( null, "\r\nclean\r\nverify\r\n", true, null, null );
- verify( executor ).executeGoals( isNull( File.class ),
- eq( Arrays.asList( "clean", "verify" ) ),
- isA( ReleaseEnvironment.class ), eq( true ), isNull( String.class ),
- isNull( String.class ), isNull( ReleaseResult.class ) );
- reset( executor );
-
- executor.executeGoals( null, "\tclean\tverify\t", true, null, null );
- verify( executor ).executeGoals( isNull( File.class ),
- eq( Arrays.asList( "clean", "verify" ) ),
- isA( ReleaseEnvironment.class ), eq( true ), isNull( String.class ),
- isNull( String.class ), isNull( ReleaseResult.class ) );
- reset( executor );
- }
-
- protected class AbstractMavenExecutorSpy
- extends AbstractMavenExecutor
- {
-
- @Override
- protected void executeGoals( File workingDirectory, List<String> goals, ReleaseEnvironment releaseEnvironment,
- boolean interactive, String additionalArguments, String pomFileName,
- ReleaseResult result )
- throws MavenExecutorException
- {
- }
- }
+package org.apache.maven.shared.release.exec;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import static org.mockito.Matchers.eq;
+import static org.mockito.Matchers.isA;
+import static org.mockito.Matchers.isNull;
+import static org.mockito.Mockito.reset;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.maven.shared.release.ReleaseResult;
+import org.apache.maven.shared.release.env.ReleaseEnvironment;
+
+public class AbstractMavenExecutorTest
+ extends TestCase
+{
+
+ public void testGoalSeparation()
+ throws MavenExecutorException
+ {
+ AbstractMavenExecutor executor = spy( new AbstractMavenExecutorSpy() );
+
+ executor.executeGoals( null, null, true, null, null );
+ verify( executor ).executeGoals( isNull( File.class ), eq( new ArrayList<String>() ),
+ isA( ReleaseEnvironment.class ), eq( true ), isNull( String.class ),
+ isNull( String.class ), isNull( ReleaseResult.class ) );
+ reset( executor );
+
+ executor.executeGoals( null, " clean verify ", true, null, null );
+ verify( executor ).executeGoals( isNull( File.class ),
+ eq( Arrays.asList( "clean", "verify" ) ),
+ isA( ReleaseEnvironment.class ), eq( true ), isNull( String.class ),
+ isNull( String.class ), isNull( ReleaseResult.class ) );
+ reset( executor );
+
+ executor.executeGoals( null, ",clean,verify,", true, null, null );
+ verify( executor ).executeGoals( isNull( File.class ),
+ eq( Arrays.asList( "clean", "verify" ) ),
+ isA( ReleaseEnvironment.class ), eq( true ), isNull( String.class ),
+ isNull( String.class ), isNull( ReleaseResult.class ) );
+ reset( executor );
+
+ executor.executeGoals( null, "\nclean\nverify\n", true, null, null );
+ verify( executor ).executeGoals( isNull( File.class ),
+ eq( Arrays.asList( "clean", "verify" ) ),
+ isA( ReleaseEnvironment.class ), eq( true ), isNull( String.class ),
+ isNull( String.class ), isNull( ReleaseResult.class ) );
+ reset( executor );
+
+ executor.executeGoals( null, "\rclean\rverify\r", true, null, null );
+ verify( executor ).executeGoals( isNull( File.class ),
+ eq( Arrays.asList( "clean", "verify" ) ),
+ isA( ReleaseEnvironment.class ), eq( true ), isNull( String.class ),
+ isNull( String.class ), isNull( ReleaseResult.class ) );
+ reset( executor );
+
+ executor.executeGoals( null, "\r\nclean\r\nverify\r\n", true, null, null );
+ verify( executor ).executeGoals( isNull( File.class ),
+ eq( Arrays.asList( "clean", "verify" ) ),
+ isA( ReleaseEnvironment.class ), eq( true ), isNull( String.class ),
+ isNull( String.class ), isNull( ReleaseResult.class ) );
+ reset( executor );
+
+ executor.executeGoals( null, "\tclean\tverify\t", true, null, null );
+ verify( executor ).executeGoals( isNull( File.class ),
+ eq( Arrays.asList( "clean", "verify" ) ),
+ isA( ReleaseEnvironment.class ), eq( true ), isNull( String.class ),
+ isNull( String.class ), isNull( ReleaseResult.class ) );
+ reset( executor );
+ }
+
+ protected class AbstractMavenExecutorSpy
+ extends AbstractMavenExecutor
+ {
+
+ @Override
+ protected void executeGoals( File workingDirectory, List<String> goals, ReleaseEnvironment releaseEnvironment,
+ boolean interactive, String additionalArguments, String pomFileName,
+ ReleaseResult result )
+ throws MavenExecutorException
+ {
+ }
+ }
}
\ No newline at end of file
Propchange: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/exec/AbstractMavenExecutorTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/exec/InvokerMavenExecutorTest.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/exec/InvokerMavenExecutorTest.java?rev=1531451&r1=1531450&r2=1531451&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/exec/InvokerMavenExecutorTest.java (original)
+++ maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/exec/InvokerMavenExecutorTest.java Fri Oct 11 22:18:49 2013
@@ -1,51 +1,51 @@
-package org.apache.maven.shared.release.exec;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.mock;
-
-import org.apache.maven.shared.invoker.DefaultInvocationRequest;
-import org.apache.maven.shared.invoker.InvocationRequest;
-import org.codehaus.plexus.logging.Logger;
-import org.junit.Test;
-
-
-public class InvokerMavenExecutorTest
-{
-
- @Test
- public void testThreads() throws Exception
- {
- InvokerMavenExecutor executor = new InvokerMavenExecutor();
- Logger logger = mock( Logger.class );
- executor.enableLogging( logger );
-
- InvocationRequest req = new DefaultInvocationRequest();
- executor.setupRequest( req, null, "-T 3" );
- assertEquals( "3", req.getThreads() );
-
- req = new DefaultInvocationRequest();
- executor.setupRequest( req, null, "-T4" );
- assertEquals( "4", req.getThreads() );
-
- req = new DefaultInvocationRequest();
- executor.setupRequest( req, null, "\"-T5\"" );
- assertEquals( "5", req.getThreads() );
-
- }
-
- @Test
- public void testGlobalSettings() throws Exception
- {
- InvokerMavenExecutor executor = new InvokerMavenExecutor();
- Logger logger = mock( Logger.class );
- executor.enableLogging( logger );
-
- InvocationRequest req = new DefaultInvocationRequest();
- executor.setupRequest( req, null, "-gs custom-settings.xml" );
- assertEquals( "custom-settings.xml", req.getGlobalSettingsFile().getPath() );
-
- req = new DefaultInvocationRequest();
- executor.setupRequest( req, null, "--global-settings other-settings.xml" );
- assertEquals( "other-settings.xml", req.getGlobalSettingsFile().getPath() );
- }
-}
+package org.apache.maven.shared.release.exec;
+
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+
+import org.apache.maven.shared.invoker.DefaultInvocationRequest;
+import org.apache.maven.shared.invoker.InvocationRequest;
+import org.codehaus.plexus.logging.Logger;
+import org.junit.Test;
+
+
+public class InvokerMavenExecutorTest
+{
+
+ @Test
+ public void testThreads() throws Exception
+ {
+ InvokerMavenExecutor executor = new InvokerMavenExecutor();
+ Logger logger = mock( Logger.class );
+ executor.enableLogging( logger );
+
+ InvocationRequest req = new DefaultInvocationRequest();
+ executor.setupRequest( req, null, "-T 3" );
+ assertEquals( "3", req.getThreads() );
+
+ req = new DefaultInvocationRequest();
+ executor.setupRequest( req, null, "-T4" );
+ assertEquals( "4", req.getThreads() );
+
+ req = new DefaultInvocationRequest();
+ executor.setupRequest( req, null, "\"-T5\"" );
+ assertEquals( "5", req.getThreads() );
+
+ }
+
+ @Test
+ public void testGlobalSettings() throws Exception
+ {
+ InvokerMavenExecutor executor = new InvokerMavenExecutor();
+ Logger logger = mock( Logger.class );
+ executor.enableLogging( logger );
+
+ InvocationRequest req = new DefaultInvocationRequest();
+ executor.setupRequest( req, null, "-gs custom-settings.xml" );
+ assertEquals( "custom-settings.xml", req.getGlobalSettingsFile().getPath() );
+
+ req = new DefaultInvocationRequest();
+ executor.setupRequest( req, null, "--global-settings other-settings.xml" );
+ assertEquals( "other-settings.xml", req.getGlobalSettingsFile().getPath() );
+ }
+}
Propchange: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/exec/InvokerMavenExecutorTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhaseTest.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhaseTest.java?rev=1531451&r1=1531450&r2=1531451&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhaseTest.java (original)
+++ maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhaseTest.java Fri Oct 11 22:18:49 2013
@@ -1,98 +1,98 @@
-package org.apache.maven.shared.release.phase;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.util.List;
-
-import org.apache.maven.model.Model;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.shared.release.config.ReleaseDescriptor;
-import org.junit.Test;
-
-public class AbstractScmCommitPhaseTest
-{
- @Test
- public void testDefaultCreatePomFiles()
- throws Exception
- {
- List<File> files =
- AbstractScmCommitPhase.createPomFiles( new ReleaseDescriptor(),
- createProject( "artifactId", "1.0-SNAPSHOT", new File( "pom.xml" ) ) );
- assertEquals( "Number of created files", files.size(), 1 );
- assertTrue( files.contains( new File( "pom.xml" ) ) );
- }
-
-
- @Test
- public void testCreatePomFilesSuppressCommitBeforeTag()
- throws Exception
- {
- ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
- releaseDescriptor.setSuppressCommitBeforeTagOrBranch( true );
- List<File> files =
- AbstractScmCommitPhase.createPomFiles( releaseDescriptor,
- createProject( "artifactId", "1.0-SNAPSHOT", new File( "pom.xml" ) ) );
- assertEquals( "Number of created files", files.size(), 1 );
- assertTrue( files.contains( new File( "pom.xml" ) ) );
- }
-
- @Test
- public void testCreatePomFilesWithReleasePom()
- throws Exception
- {
- ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
- releaseDescriptor.setGenerateReleasePoms( true );
- List<File> files =
- AbstractScmCommitPhase.createPomFiles( releaseDescriptor,
- createProject( "artifactId", "1.0-SNAPSHOT", new File( "pom.xml" ) ) );
- assertEquals( "Number of created files", files.size(), 2 );
- assertTrue( files.contains( new File( "pom.xml" ) ) );
- assertTrue( files.contains( new File( "release-pom.xml" ) ) );
- }
-
- @Test
- public void testCreatePomFilesWithReleasePomAndSuppressCommitBeforeTag()
- throws Exception
- {
- ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
- releaseDescriptor.setGenerateReleasePoms( true );
- releaseDescriptor.setSuppressCommitBeforeTagOrBranch( true );
- List<File> files =
- AbstractScmCommitPhase.createPomFiles( releaseDescriptor,
- createProject( "artifactId", "1.0-SNAPSHOT", new File( "pom.xml" ) ) );
- assertEquals( "Number of created files", files.size(), 1 );
- assertTrue( files.contains( new File( "pom.xml" ) ) );
- }
-
- private static MavenProject createProject( String artifactId, String version, File file )
- {
- Model model = new Model();
- model.setGroupId( "groupId" );
- model.setArtifactId( artifactId );
- model.setVersion( version );
- MavenProject project = new MavenProject( model );
- project.setFile( file );
- return project;
- }
-}
+package org.apache.maven.shared.release.phase;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.util.List;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.shared.release.config.ReleaseDescriptor;
+import org.junit.Test;
+
+public class AbstractScmCommitPhaseTest
+{
+ @Test
+ public void testDefaultCreatePomFiles()
+ throws Exception
+ {
+ List<File> files =
+ AbstractScmCommitPhase.createPomFiles( new ReleaseDescriptor(),
+ createProject( "artifactId", "1.0-SNAPSHOT", new File( "pom.xml" ) ) );
+ assertEquals( "Number of created files", files.size(), 1 );
+ assertTrue( files.contains( new File( "pom.xml" ) ) );
+ }
+
+
+ @Test
+ public void testCreatePomFilesSuppressCommitBeforeTag()
+ throws Exception
+ {
+ ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
+ releaseDescriptor.setSuppressCommitBeforeTagOrBranch( true );
+ List<File> files =
+ AbstractScmCommitPhase.createPomFiles( releaseDescriptor,
+ createProject( "artifactId", "1.0-SNAPSHOT", new File( "pom.xml" ) ) );
+ assertEquals( "Number of created files", files.size(), 1 );
+ assertTrue( files.contains( new File( "pom.xml" ) ) );
+ }
+
+ @Test
+ public void testCreatePomFilesWithReleasePom()
+ throws Exception
+ {
+ ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
+ releaseDescriptor.setGenerateReleasePoms( true );
+ List<File> files =
+ AbstractScmCommitPhase.createPomFiles( releaseDescriptor,
+ createProject( "artifactId", "1.0-SNAPSHOT", new File( "pom.xml" ) ) );
+ assertEquals( "Number of created files", files.size(), 2 );
+ assertTrue( files.contains( new File( "pom.xml" ) ) );
+ assertTrue( files.contains( new File( "release-pom.xml" ) ) );
+ }
+
+ @Test
+ public void testCreatePomFilesWithReleasePomAndSuppressCommitBeforeTag()
+ throws Exception
+ {
+ ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
+ releaseDescriptor.setGenerateReleasePoms( true );
+ releaseDescriptor.setSuppressCommitBeforeTagOrBranch( true );
+ List<File> files =
+ AbstractScmCommitPhase.createPomFiles( releaseDescriptor,
+ createProject( "artifactId", "1.0-SNAPSHOT", new File( "pom.xml" ) ) );
+ assertEquals( "Number of created files", files.size(), 1 );
+ assertTrue( files.contains( new File( "pom.xml" ) ) );
+ }
+
+ private static MavenProject createProject( String artifactId, String version, File file )
+ {
+ Model model = new Model();
+ model.setGroupId( "groupId" );
+ model.setArtifactId( artifactId );
+ model.setVersion( version );
+ MavenProject project = new MavenProject( model );
+ project.setFile( file );
+ return project;
+ }
+}
Propchange: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractScmCommitPhaseTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/IsScmBranchEquals.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/IsScmBranchEquals.java?rev=1531451&r1=1531450&r2=1531451&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/IsScmBranchEquals.java (original)
+++ maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/IsScmBranchEquals.java Fri Oct 11 22:18:49 2013
@@ -1,46 +1,46 @@
-package org.apache.maven.shared.release.phase;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.maven.scm.ScmBranch;
-import org.mockito.ArgumentMatcher;
-
-/**
- * JMock constraint to compare tags since it has no equals method.
- *
- * @author <a href="mailto:brett@apache.org">Brett Porter</a>
- */
-public class IsScmBranchEquals extends ArgumentMatcher<ScmBranch>
-{
- private final ScmBranch branch;
-
- public IsScmBranchEquals( ScmBranch branch )
- {
- this.branch = branch;
- }
-
- @Override
- public boolean matches( Object argument )
- {
- ScmBranch sb = (ScmBranch) argument;
-
- return sb.getName().equals( this.branch.getName() );
- }
+package org.apache.maven.shared.release.phase;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.scm.ScmBranch;
+import org.mockito.ArgumentMatcher;
+
+/**
+ * JMock constraint to compare tags since it has no equals method.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ */
+public class IsScmBranchEquals extends ArgumentMatcher<ScmBranch>
+{
+ private final ScmBranch branch;
+
+ public IsScmBranchEquals( ScmBranch branch )
+ {
+ this.branch = branch;
+ }
+
+ @Override
+ public boolean matches( Object argument )
+ {
+ ScmBranch sb = (ScmBranch) argument;
+
+ return sb.getName().equals( this.branch.getName() );
+ }
}
\ No newline at end of file
Propchange: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/IsScmBranchEquals.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/IsScmBranchParametersEquals.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/IsScmBranchParametersEquals.java?rev=1531451&r1=1531450&r2=1531451&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/IsScmBranchParametersEquals.java (original)
+++ maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/IsScmBranchParametersEquals.java Fri Oct 11 22:18:49 2013
@@ -1,46 +1,46 @@
-package org.apache.maven.shared.release.phase;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import org.apache.maven.scm.ScmBranchParameters;
-
-import org.mockito.ArgumentMatcher;
-
-/**
- * @author <a href="mailto:olamy@apache.org">olamy</a>
- */
-public class IsScmBranchParametersEquals extends ArgumentMatcher<ScmBranchParameters>
-{
- private final ScmBranchParameters scmBranchParameters;
-
- public IsScmBranchParametersEquals( ScmBranchParameters scmBranchParameters )
- {
- this.scmBranchParameters = scmBranchParameters;
- }
-
- @Override
- public boolean matches( Object argument )
- {
- ScmBranchParameters sbp = (ScmBranchParameters) argument;
- return sbp.getMessage().equals( this.scmBranchParameters.getMessage() )
- //&& stp.isRemoteTagging() == this.scmBranchParameters.isRemoteTagging()
- ;
- }
-}
+package org.apache.maven.shared.release.phase;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.scm.ScmBranchParameters;
+
+import org.mockito.ArgumentMatcher;
+
+/**
+ * @author <a href="mailto:olamy@apache.org">olamy</a>
+ */
+public class IsScmBranchParametersEquals extends ArgumentMatcher<ScmBranchParameters>
+{
+ private final ScmBranchParameters scmBranchParameters;
+
+ public IsScmBranchParametersEquals( ScmBranchParameters scmBranchParameters )
+ {
+ this.scmBranchParameters = scmBranchParameters;
+ }
+
+ @Override
+ public boolean matches( Object argument )
+ {
+ ScmBranchParameters sbp = (ScmBranchParameters) argument;
+ return sbp.getMessage().equals( this.scmBranchParameters.getMessage() )
+ //&& stp.isRemoteTagging() == this.scmBranchParameters.isRemoteTagging()
+ ;
+ }
+}
Propchange: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/IsScmBranchParametersEquals.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/MapDevelopmentVersionPhaseIT.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/MapDevelopmentVersionPhaseIT.java?rev=1531451&r1=1531450&r2=1531451&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/MapDevelopmentVersionPhaseIT.java (original)
+++ maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/MapDevelopmentVersionPhaseIT.java Fri Oct 11 22:18:49 2013
@@ -1,74 +1,74 @@
-package org.apache.maven.shared.release.phase;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.InputStream;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.maven.model.Model;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.shared.release.ReleaseResult;
-import org.apache.maven.shared.release.config.ReleaseDescriptor;
-import org.apache.maven.shared.release.env.DefaultReleaseEnvironment;
-import org.apache.maven.shared.release.env.ReleaseEnvironment;
-import org.codehaus.plexus.PlexusTestCase;
-
-public class MapDevelopmentVersionPhaseIT
- extends PlexusTestCase
-{
- private MapVersionsPhase mapVersionsPhase;
-
- @Override
- protected InputStream getCustomConfiguration()
- throws Exception
- {
- return MapVersionsPhase.class.getResourceAsStream( "/META-INF/plexus/components.xml" );
- }
-
- @Override
- protected void setUp()
- throws Exception
- {
- super.setUp();
- mapVersionsPhase = (MapVersionsPhase) lookup( ReleasePhase.class.getName(), "map-development-versions" );
- }
-
- private static MavenProject createProject( String artifactId, String version )
- {
- Model model = new Model();
- model.setGroupId( "groupId" );
- model.setArtifactId( artifactId );
- model.setVersion( version );
- return new MavenProject( model );
- }
-
- public void testNoUpdateWorkingCopyVersions() throws Exception
- {
- ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
- releaseDescriptor.setInteractive( false );
- releaseDescriptor.setUpdateWorkingCopyVersions( false );
-
- List<MavenProject> reactorProjects = Collections.singletonList( createProject( "artifactId", "1.0" ) );
- mapVersionsPhase.execute( releaseDescriptor, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertEquals( "1.0", releaseDescriptor.getDevelopmentVersions().get( "groupId:artifactId" ) );
- }
-}
+package org.apache.maven.shared.release.phase;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.maven.model.Model;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.shared.release.ReleaseResult;
+import org.apache.maven.shared.release.config.ReleaseDescriptor;
+import org.apache.maven.shared.release.env.DefaultReleaseEnvironment;
+import org.apache.maven.shared.release.env.ReleaseEnvironment;
+import org.codehaus.plexus.PlexusTestCase;
+
+public class MapDevelopmentVersionPhaseIT
+ extends PlexusTestCase
+{
+ private MapVersionsPhase mapVersionsPhase;
+
+ @Override
+ protected InputStream getCustomConfiguration()
+ throws Exception
+ {
+ return MapVersionsPhase.class.getResourceAsStream( "/META-INF/plexus/components.xml" );
+ }
+
+ @Override
+ protected void setUp()
+ throws Exception
+ {
+ super.setUp();
+ mapVersionsPhase = (MapVersionsPhase) lookup( ReleasePhase.class.getName(), "map-development-versions" );
+ }
+
+ private static MavenProject createProject( String artifactId, String version )
+ {
+ Model model = new Model();
+ model.setGroupId( "groupId" );
+ model.setArtifactId( artifactId );
+ model.setVersion( version );
+ return new MavenProject( model );
+ }
+
+ public void testNoUpdateWorkingCopyVersions() throws Exception
+ {
+ ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
+ releaseDescriptor.setInteractive( false );
+ releaseDescriptor.setUpdateWorkingCopyVersions( false );
+
+ List<MavenProject> reactorProjects = Collections.singletonList( createProject( "artifactId", "1.0" ) );
+ mapVersionsPhase.execute( releaseDescriptor, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertEquals( "1.0", releaseDescriptor.getDevelopmentVersions().get( "groupId:artifactId" ) );
+ }
+}
Propchange: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/MapDevelopmentVersionPhaseIT.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhaseTest.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhaseTest.java?rev=1531451&r1=1531450&r2=1531451&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhaseTest.java (original)
+++ maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhaseTest.java Fri Oct 11 22:18:49 2013
@@ -1,430 +1,430 @@
-package org.apache.maven.shared.release.phase;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.shared.release.config.ReleaseDescriptor;
-import org.apache.maven.shared.release.env.DefaultReleaseEnvironment;
-import org.apache.maven.shared.release.util.ReleaseUtil;
-
-/**
- * Test the SCM modification check phase.
- *
- * @author <a href="mailto:brett@apache.org">Brett Porter</a>
- */
-public class RewritePomsForBranchPhaseTest
- extends AbstractEditModeRewritingReleasePhaseTestCase
-{
- private static final String NEXT_VERSION = "1.0-SNAPSHOT";
-
- private static final String ALTERNATIVE_NEXT_VERSION = "2.0-SNAPSHOT";
-
- protected void setUp()
- throws Exception
- {
- super.setUp();
-
- phase = (ReleasePhase) lookup( ReleasePhase.ROLE, "rewrite-poms-for-branch" );
- }
-
- protected List<MavenProject> prepareReactorProjects( String path, boolean copyFiles )
- throws Exception
- {
- return createReactorProjects( "rewrite-for-branch/", path );
- }
-
- protected String readTestProjectFile( String fileName )
- throws IOException
- {
- return ReleaseUtil.readXmlFile( getTestFile( "target/test-classes/projects/rewrite-for-branch/" + fileName ) );
- }
-
- public void testSimulateRewrite()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjectsFromBasicPom();
- ReleaseDescriptor config = createDescriptorFromBasicPom( reactorProjects );
- config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
-
- String expected = readTestProjectFile( "basic-pom/pom.xml" );
-
- phase.simulate( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- String actual = readTestProjectFile( "basic-pom/pom.xml" );
- assertEquals( "Check the original POM untouched", expected, actual );
-
- expected = readTestProjectFile( "basic-pom/expected-pom.xml" );
- actual = readTestProjectFile( "basic-pom/pom.xml.branch" );
- assertEquals( "Check the transformed POM", expected, actual );
- }
-
- public void testRewriteWithDashedComments()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjects("basic-pom-with-dashes-in-comment");
- ReleaseDescriptor config = createDescriptorFromBasicPom( reactorProjects );
- config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
-
- String expected = readTestProjectFile( "basic-pom-with-dashes-in-comment/pom.xml" );
-
- phase.simulate( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- String actual = readTestProjectFile( "basic-pom-with-dashes-in-comment/pom.xml" );
- assertEquals( "Check the original POM is untouched", expected, actual );
-
- expected = readTestProjectFile( "basic-pom-with-dashes-in-comment/expected-pom.xml" );
- actual = readTestProjectFile( "basic-pom-with-dashes-in-comment/pom.xml.branch" );
- assertEquals( "Check the transformed POM", expected, actual );
- }
-
- public void testClean()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjectsFromBasicPom();
- ReleaseDescriptor config = createDescriptorFromBasicPom( reactorProjects );
- config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
-
- File testFile = getTestFile( "target/test-classes/projects/rewrite-for-branch/basic-pom/pom.xml.branch" );
- testFile.delete();
- assertFalse( testFile.exists() );
-
- phase.simulate( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( testFile.exists() );
-
- phase.clean( reactorProjects );
-
- assertFalse( testFile.exists() );
- }
-
- public void testCleanNotExists()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjectsFromBasicPom();
- ReleaseDescriptor config = createDescriptorFromBasicPom( reactorProjects );
- config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
-
- File testFile = getTestFile( "target/test-classes/projects/rewrite-for-branch/basic-pom/pom.xml.branch" );
- testFile.delete();
- assertFalse( testFile.exists() );
-
- phase.clean( reactorProjects );
-
- assertFalse( testFile.exists() );
- }
-
- //MRELEASE-116
- public void testScmOverridden()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjects( "pom-with-overridden-scm" );
- ReleaseDescriptor config = createConfigurationForWithParentNextVersion( reactorProjects );
- config.mapReleaseVersion( "groupId:subsubproject", NEXT_VERSION );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( comparePomFiles( reactorProjects ) );
- }
-
- protected void mapAlternateNextVersion( ReleaseDescriptor config, String projectId )
- {
- config.mapReleaseVersion( projectId, ALTERNATIVE_NEXT_VERSION );
- }
-
- protected void mapNextVersion( ReleaseDescriptor config, String projectId )
- {
- config.mapReleaseVersion( projectId, NEXT_VERSION );
- }
-
- protected ReleaseDescriptor createConfigurationForPomWithParentAlternateNextVersion( List<MavenProject> reactorProjects )
- throws Exception
- {
- ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
-
- config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
- config.mapReleaseVersion( "groupId:subproject1", ALTERNATIVE_NEXT_VERSION );
- return config;
- }
-
- protected ReleaseDescriptor createConfigurationForWithParentNextVersion( List<MavenProject> reactorProjects )
- throws Exception
- {
- ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
-
- config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
- config.mapReleaseVersion( "groupId:subproject1", NEXT_VERSION );
- return config;
- }
-
- protected void unmapNextVersion( ReleaseDescriptor config, String projectId )
- {
- // nothing to do
- }
-
- public void testRewriteBasicPomWithCvs()
- throws Exception
- {
-
- List<MavenProject> reactorProjects = createReactorProjects( "basic-pom-with-cvs" );
- ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
- mapNextVersion( config, "groupId:artifactId" );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( comparePomFiles( reactorProjects ) );
- }
-
- public void testRewriteBasicPomWithScmExpression()
- throws Exception
- {
-
- List<MavenProject> reactorProjects = createReactorProjects( "basic-pom-with-scm-expression" );
- ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
- mapNextVersion( config, "groupId:artifactId" );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( comparePomFiles( reactorProjects ) );
- }
-
- public void testRewriteBasicPomWithTagBase()
- throws Exception
- {
-
- List<MavenProject> reactorProjects = createReactorProjects( "basic-pom-with-tag-base" );
- ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
- config.setScmBranchBase( "file://localhost/tmp/scm-repo/branches" );
- mapNextVersion( config, "groupId:artifactId" );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( comparePomFiles( reactorProjects ) );
- }
-
- public void testRewriteBasicPomWithTagBaseAndVaryingScmUrls()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjects( "basic-pom-with-tag-base-and-varying-scm-urls" );
- ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
- config.setScmBranchBase( "file://localhost/tmp/scm-repo/allprojects/branches" );
- mapNextVersion( config, "groupId:artifactId" );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( comparePomFiles( reactorProjects ) );
- }
-
- public void testRewriteBasicPomWithCvsFromTag()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjects( "basic-pom-with-cvs-from-tag" );
- ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
- mapNextVersion( config, "groupId:artifactId" );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( comparePomFiles( reactorProjects ) );
- }
-
- public void testRewriteBasicPomWithEmptyScm()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjects( "basic-pom-with-empty-scm" );
- ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
- mapNextVersion( config, "groupId:artifactId" );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( comparePomFiles( reactorProjects ) );
- }
-
- public void testRewriteInterpolatedVersions()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjects( "interpolated-versions" );
- ReleaseDescriptor config = createMappedConfiguration( reactorProjects );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( comparePomFiles( reactorProjects ) );
- }
-
- public void testRewriteInterpolatedVersionsDifferentVersion()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjects( "interpolated-versions" );
- ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
-
- config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
- config.mapReleaseVersion( "groupId:subproject1", ALTERNATIVE_NEXT_VERSION );
- config.mapReleaseVersion( "groupId:subproject2", NEXT_VERSION );
- config.mapReleaseVersion( "groupId:subproject3", NEXT_VERSION );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- for ( Iterator<MavenProject> i = reactorProjects.iterator(); i.hasNext(); )
- {
- MavenProject project = i.next();
-
- // skip subproject1 - we don't need to worry about its version mapping change, it has no deps of any kind
- if ( !"groupId".equals( project.getGroupId() ) || !"subproject1".equals( project.getArtifactId() ) )
- {
- comparePomFiles( project, "-different-version", true );
- }
- }
- }
-
- public void testRewriteBasicPomWithInheritedScm()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjects( "basic-pom-inherited-scm" );
- ReleaseDescriptor config = createConfigurationForWithParentNextVersion( reactorProjects );
- config.mapReleaseVersion( "groupId:subsubproject", NEXT_VERSION );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( comparePomFiles( reactorProjects ) );
- }
-
- public void testRewritePomWithParentAndProperties()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjects( "pom-with-parent-and-properties" );
-
- ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
- config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
- config.mapReleaseVersion( "groupId:subproject1", ALTERNATIVE_NEXT_VERSION );
- config.mapReleaseVersion( "groupId:subproject2", ALTERNATIVE_NEXT_VERSION );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( comparePomFiles( reactorProjects ) );
- }
-
- // MRELEASE-311
- public void testRewritePomWithDependencyPropertyCoordinate()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjects( "pom-with-property-dependency-coordinate" );
-
- ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
- config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
- config.mapReleaseVersion( "groupId:subproject1-3.4", ALTERNATIVE_NEXT_VERSION );
- config.mapReleaseVersion( "groupId:subproject2", ALTERNATIVE_NEXT_VERSION );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( comparePomFiles( reactorProjects ) );
- }
-
- // MRELEASE-305
- public void testRewritePomWithScmOfParentEndingWithASlash()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjects( "pom-with-scm-of-parent-ending-with-a-slash" );
-
- ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
- config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
- config.mapReleaseVersion( "groupId:subproject1", ALTERNATIVE_NEXT_VERSION );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( comparePomFiles( reactorProjects ) );
- }
-
- public void testRewritePomWithDeepSubprojects()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjects( "multimodule-with-deep-subprojects" );
-
- ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
- config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
- config.mapReleaseVersion( "groupId:subproject1", ALTERNATIVE_NEXT_VERSION );
- config.mapReleaseVersion( "groupId:subproject2", ALTERNATIVE_NEXT_VERSION );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( comparePomFiles( reactorProjects ) );
- }
-
- public void testRewritePomForFlatMultiModule()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjects( "rewrite-for-branch/pom-with-parent-flat", "/root-project" );
- ReleaseDescriptor config = createConfigurationForPomWithParentAlternateNextVersion( reactorProjects );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( comparePomFiles( reactorProjects ) );
- }
-
- // MRELEASE-383
- public void testRewritePomWithCDATASectionOnWindows()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjects( "cdata-section" );
- ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
- mapNextVersion( config, "groupId:artifactId" );
-
- AbstractRewritePomsPhase phase = (AbstractRewritePomsPhase) this.phase;
- phase.setLs( "\r\n" );
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- // compare POMS without line ending normalization
- assertTrue( comparePomFiles( reactorProjects, false ) );
- }
-
- protected ReleaseDescriptor createDescriptorFromProjects( List<MavenProject> reactorProjects )
- {
- ReleaseDescriptor descriptor = super.createDescriptorFromProjects( reactorProjects );
- descriptor.setScmReleaseLabel( "release-label" );
- return descriptor;
- }
-
- // MRELEASE-454
- public void testRewritePomWithImportedDependencyManagementInReactor()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjects( "imported-dependency-management-in-reactor" );
- ReleaseDescriptor config = createMappedConfiguration( reactorProjects );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( comparePomFiles( reactorProjects ) );
- }
-
- public void testRewritePomWithDifferentVersionsAcrossModules()
- throws Exception
- {
- List<MavenProject> reactorProjects = createReactorProjects( "modules-with-different-versions" );
- ReleaseDescriptor config = createMappedConfiguration( reactorProjects );
- config.mapReleaseVersion( "groupId:subproject2", ALTERNATIVE_NEXT_VERSION );
-
- phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
-
- assertTrue( comparePomFiles( reactorProjects ) );
- }
-
-}
+package org.apache.maven.shared.release.phase;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.shared.release.config.ReleaseDescriptor;
+import org.apache.maven.shared.release.env.DefaultReleaseEnvironment;
+import org.apache.maven.shared.release.util.ReleaseUtil;
+
+/**
+ * Test the SCM modification check phase.
+ *
+ * @author <a href="mailto:brett@apache.org">Brett Porter</a>
+ */
+public class RewritePomsForBranchPhaseTest
+ extends AbstractEditModeRewritingReleasePhaseTestCase
+{
+ private static final String NEXT_VERSION = "1.0-SNAPSHOT";
+
+ private static final String ALTERNATIVE_NEXT_VERSION = "2.0-SNAPSHOT";
+
+ protected void setUp()
+ throws Exception
+ {
+ super.setUp();
+
+ phase = (ReleasePhase) lookup( ReleasePhase.ROLE, "rewrite-poms-for-branch" );
+ }
+
+ protected List<MavenProject> prepareReactorProjects( String path, boolean copyFiles )
+ throws Exception
+ {
+ return createReactorProjects( "rewrite-for-branch/", path );
+ }
+
+ protected String readTestProjectFile( String fileName )
+ throws IOException
+ {
+ return ReleaseUtil.readXmlFile( getTestFile( "target/test-classes/projects/rewrite-for-branch/" + fileName ) );
+ }
+
+ public void testSimulateRewrite()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjectsFromBasicPom();
+ ReleaseDescriptor config = createDescriptorFromBasicPom( reactorProjects );
+ config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
+
+ String expected = readTestProjectFile( "basic-pom/pom.xml" );
+
+ phase.simulate( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ String actual = readTestProjectFile( "basic-pom/pom.xml" );
+ assertEquals( "Check the original POM untouched", expected, actual );
+
+ expected = readTestProjectFile( "basic-pom/expected-pom.xml" );
+ actual = readTestProjectFile( "basic-pom/pom.xml.branch" );
+ assertEquals( "Check the transformed POM", expected, actual );
+ }
+
+ public void testRewriteWithDashedComments()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjects("basic-pom-with-dashes-in-comment");
+ ReleaseDescriptor config = createDescriptorFromBasicPom( reactorProjects );
+ config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
+
+ String expected = readTestProjectFile( "basic-pom-with-dashes-in-comment/pom.xml" );
+
+ phase.simulate( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ String actual = readTestProjectFile( "basic-pom-with-dashes-in-comment/pom.xml" );
+ assertEquals( "Check the original POM is untouched", expected, actual );
+
+ expected = readTestProjectFile( "basic-pom-with-dashes-in-comment/expected-pom.xml" );
+ actual = readTestProjectFile( "basic-pom-with-dashes-in-comment/pom.xml.branch" );
+ assertEquals( "Check the transformed POM", expected, actual );
+ }
+
+ public void testClean()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjectsFromBasicPom();
+ ReleaseDescriptor config = createDescriptorFromBasicPom( reactorProjects );
+ config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
+
+ File testFile = getTestFile( "target/test-classes/projects/rewrite-for-branch/basic-pom/pom.xml.branch" );
+ testFile.delete();
+ assertFalse( testFile.exists() );
+
+ phase.simulate( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( testFile.exists() );
+
+ phase.clean( reactorProjects );
+
+ assertFalse( testFile.exists() );
+ }
+
+ public void testCleanNotExists()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjectsFromBasicPom();
+ ReleaseDescriptor config = createDescriptorFromBasicPom( reactorProjects );
+ config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
+
+ File testFile = getTestFile( "target/test-classes/projects/rewrite-for-branch/basic-pom/pom.xml.branch" );
+ testFile.delete();
+ assertFalse( testFile.exists() );
+
+ phase.clean( reactorProjects );
+
+ assertFalse( testFile.exists() );
+ }
+
+ //MRELEASE-116
+ public void testScmOverridden()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjects( "pom-with-overridden-scm" );
+ ReleaseDescriptor config = createConfigurationForWithParentNextVersion( reactorProjects );
+ config.mapReleaseVersion( "groupId:subsubproject", NEXT_VERSION );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( comparePomFiles( reactorProjects ) );
+ }
+
+ protected void mapAlternateNextVersion( ReleaseDescriptor config, String projectId )
+ {
+ config.mapReleaseVersion( projectId, ALTERNATIVE_NEXT_VERSION );
+ }
+
+ protected void mapNextVersion( ReleaseDescriptor config, String projectId )
+ {
+ config.mapReleaseVersion( projectId, NEXT_VERSION );
+ }
+
+ protected ReleaseDescriptor createConfigurationForPomWithParentAlternateNextVersion( List<MavenProject> reactorProjects )
+ throws Exception
+ {
+ ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
+
+ config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
+ config.mapReleaseVersion( "groupId:subproject1", ALTERNATIVE_NEXT_VERSION );
+ return config;
+ }
+
+ protected ReleaseDescriptor createConfigurationForWithParentNextVersion( List<MavenProject> reactorProjects )
+ throws Exception
+ {
+ ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
+
+ config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
+ config.mapReleaseVersion( "groupId:subproject1", NEXT_VERSION );
+ return config;
+ }
+
+ protected void unmapNextVersion( ReleaseDescriptor config, String projectId )
+ {
+ // nothing to do
+ }
+
+ public void testRewriteBasicPomWithCvs()
+ throws Exception
+ {
+
+ List<MavenProject> reactorProjects = createReactorProjects( "basic-pom-with-cvs" );
+ ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
+ mapNextVersion( config, "groupId:artifactId" );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( comparePomFiles( reactorProjects ) );
+ }
+
+ public void testRewriteBasicPomWithScmExpression()
+ throws Exception
+ {
+
+ List<MavenProject> reactorProjects = createReactorProjects( "basic-pom-with-scm-expression" );
+ ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
+ mapNextVersion( config, "groupId:artifactId" );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( comparePomFiles( reactorProjects ) );
+ }
+
+ public void testRewriteBasicPomWithTagBase()
+ throws Exception
+ {
+
+ List<MavenProject> reactorProjects = createReactorProjects( "basic-pom-with-tag-base" );
+ ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
+ config.setScmBranchBase( "file://localhost/tmp/scm-repo/branches" );
+ mapNextVersion( config, "groupId:artifactId" );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( comparePomFiles( reactorProjects ) );
+ }
+
+ public void testRewriteBasicPomWithTagBaseAndVaryingScmUrls()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjects( "basic-pom-with-tag-base-and-varying-scm-urls" );
+ ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
+ config.setScmBranchBase( "file://localhost/tmp/scm-repo/allprojects/branches" );
+ mapNextVersion( config, "groupId:artifactId" );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( comparePomFiles( reactorProjects ) );
+ }
+
+ public void testRewriteBasicPomWithCvsFromTag()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjects( "basic-pom-with-cvs-from-tag" );
+ ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
+ mapNextVersion( config, "groupId:artifactId" );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( comparePomFiles( reactorProjects ) );
+ }
+
+ public void testRewriteBasicPomWithEmptyScm()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjects( "basic-pom-with-empty-scm" );
+ ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
+ mapNextVersion( config, "groupId:artifactId" );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( comparePomFiles( reactorProjects ) );
+ }
+
+ public void testRewriteInterpolatedVersions()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjects( "interpolated-versions" );
+ ReleaseDescriptor config = createMappedConfiguration( reactorProjects );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( comparePomFiles( reactorProjects ) );
+ }
+
+ public void testRewriteInterpolatedVersionsDifferentVersion()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjects( "interpolated-versions" );
+ ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
+
+ config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
+ config.mapReleaseVersion( "groupId:subproject1", ALTERNATIVE_NEXT_VERSION );
+ config.mapReleaseVersion( "groupId:subproject2", NEXT_VERSION );
+ config.mapReleaseVersion( "groupId:subproject3", NEXT_VERSION );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ for ( Iterator<MavenProject> i = reactorProjects.iterator(); i.hasNext(); )
+ {
+ MavenProject project = i.next();
+
+ // skip subproject1 - we don't need to worry about its version mapping change, it has no deps of any kind
+ if ( !"groupId".equals( project.getGroupId() ) || !"subproject1".equals( project.getArtifactId() ) )
+ {
+ comparePomFiles( project, "-different-version", true );
+ }
+ }
+ }
+
+ public void testRewriteBasicPomWithInheritedScm()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjects( "basic-pom-inherited-scm" );
+ ReleaseDescriptor config = createConfigurationForWithParentNextVersion( reactorProjects );
+ config.mapReleaseVersion( "groupId:subsubproject", NEXT_VERSION );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( comparePomFiles( reactorProjects ) );
+ }
+
+ public void testRewritePomWithParentAndProperties()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjects( "pom-with-parent-and-properties" );
+
+ ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
+ config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
+ config.mapReleaseVersion( "groupId:subproject1", ALTERNATIVE_NEXT_VERSION );
+ config.mapReleaseVersion( "groupId:subproject2", ALTERNATIVE_NEXT_VERSION );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( comparePomFiles( reactorProjects ) );
+ }
+
+ // MRELEASE-311
+ public void testRewritePomWithDependencyPropertyCoordinate()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjects( "pom-with-property-dependency-coordinate" );
+
+ ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
+ config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
+ config.mapReleaseVersion( "groupId:subproject1-3.4", ALTERNATIVE_NEXT_VERSION );
+ config.mapReleaseVersion( "groupId:subproject2", ALTERNATIVE_NEXT_VERSION );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( comparePomFiles( reactorProjects ) );
+ }
+
+ // MRELEASE-305
+ public void testRewritePomWithScmOfParentEndingWithASlash()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjects( "pom-with-scm-of-parent-ending-with-a-slash" );
+
+ ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
+ config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
+ config.mapReleaseVersion( "groupId:subproject1", ALTERNATIVE_NEXT_VERSION );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( comparePomFiles( reactorProjects ) );
+ }
+
+ public void testRewritePomWithDeepSubprojects()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjects( "multimodule-with-deep-subprojects" );
+
+ ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
+ config.mapReleaseVersion( "groupId:artifactId", NEXT_VERSION );
+ config.mapReleaseVersion( "groupId:subproject1", ALTERNATIVE_NEXT_VERSION );
+ config.mapReleaseVersion( "groupId:subproject2", ALTERNATIVE_NEXT_VERSION );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( comparePomFiles( reactorProjects ) );
+ }
+
+ public void testRewritePomForFlatMultiModule()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjects( "rewrite-for-branch/pom-with-parent-flat", "/root-project" );
+ ReleaseDescriptor config = createConfigurationForPomWithParentAlternateNextVersion( reactorProjects );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( comparePomFiles( reactorProjects ) );
+ }
+
+ // MRELEASE-383
+ public void testRewritePomWithCDATASectionOnWindows()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjects( "cdata-section" );
+ ReleaseDescriptor config = createDescriptorFromProjects( reactorProjects );
+ mapNextVersion( config, "groupId:artifactId" );
+
+ AbstractRewritePomsPhase phase = (AbstractRewritePomsPhase) this.phase;
+ phase.setLs( "\r\n" );
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ // compare POMS without line ending normalization
+ assertTrue( comparePomFiles( reactorProjects, false ) );
+ }
+
+ protected ReleaseDescriptor createDescriptorFromProjects( List<MavenProject> reactorProjects )
+ {
+ ReleaseDescriptor descriptor = super.createDescriptorFromProjects( reactorProjects );
+ descriptor.setScmReleaseLabel( "release-label" );
+ return descriptor;
+ }
+
+ // MRELEASE-454
+ public void testRewritePomWithImportedDependencyManagementInReactor()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjects( "imported-dependency-management-in-reactor" );
+ ReleaseDescriptor config = createMappedConfiguration( reactorProjects );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( comparePomFiles( reactorProjects ) );
+ }
+
+ public void testRewritePomWithDifferentVersionsAcrossModules()
+ throws Exception
+ {
+ List<MavenProject> reactorProjects = createReactorProjects( "modules-with-different-versions" );
+ ReleaseDescriptor config = createMappedConfiguration( reactorProjects );
+ config.mapReleaseVersion( "groupId:subproject2", ALTERNATIVE_NEXT_VERSION );
+
+ phase.execute( config, new DefaultReleaseEnvironment(), reactorProjects );
+
+ assertTrue( comparePomFiles( reactorProjects ) );
+ }
+
+}
Propchange: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhaseTest.java
------------------------------------------------------------------------------
svn:eol-style = native