maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject svn commit: r1292006 - in /maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase: AbstractReleaseTestCase.java AbstractRewritingReleasePhaseTestCase.java
Date Tue, 21 Feb 2012 20:52:22 GMT
Author: rfscholte
Date: Tue Feb 21 20:52:21 2012
New Revision: 1292006

URL: http://svn.apache.org/viewvc?rev=1292006&view=rev
Log:
method to inline refactoring
add mock verification

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

Modified: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractReleaseTestCase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractReleaseTestCase.java?rev=1292006&r1=1292005&r2=1292006&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractReleaseTestCase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractReleaseTestCase.java
Tue Feb 21 20:52:21 2012
@@ -241,15 +241,6 @@ public abstract class AbstractReleaseTes
         return reactorProjects;
     }
 
-    protected void setMockScmManager( Mock scmManagerMock )
-        throws Exception
-    {
-        ScmManager scmManager = (ScmManager) scmManagerMock.proxy();
-        DefaultScmRepositoryConfigurator configurator =
-            (DefaultScmRepositoryConfigurator) lookup( ScmRepositoryConfigurator.ROLE );
-        configurator.setScmManager( scmManager );
-    }
-
     protected static Map<String,MavenProject> getProjectsAsMap( List<MavenProject>
reactorProjects )
     {
         Map<String,MavenProject> map = new HashMap<String,MavenProject>();

Modified: maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractRewritingReleasePhaseTestCase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractRewritingReleasePhaseTestCase.java?rev=1292006&r1=1292005&r2=1292006&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractRewritingReleasePhaseTestCase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractRewritingReleasePhaseTestCase.java
Tue Feb 21 20:52:21 2012
@@ -452,6 +452,8 @@ public abstract class AbstractRewritingR
 
         // Getting past mock is success
         assertTrue( true );
+        
+        scmProviderMock.verify();
     }
 
     public void testRewriteUnmappedPom()
@@ -484,7 +486,10 @@ public abstract class AbstractRewritingR
         scmManagerMock.expects( new InvokeAtLeastOnceMatcher() ).method( "makeScmRepository"
).with(
             new IsEqual( config.getScmSourceUrl() ) ).will( new ThrowStub( new ScmRepositoryException(
"..." ) ) );
 
-        setMockScmManager( scmManagerMock );
+        ScmManager scmManager = (ScmManager) scmManagerMock.proxy();
+        DefaultScmRepositoryConfigurator configurator =
+            (DefaultScmRepositoryConfigurator) lookup( ScmRepositoryConfigurator.ROLE );
+        configurator.setScmManager( scmManager );
 
         try
         {
@@ -496,6 +501,8 @@ public abstract class AbstractRewritingR
         {
             assertNull( "Check no additional cause", e.getCause() );
         }
+        
+        scmManagerMock.verify();
     }
 
     public void testRewriteBasicPomWithNoSuchProviderException()
@@ -510,7 +517,10 @@ public abstract class AbstractRewritingR
         scmManagerMock.expects( new InvokeAtLeastOnceMatcher() ).method( "makeScmRepository"
).with(
             new IsEqual( config.getScmSourceUrl() ) ).will( new ThrowStub( new NoSuchScmProviderException(
"..." ) ) );
 
-        setMockScmManager( scmManagerMock );
+        ScmManager scmManager = (ScmManager) scmManagerMock.proxy();
+        DefaultScmRepositoryConfigurator configurator =
+            (DefaultScmRepositoryConfigurator) lookup( ScmRepositoryConfigurator.ROLE );
+        configurator.setScmManager( scmManager );
 
         try
         {
@@ -522,6 +532,8 @@ public abstract class AbstractRewritingR
         {
             assertEquals( "Check cause", NoSuchScmProviderException.class, e.getCause().getClass()
);
         }
+        
+        scmManagerMock.verify();
     }
 
     public void testRewriteWhitespaceAroundValues()



Mime
View raw message