You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/05/11 10:58:50 UTC

[GitHub] [maven-scm] elharo opened a new pull request #102: [SCM-936] extract common code

elharo opened a new pull request #102:
URL: https://github.com/apache/maven-scm/pull/102


   @michael-o Let's see if the test still flakes. 


----------------------------------------------------------------
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:
users@infra.apache.org



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

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



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

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #102:
URL: https://github.com/apache/maven-scm/pull/102#discussion_r422978204



##########
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:
       Is the test really skipped w/o it?




----------------------------------------------------------------
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:
users@infra.apache.org



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

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #102:
URL: https://github.com/apache/maven-scm/pull/102#discussion_r422967796



##########
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:
       Why did you remove this test?




----------------------------------------------------------------
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:
users@infra.apache.org



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

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org



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

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org