maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject [maven-release] 05/05: More Path replacements
Date Sun, 04 Mar 2018 19:17:56 GMT
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-release.git

commit 45cd37f5ef610f5f39c73d153c4ed481798e8ee8
Author: rfscholte <rfscholte@apache.org>
AuthorDate: Sun Mar 4 20:17:31 2018 +0100

    More Path replacements
---
 .../release/phase/CheckoutProjectFromScm.java      | 18 ++++++---------
 .../maven/shared/release/util/ReleaseUtil.java     |  6 -----
 .../shared/release/DefaultReleaseManagerTest.java  |  3 +--
 .../PropertiesReleaseDescriptorStoreTest.java      | 13 +++++------
 .../shared/release/config/ReleaseUtilsTest.java    |  5 ++--
 .../release/phase/AbstractReleaseTestCase.java     |  7 ------
 .../shared/release/phase/ScmBranchPhaseTest.java   | 27 ++++++++--------------
 .../shared/release/phase/ScmTagPhaseTest.java      | 27 ++++++++--------------
 8 files changed, 36 insertions(+), 70 deletions(-)

diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java
index 60f78b8..cbed6ea 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java
@@ -21,6 +21,7 @@ package org.apache.maven.shared.release.phase;
 
 import java.io.File;
 import java.io.IOException;
+import java.nio.file.Path;
 import java.util.List;
 
 import org.apache.maven.project.MavenProject;
@@ -221,10 +222,10 @@ public class CheckoutProjectFromScm
         String scmRelativePathProjectDirectory = scmResult.getRelativePathProjectDirectory();
         if ( StringUtils.isEmpty( scmRelativePathProjectDirectory ) )
         {
-            String basedir;
+            Path basedir;
             try
             {
-                basedir = ReleaseUtil.getCommonBasedir( reactorProjects ).toString();
+                basedir = ReleaseUtil.getCommonBasedir( reactorProjects );
             }
             catch ( IOException e )
             {
@@ -232,22 +233,17 @@ public class CheckoutProjectFromScm
                     + e.getMessage(), e );
             }
 
-            String rootProjectBasedir = rootProject.getBasedir().getAbsolutePath();
+            Path rootProjectBasedir;
             try
             {
-                if ( ReleaseUtil.isSymlink( rootProject.getBasedir() ) )
-                {
-                    rootProjectBasedir = rootProject.getBasedir().getCanonicalPath();
-                }
+                rootProjectBasedir = rootProject.getBasedir().toPath().toRealPath();
             }
             catch ( IOException e )
             {
                 throw new ReleaseExecutionException( e.getMessage(), e );
             }
-            if ( rootProjectBasedir.length() > basedir.length() )
-            {
-                scmRelativePathProjectDirectory = rootProjectBasedir.substring( basedir.length()
+ 1 );
-            }
+
+            scmRelativePathProjectDirectory = basedir.relativize( rootProjectBasedir ).toString();
         }
         releaseDescriptor.setScmRelativePathProjectDirectory( scmRelativePathProjectDirectory
);
 
diff --git a/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java
b/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java
index 587a50c..2afd545 100644
--- a/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java
+++ b/maven-release-manager/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java
@@ -243,12 +243,6 @@ public class ReleaseUtil
         return url;
     }
 
-    public static boolean isSymlink( File file )
-        throws IOException
-    {
-        return !file.getAbsolutePath().equals( file.getCanonicalPath() );
-    }
-
     public static String interpolate( String value, Model model )
         throws ReleaseExecutionException
     {
diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java
index 142d49b..11e7f83 100644
--- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java
+++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/DefaultReleaseManagerTest.java
@@ -690,9 +690,8 @@ public class DefaultReleaseManagerTest
 
             fail( "commit should have failed" );
         }
-        catch ( ReleaseScmCommandException e )
+        catch ( ReleaseExecutionException e )
         {
-            assertNull( "check no other cause", e.getCause() );
         }
     }
 
diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java
index 35903ce..394330e 100644
--- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java
+++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/PropertiesReleaseDescriptorStoreTest.java
@@ -21,7 +21,6 @@ import org.apache.maven.shared.release.config.ReleaseDescriptorBuilder.BuilderRe
  * under the License.
  */
 
-import org.apache.maven.shared.release.phase.AbstractReleaseTestCase;
 import org.apache.maven.shared.release.scm.IdentifiedScm;
 import org.codehaus.plexus.PlexusTestCase;
 import org.sonatype.plexus.components.sec.dispatcher.SecDispatcher;
@@ -66,7 +65,7 @@ public class PropertiesReleaseDescriptorStoreTest
         throws Exception
     {
         ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
-        builder.setWorkingDirectory( AbstractReleaseTestCase.getPath(  getTestFile( "target/test-classes"
) ) );
+        builder.setWorkingDirectory( getTestFile( "target/test-classes" ).getAbsolutePath()
);
         ReleaseDescriptor config = store.read( builder ).build();
 
         ReleaseDescriptorBuilder expected = createExpectedReleaseConfiguration();
@@ -145,12 +144,12 @@ public class PropertiesReleaseDescriptorStoreTest
         file.getParentFile().mkdirs();
 
         ReleaseDescriptorBuilder config = createReleaseConfigurationForWriting();
-        config.setWorkingDirectory( AbstractReleaseTestCase.getPath( file.getParentFile()
) );
+        config.setWorkingDirectory( file.getParentFile().getAbsolutePath() );
 
         store.write( config.build() );
 
         ReleaseDescriptorBuilder rereadDescriptorBuilder = store.read( file );
-        rereadDescriptorBuilder.setWorkingDirectory( AbstractReleaseTestCase.getPath( file.getParentFile()
) );
+        rereadDescriptorBuilder.setWorkingDirectory( file.getParentFile().getAbsolutePath()
);
 
         assertAndAdjustScmPassword( config, rereadDescriptorBuilder.build() );
         assertAndAdjustScmPrivateKeyPassPhrase( config, rereadDescriptorBuilder.build() );
@@ -258,7 +257,7 @@ public class PropertiesReleaseDescriptorStoreTest
         assertTrue( "Check file already exists", file.exists() );
 
         ReleaseDescriptorBuilder config = createReleaseConfigurationForWriting();
-        config.setWorkingDirectory( AbstractReleaseTestCase.getPath( file.getParentFile()
) );
+        config.setWorkingDirectory( file.getParentFile().getAbsolutePath() );
 
         store.delete( config.build() );
 
@@ -274,7 +273,7 @@ public class PropertiesReleaseDescriptorStoreTest
         assertFalse( "Check file already exists", file.exists() );
 
         ReleaseDescriptorBuilder config = createReleaseConfigurationForWriting();
-        config.setWorkingDirectory( AbstractReleaseTestCase.getPath( file.getParentFile()
) );
+        config.setWorkingDirectory( file.getParentFile().getAbsolutePath() );
 
         store.delete( config.build() );
 
@@ -359,7 +358,7 @@ public class PropertiesReleaseDescriptorStoreTest
         releaseDescriptor.setScmSourceUrl( "scm-url" );
         releaseDescriptor.setScmUsername( "username" );
         // Not setting other optional SCM settings for brevity
-        releaseDescriptor.setWorkingDirectory( AbstractReleaseTestCase.getPath( getTestFile(
"target/test-working-directory" ) ) );
+        releaseDescriptor.setWorkingDirectory( getTestFile( "target/test-working-directory"
).getAbsolutePath() );
         // Not setting non-override setting completedPhase
 
         return releaseDescriptor;
diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/ReleaseUtilsTest.java
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/ReleaseUtilsTest.java
index 4cff313..a8212da 100644
--- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/ReleaseUtilsTest.java
+++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/config/ReleaseUtilsTest.java
@@ -24,7 +24,6 @@ import junit.framework.TestCase;
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.model.Scm;
 import org.apache.maven.shared.release.config.ReleaseDescriptorBuilder.BuilderReleaseDescriptor;
-import org.apache.maven.shared.release.phase.AbstractReleaseTestCase;
 
 import java.io.File;
 import java.io.IOException;
@@ -134,7 +133,7 @@ public class ReleaseUtilsTest
 
         if ( otherFile != null )
         {
-            configBuilder.setWorkingDirectory( AbstractReleaseTestCase.getPath( otherFile
) );
+            configBuilder.setWorkingDirectory( otherFile.getAbsolutePath() );
             assertFalse( "Check original comparison", configBuilder.build().equals( origConfig
) );
         }
 
@@ -265,7 +264,7 @@ public class ReleaseUtilsTest
     {
         File workingDirectory = new File( "." );
 
-        return createReleaseDescriptor(AbstractReleaseTestCase.getPath( workingDirectory
) );
+        return createReleaseDescriptor( workingDirectory.getAbsolutePath() );
     }
 
     private static ReleaseDescriptorBuilder createReleaseDescriptor( String workingDirectory
)
diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractReleaseTestCase.java
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractReleaseTestCase.java
index 96eadcd..ed9cfd1 100644
--- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractReleaseTestCase.java
+++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/AbstractReleaseTestCase.java
@@ -58,7 +58,6 @@ import org.apache.maven.project.ProjectSorter;
 import org.apache.maven.repository.internal.MavenRepositorySystemSession;
 import org.apache.maven.shared.release.PlexusJUnit4TestCase;
 import org.apache.maven.shared.release.config.ReleaseDescriptorBuilder;
-import org.apache.maven.shared.release.util.ReleaseUtil;
 import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;
 import org.sonatype.aether.repository.WorkspaceReader;
 import org.sonatype.aether.repository.WorkspaceRepository;
@@ -336,12 +335,6 @@ public abstract class AbstractReleaseTestCase
         return "file://" + getTestFile( "src/test/remote-repository" ).getCanonicalPath().replace(
'\\', '/' );
     }
 
-    public static String getPath( File file )
-        throws IOException
-    {
-        return ReleaseUtil.isSymlink( file ) ? file.getCanonicalPath() : file.getAbsolutePath();
-    }
-
     /**
      * WorkspaceReader to find versions and artifacts from reactor
      */
diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmBranchPhaseTest.java
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmBranchPhaseTest.java
index 9136cb2..505b963 100644
--- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmBranchPhaseTest.java
+++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmBranchPhaseTest.java
@@ -31,7 +31,6 @@ import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoMoreInteractions;
 import static org.mockito.Mockito.when;
 
-import java.io.File;
 import java.io.IOException;
 import java.util.Collections;
 import java.util.List;
@@ -78,12 +77,6 @@ public class ScmBranchPhaseTest
         phase = lookup( ReleasePhase.class, "scm-branch" );
     }
 
-    public static String getPath( File file )
-        throws IOException
-    {
-        return ReleaseUtil.isSymlink( file ) ? file.getCanonicalPath() : file.getAbsolutePath();
-    }
-
     @Test
     public void testBranch()
         throws Exception
@@ -93,7 +86,7 @@ public class ScmBranchPhaseTest
         List<MavenProject> reactorProjects = createReactorProjects();
         builder.setScmSourceUrl( "scm-url" );
         MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects );
-        builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) );
+        builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath()
);
         builder.setScmReleaseLabel( "release-label" );
         builder.setScmCommentPrefix( "[my prefix] " );
 
@@ -103,7 +96,7 @@ public class ScmBranchPhaseTest
         when( scmProviderMock.branch( isA( ScmRepository.class ), argThat( new IsScmFileSetEquals(
fileSet ) ),
                                       eq( "release-label" ),
                                       argThat( new IsScmBranchParametersEquals( new ScmBranchParameters(
"[my prefix] copy for branch release-label" ) ) ) ) ).thenReturn( new BranchScmResult( "...",
-                                                                                        
                                                                                         
             Collections.singletonList( new ScmFile( getPath( rootProject.getFile() ),
+                                                                                        
                                                                                         
             Collections.singletonList( new ScmFile( rootProject.getFile().getAbsolutePath(),
                                                                                         
                                                                                         
                                                     ScmFileStatus.TAGGED ) ) ) );
         ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class );
         stub.setScmProvider( scmProviderMock );
@@ -131,7 +124,7 @@ public class ScmBranchPhaseTest
         ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
         builder.setScmSourceUrl( scmUrl );
         MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects );
-        builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) );
+        builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath()
);
         builder.setScmReleaseLabel( "release-label" );
         builder.setScmCommentPrefix( "[my prefix] " );
         builder.setScmBranchBase( "http://svn.example.com/repos/project/branches/" );
@@ -145,7 +138,7 @@ public class ScmBranchPhaseTest
         when( scmProviderMock.branch( eq( repository ), argThat( new IsScmFileSetEquals(
fileSet ) ),
                                       eq( "release-label" ),
                                       argThat( new IsScmBranchParametersEquals( new ScmBranchParameters(
"[my prefix] copy for branch release-label" ) ) ) ) ).thenReturn( new BranchScmResult( "...",
-                                                                                        
                                                                                         
             Collections.singletonList( new ScmFile( getPath( rootProject.getFile() ),
+                                                                                        
                                                                                         
             Collections.singletonList( new ScmFile( rootProject.getFile().getAbsolutePath(),
                                                                                         
                                                                                         
                                                     ScmFileStatus.TAGGED ) ) ) );
 
         ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class );
@@ -172,7 +165,7 @@ public class ScmBranchPhaseTest
         MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects );
         ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
         builder.setScmSourceUrl( rootProject.getScm().getConnection() );
-        builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) );
+        builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath()
);
         builder.setScmReleaseLabel( "release-label" );
         builder.setScmCommentPrefix( "[my prefix] " );
 
@@ -186,7 +179,7 @@ public class ScmBranchPhaseTest
         when( scmProviderMock.branch( eq( repository ), argThat( new IsScmFileSetEquals(
fileSet ) ),
                                       eq( "release-label" ),
                                       argThat( new IsScmBranchParametersEquals( new ScmBranchParameters(
"[my prefix] copy for branch release-label" ) ) ) ) ).thenReturn( new BranchScmResult( "...",
-                                                                                        
                                                                                         
             Collections.singletonList( new ScmFile( getPath( rootProject.getFile() ),
+                                                                                        
                                                                                         
             Collections.singletonList( new ScmFile( rootProject.getFile().getAbsolutePath(),
                                                                                         
                                                                                         
                                                     ScmFileStatus.TAGGED ) ) ) );
 
         ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class );
@@ -213,7 +206,7 @@ public class ScmBranchPhaseTest
         List<MavenProject> reactorProjects = createReactorProjects( dir, dir, null
);
         builder.setScmSourceUrl( "scm-url" );
         MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects );
-        builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) );
+        builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath()
);
         builder.setScmReleaseLabel( "release-label" );
         builder.setScmCommentPrefix( "[my prefix] " );
 
@@ -223,7 +216,7 @@ public class ScmBranchPhaseTest
         when( scmProviderMock.branch( isA( ScmRepository.class ), argThat( new IsScmFileSetEquals(
fileSet ) ),
                                       eq( "release-label" ),
                                       argThat( new IsScmBranchParametersEquals( new ScmBranchParameters(
"[my prefix] copy for branch release-label" ) ) ) ) ).thenReturn( new BranchScmResult( "...",
-                                                                                        
                                                                                         
             Collections.singletonList( new ScmFile( getPath( rootProject.getFile() ),
+                                                                                        
                                                                                         
             Collections.singletonList( new ScmFile( rootProject.getFile().getAbsolutePath(),
                                                                                         
                                                                                         
                                                     ScmFileStatus.TAGGED ) ) ) );
 
         ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class );
@@ -265,7 +258,7 @@ public class ScmBranchPhaseTest
         List<MavenProject> reactorProjects = createReactorProjects();
         builder.setScmSourceUrl( "scm-url" );
         MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects );
-        builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) );
+        builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath()
);
         builder.setScmReleaseLabel( "release-label" );
 
         ScmProvider scmProviderMock = mock( ScmProvider.class );
@@ -421,7 +414,7 @@ public class ScmBranchPhaseTest
         ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
         builder.setScmSourceUrl( "scm-url" );
         builder.setScmReleaseLabel( "release-label" );
-        builder.setWorkingDirectory( getPath( getTestFile( "target/test/checkout" ) ) );
+        builder.setWorkingDirectory( getTestFile( "target/test/checkout" ).getAbsolutePath()
);
         return builder;
     }
 }
diff --git a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmTagPhaseTest.java
b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmTagPhaseTest.java
index 1ac428b..c9ab753 100644
--- a/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmTagPhaseTest.java
+++ b/maven-release-manager/src/test/java/org/apache/maven/shared/release/phase/ScmTagPhaseTest.java
@@ -31,7 +31,6 @@ import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.verifyNoMoreInteractions;
 import static org.mockito.Mockito.when;
 
-import java.io.File;
 import java.io.IOException;
 import java.util.Collections;
 import java.util.List;
@@ -78,12 +77,6 @@ public class ScmTagPhaseTest
         phase = (ReleasePhase) lookup( ReleasePhase.class, "scm-tag" );
     }
 
-    public static String getPath( File file )
-        throws IOException
-    {
-        return ReleaseUtil.isSymlink( file ) ? file.getCanonicalPath() : file.getAbsolutePath();
-    }
-
     @Test
     public void testTag()
         throws Exception
@@ -93,7 +86,7 @@ public class ScmTagPhaseTest
         List<MavenProject> reactorProjects = createReactorProjects();
         builder.setScmSourceUrl( "scm-url" );
         MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects );
-        builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) );
+        builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath()
);
         builder.setScmReleaseLabel( "release-label" );
         builder.setScmCommentPrefix( "[my prefix] " );
 
@@ -103,7 +96,7 @@ public class ScmTagPhaseTest
         when( scmProviderMock.tag( isA( ScmRepository.class ), argThat( new IsScmFileSetEquals(
fileSet ) ),
                                    eq( "release-label" ),
                                    argThat( new IsScmTagParametersEquals( new ScmTagParameters(
"[my prefix] copy for tag release-label" ) ) ) ) ).thenReturn( new TagScmResult( "...",
-                                                                                        
                                                                                        Collections.singletonList(
new ScmFile( getPath( rootProject.getFile() ),
+                                                                                        
                                                                                        Collections.singletonList(
new ScmFile( rootProject.getFile().getAbsolutePath(),
                                                                                         
                                                                                         
                                      ScmFileStatus.TAGGED ) ) ) );
         ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class );
         stub.setScmProvider( scmProviderMock );
@@ -130,7 +123,7 @@ public class ScmTagPhaseTest
         ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
         builder.setScmSourceUrl( scmUrl );
         MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects );
-        builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) );
+        builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath()
);
         builder.setScmReleaseLabel( "release-label" );
         builder.setScmCommentPrefix( "[my prefix] " );
         builder.setScmTagBase( "http://svn.example.com/repos/project/releases/" );
@@ -144,7 +137,7 @@ public class ScmTagPhaseTest
         when( scmProviderMock.tag( eq( repository ), argThat( new IsScmFileSetEquals( fileSet
) ),
                                    eq( "release-label" ),
                                    argThat( new IsScmTagParametersEquals( new ScmTagParameters(
"[my prefix] copy for tag release-label" ) ) ) ) ).thenReturn( new TagScmResult( "...",
-                                                                                        
                                                                                        Collections.singletonList(
new ScmFile( getPath( rootProject.getFile() ),
+                                                                                        
                                                                                        Collections.singletonList(
new ScmFile( rootProject.getFile().getAbsolutePath(),
                                                                                         
                                                                                         
                                      ScmFileStatus.TAGGED ) ) ) );
 
         ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class );
@@ -171,7 +164,7 @@ public class ScmTagPhaseTest
         MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects );
         ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
         builder.setScmSourceUrl( rootProject.getScm().getConnection() );
-        builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) );
+        builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath()
);
         builder.setScmReleaseLabel( "release-label" );
         builder.setScmCommentPrefix( "[my prefix] " );
 
@@ -185,7 +178,7 @@ public class ScmTagPhaseTest
         when( scmProviderMock.tag( eq( repository ), argThat( new IsScmFileSetEquals( fileSet
) ),
                                    eq( "release-label" ),
                                    argThat( new IsScmTagParametersEquals( new ScmTagParameters(
"[my prefix] copy for tag release-label" ) ) ) ) ).thenReturn( new TagScmResult( "...",
-                                                                                        
                                                                                        Collections.singletonList(
new ScmFile( getPath( rootProject.getFile() ),
+                                                                                        
                                                                                        Collections.singletonList(
new ScmFile( rootProject.getFile().getAbsolutePath(),
                                                                                         
                                                                                         
                                      ScmFileStatus.TAGGED ) ) ) );
 
         ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class );
@@ -212,7 +205,7 @@ public class ScmTagPhaseTest
         List<MavenProject> reactorProjects = createReactorProjects( dir, dir, null
);
         builder.setScmSourceUrl( "scm-url" );
         MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects );
-        builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) );
+        builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath()
);
         builder.setScmReleaseLabel( "release-label" );
         builder.setScmCommentPrefix( "[my prefix] " );
 
@@ -222,7 +215,7 @@ public class ScmTagPhaseTest
         when( scmProviderMock.tag( isA( ScmRepository.class ), argThat( new IsScmFileSetEquals(
fileSet ) ),
                                    eq( "release-label" ),
                                    argThat( new IsScmTagParametersEquals( new ScmTagParameters(
"[my prefix] copy for tag release-label" ) ) ) ) ).thenReturn( new TagScmResult( "...",
-                                                                                        
                                                                                        Collections.singletonList(
new ScmFile( getPath( rootProject.getFile() ),
+                                                                                        
                                                                                        Collections.singletonList(
new ScmFile( rootProject.getFile().getAbsolutePath(),
                                                                                         
                                                                                         
                                      ScmFileStatus.TAGGED ) ) ) );
 
         ScmManagerStub stub = (ScmManagerStub) lookup( ScmManager.class );
@@ -264,7 +257,7 @@ public class ScmTagPhaseTest
         List<MavenProject> reactorProjects = createReactorProjects();
         builder.setScmSourceUrl( "scm-url" );
         MavenProject rootProject = ReleaseUtil.getRootProject( reactorProjects );
-        builder.setWorkingDirectory( getPath( rootProject.getFile().getParentFile() ) );
+        builder.setWorkingDirectory( rootProject.getFile().getParentFile().getAbsolutePath()
);
         builder.setScmReleaseLabel( "release-label" );
 
         ScmProvider scmProviderMock = mock( ScmProvider.class );
@@ -418,7 +411,7 @@ public class ScmTagPhaseTest
         ReleaseDescriptorBuilder builder = new ReleaseDescriptorBuilder();
         builder.setScmSourceUrl( "scm-url" );
         builder.setScmReleaseLabel( "release-label" );
-        builder.setWorkingDirectory( getPath( getTestFile( "target/test/checkout" ) ) );
+        builder.setWorkingDirectory( getTestFile( "target/test/checkout" ).getAbsolutePath()
);
         return builder;
     }
 }

-- 
To stop receiving notification emails like this one, please contact
rfscholte@apache.org.

Mime
View raw message