maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject svn commit: r1359392 - /maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/MapVersionsPhaseTest.java
Date Mon, 09 Jul 2012 21:03:12 GMT
Author: rfscholte
Date: Mon Jul  9 21:03:12 2012
New Revision: 1359392

URL: http://svn.apache.org/viewvc?rev=1359392&view=rev
Log:
Coverage tests for dev-mapping and non-branchCreation

Modified:
    maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/MapVersionsPhaseTest.java

Modified: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/MapVersionsPhaseTest.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/MapVersionsPhaseTest.java?rev=1359392&r1=1359391&r2=1359392&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/MapVersionsPhaseTest.java
(original)
+++ maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/MapVersionsPhaseTest.java
Mon Jul  9 21:03:12 2012
@@ -658,6 +658,127 @@ public class MapVersionsPhaseTest
                       releaseDescriptor.getDevelopmentVersions() );
     }
 
+    
+    public void testExecuteSnapshotDefaultDevelopmentVersion_MapDevelopment()
+        throws Exception
+    {
+        // prepare
+        MapVersionsPhase phase = (MapVersionsPhase) lookup( ReleasePhase.ROLE, "test-map-development-versions"
);
+
+        List<MavenProject> reactorProjects = Collections.singletonList( createProject(
"artifactId", "1.2-SNAPSHOT" ) );
+
+        ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
+        releaseDescriptor.setDefaultDevelopmentVersion( "1.1.1-SNAPSHOT" );
+
+        // test
+        phase.execute( releaseDescriptor, new DefaultReleaseEnvironment(), reactorProjects
);
+
+        // verify
+        assertNull( "Check release versions", releaseDescriptor.getReleaseVersions().get(
"groupId:artifactId" ) );
+        assertEquals( "Check development versions", Collections.singletonMap( "groupId:artifactId",
"1.1.1-SNAPSHOT" ), releaseDescriptor.getDevelopmentVersions() );
+    }
+
+    public void testSimulateSnapshotDefaultDevelopmentVersion_MapDevelopment()
+        throws Exception
+    {
+        // prepare
+        MapVersionsPhase phase = (MapVersionsPhase) lookup( ReleasePhase.ROLE, "test-map-development-versions"
);
+
+        List<MavenProject> reactorProjects = Collections.singletonList( createProject(
"artifactId", "1.2-SNAPSHOT" ) );
+
+        ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
+        releaseDescriptor.setDefaultDevelopmentVersion( "1.1.1-SNAPSHOT" );
+
+        // test
+        phase.simulate( releaseDescriptor, new DefaultReleaseEnvironment(), reactorProjects
);
+
+        // verify
+        assertNull( "Check release versions", releaseDescriptor.getReleaseVersions().get(
"groupId:artifactId" ) );
+        assertEquals( "Check development versions", Collections.singletonMap( "groupId:artifactId",
"1.1.1-SNAPSHOT" ), releaseDescriptor.getDevelopmentVersions() );
+    }
+    
+    public void testExecuteSnapshotDefaultDevelopmentVersion_NonInteractive_MapDevelopment()
+        throws Exception
+    {
+        // prepare
+        MapVersionsPhase phase = (MapVersionsPhase) lookup( ReleasePhase.ROLE, "test-map-development-versions"
);
+
+        List<MavenProject> reactorProjects = Collections.singletonList( createProject(
"artifactId", "1.2-SNAPSHOT" ) );
+
+        ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
+        releaseDescriptor.setDefaultDevelopmentVersion( "1.1.1-SNAPSHOT" );
+        releaseDescriptor.setInteractive( false );
+
+        // test
+        phase.execute( releaseDescriptor, new DefaultReleaseEnvironment(), reactorProjects
);
+
+        // verify
+        assertNull( "Check release versions", releaseDescriptor.getReleaseVersions().get(
"groupId:artifactId" ) );
+        assertEquals( "Check development versions", Collections.singletonMap( "groupId:artifactId",
"1.1.1-SNAPSHOT" ),
+                      releaseDescriptor.getDevelopmentVersions() );
+    }
+
+    public void testSimulateSnapshotDefaultDevelopmentVersion_NonInteractive_MapDevelopment()
+        throws Exception
+    {
+        // prepare
+        MapVersionsPhase phase = (MapVersionsPhase) lookup( ReleasePhase.ROLE, "test-map-development-versions"
);
+
+        List<MavenProject> reactorProjects = Collections.singletonList( createProject(
"artifactId", "1.2-SNAPSHOT" ) );
+
+        ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
+        releaseDescriptor.setDefaultDevelopmentVersion( "1.1.1-SNAPSHOT" );
+        releaseDescriptor.setInteractive( false );
+
+        // test
+        phase.simulate( releaseDescriptor, new DefaultReleaseEnvironment(), reactorProjects
);
+
+        // verify
+        assertNull( "Check release versions", releaseDescriptor.getReleaseVersions().get(
"groupId:artifactId" ) );
+        assertEquals( "Check development versions", Collections.singletonMap( "groupId:artifactId",
"1.1.1-SNAPSHOT" ),
+                      releaseDescriptor.getDevelopmentVersions() );
+    }
+    
+    public void testExecuteSnapshotNonInteractive_MapDevelopment()
+        throws Exception
+    {
+        // prepare
+        MapVersionsPhase phase = (MapVersionsPhase) lookup( ReleasePhase.ROLE, "test-map-development-versions"
);
+
+        List<MavenProject> reactorProjects = Collections.singletonList( createProject(
"artifactId", "1.2-SNAPSHOT" ) );
+
+        ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
+        releaseDescriptor.setInteractive( false );
+
+        // test
+        phase.execute( releaseDescriptor, new DefaultReleaseEnvironment(), reactorProjects
);
+
+        // verify
+        assertNull( "Check release versions", releaseDescriptor.getReleaseVersions().get(
"groupId:artifactId" ) );
+        assertEquals( "Check development versions", Collections.singletonMap( "groupId:artifactId",
"1.3-SNAPSHOT" ),
+                      releaseDescriptor.getDevelopmentVersions() );
+    }
+
+    public void testSimulateSnapshotNonInteractive_MapDevelopment()
+        throws Exception
+    {
+        // prepare
+        MapVersionsPhase phase = (MapVersionsPhase) lookup( ReleasePhase.ROLE, "test-map-development-versions"
);
+
+        List<MavenProject> reactorProjects = Collections.singletonList( createProject(
"artifactId", "1.2-SNAPSHOT" ) );
+
+        ReleaseDescriptor releaseDescriptor = new ReleaseDescriptor();
+        releaseDescriptor.setInteractive( false );
+
+        // test
+        phase.simulate( releaseDescriptor, new DefaultReleaseEnvironment(), reactorProjects
);
+
+        // verify
+        assertNull( "Check release versions", releaseDescriptor.getReleaseVersions().get(
"groupId:artifactId" ) );
+        assertEquals( "Check development versions", Collections.singletonMap( "groupId:artifactId",
"1.3-SNAPSHOT" ),
+                      releaseDescriptor.getDevelopmentVersions() );
+    }
+
     public void testExecuteSnapshotAutoVersionSubmodules_NotInteractive_MapDevelopment()
         throws Exception
     {



Mime
View raw message