[GitHub] [maven-scm] elharo commented on a change in pull request #102: [SCM-936] extract common code

2020-05-11 Thread GitBox


elharo commented on a change in pull request #102:
URL: https://github.com/apache/maven-scm/pull/102#discussion_r422992708



##
File path: 
maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/TagMojoTest.java
##
@@ -63,32 +62,29 @@ protected void setUp()
 "src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml" 
) );
 checkoutMojo.setWorkingDirectory( new File( getBasedir() ) );
 
-String connectionUrl = checkoutMojo.getConnectionUrl();
-connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", 
getBasedir() );
-connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" );
-checkoutMojo.setConnectionUrl( connectionUrl );
+setupConnectionUrl( checkoutMojo );
 
 checkoutMojo.setCheckoutDirectory( checkoutDir );
 
 checkoutMojo.execute();
 }
 
+private static void setupConnectionUrl( AbstractScmMojo mojo )
+{
+String connectionUrl = mojo.getConnectionUrl();
+connectionUrl = connectionUrl.replace( "${basedir}", getBasedir() );
+connectionUrl = connectionUrl.replace( '\\', '/' );
+mojo.setConnectionUrl( connectionUrl );
+}
+
 public void testTag()
 throws Exception
 {
-if ( !ScmTestCase.isSystemCmd( SvnScmTestUtils.SVNADMIN_COMMAND_LINE ) 
)

Review comment:
   Jenkins passed





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [maven-scm] elharo commented on a change in pull request #102: [SCM-936] extract common code

2020-05-11 Thread GitBox


elharo commented on a change in pull request #102:
URL: https://github.com/apache/maven-scm/pull/102#discussion_r422983147



##
File path: 
maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/TagMojoTest.java
##
@@ -63,32 +62,29 @@ protected void setUp()
 "src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml" 
) );
 checkoutMojo.setWorkingDirectory( new File( getBasedir() ) );
 
-String connectionUrl = checkoutMojo.getConnectionUrl();
-connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", 
getBasedir() );
-connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" );
-checkoutMojo.setConnectionUrl( connectionUrl );
+setupConnectionUrl( checkoutMojo );
 
 checkoutMojo.setCheckoutDirectory( checkoutDir );
 
 checkoutMojo.execute();
 }
 
+private static void setupConnectionUrl( AbstractScmMojo mojo )
+{
+String connectionUrl = mojo.getConnectionUrl();
+connectionUrl = connectionUrl.replace( "${basedir}", getBasedir() );
+connectionUrl = connectionUrl.replace( '\\', '/' );
+mojo.setConnectionUrl( connectionUrl );
+}
+
 public void testTag()
 throws Exception
 {
-if ( !ScmTestCase.isSystemCmd( SvnScmTestUtils.SVNADMIN_COMMAND_LINE ) 
)

Review comment:
   OK. I've added an explicit assumption in the setUp method to cover this. 





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [maven-scm] elharo commented on a change in pull request #102: [SCM-936] extract common code

2020-05-11 Thread GitBox


elharo commented on a change in pull request #102:
URL: https://github.com/apache/maven-scm/pull/102#discussion_r422975447



##
File path: 
maven-scm-plugin/src/test/java/org/apache/maven/scm/plugin/TagMojoTest.java
##
@@ -63,32 +62,29 @@ protected void setUp()
 "src/test/resources/mojos/checkout/checkoutWithConnectionUrl.xml" 
) );
 checkoutMojo.setWorkingDirectory( new File( getBasedir() ) );
 
-String connectionUrl = checkoutMojo.getConnectionUrl();
-connectionUrl = StringUtils.replace( connectionUrl, "${basedir}", 
getBasedir() );
-connectionUrl = StringUtils.replace( connectionUrl, "\\", "/" );
-checkoutMojo.setConnectionUrl( connectionUrl );
+setupConnectionUrl( checkoutMojo );
 
 checkoutMojo.setCheckoutDirectory( checkoutDir );
 
 checkoutMojo.execute();
 }
 
+private static void setupConnectionUrl( AbstractScmMojo mojo )
+{
+String connectionUrl = mojo.getConnectionUrl();
+connectionUrl = connectionUrl.replace( "${basedir}", getBasedir() );
+connectionUrl = connectionUrl.replace( '\\', '/' );
+mojo.setConnectionUrl( connectionUrl );
+}
+
 public void testTag()
 throws Exception
 {
-if ( !ScmTestCase.isSystemCmd( SvnScmTestUtils.SVNADMIN_COMMAND_LINE ) 
)

Review comment:
   It's not a test, it's an assumption and it's duplicative of the same 
code in the setUp method. If the code fails there, then the test isn't set up 
correctly here.  





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org