svn commit: r1799022 - in /maven/plugins/trunk/maven-remote-resources-plugin: ./ src/test/java/org/apache/maven/plugin/resources/remote/it/ src/test/java/org/apache/maven/plugin/resources/remote/it/support/

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

svn commit: r1799022 - in /maven/plugins/trunk/maven-remote-resources-plugin: ./ src/test/java/org/apache/maven/plugin/resources/remote/it/ src/test/java/org/apache/maven/plugin/resources/remote/it/support/

gboue
Author: gboue
Date: Sat Jun 17 21:02:49 2017
New Revision: 1799022

URL: http://svn.apache.org/viewvc?rev=1799022&view=rev
Log:
Fix ITs when the build is launched with a custom maven.repo.local set on the CLI.

Modified:
    maven/plugins/trunk/maven-remote-resources-plugin/pom.xml
    maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_BadDependencyPoms.java
    maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_CustomFilterDelimiter.java
    maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_FilterLocalOverride.java
    maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundle.java
    maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundleWithTypeAndClassifier.java
    maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromOverride.java
    maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GetDependencyProjects.java
    maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_RunOnlyAtExecutionRoot.java
    maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_SupplementalArtifact.java
    maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/support/BootstrapInstaller.java
    maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/support/TestUtils.java

Modified: maven/plugins/trunk/maven-remote-resources-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/pom.xml?rev=1799022&r1=1799021&r2=1799022&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/pom.xml Sat Jun 17 21:02:49 2017
@@ -350,8 +350,12 @@ under the License.
                 </goals>
                 <configuration>
                   <systemPropertyVariables>
-                    <!-- Pass this through to the tests (if set!) to have them pick the right repository -->
-                    <maven.repo.local>${project.build.directory}/it-repo</maven.repo.local>
+                    <!--
+                      The tests have to pick the right repository.
+                      SUREFIRE-1385: Cannot set maven.repo.local directly because it might have been set by the user
+                      on the CLI directly (and it would be preferred)
+                    -->
+                    <localRepositoryPath>${project.build.directory}/it-repo</localRepositoryPath>
                   </systemPropertyVariables>
                 </configuration>
               </execution>

Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_BadDependencyPoms.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_BadDependencyPoms.java?rev=1799022&r1=1799021&r2=1799022&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_BadDependencyPoms.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_BadDependencyPoms.java Sat Jun 17 21:02:49 2017
@@ -40,9 +40,7 @@ public class IT_BadDependencyPoms
     {
         File dir = TestUtils.getTestDir( "bad-dependency-poms" );
 
-        Verifier verifier;
-
-        verifier = new Verifier( dir.getAbsolutePath() );
+        Verifier verifier = TestUtils.newVerifier( dir );
         verifier.deleteArtifacts( "test" );
         verifier.getSystemProperties().setProperty( "it.dir", dir.getAbsolutePath() );
         

Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_CustomFilterDelimiter.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_CustomFilterDelimiter.java?rev=1799022&r1=1799021&r2=1799022&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_CustomFilterDelimiter.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_CustomFilterDelimiter.java Sat Jun 17 21:02:49 2017
@@ -36,7 +36,7 @@ public class IT_CustomFilterDelimiter
         throws IOException, URISyntaxException, VerificationException
     {
         File dir = TestUtils.getTestDir( "custom-filter-delim" );
-        Verifier verifier = new Verifier( dir.getAbsolutePath() );
+        Verifier verifier = TestUtils.newVerifier( dir );
         
         verifier.getCliOptions().add( "-X" );
         

Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_FilterLocalOverride.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_FilterLocalOverride.java?rev=1799022&r1=1799021&r2=1799022&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_FilterLocalOverride.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_FilterLocalOverride.java Sat Jun 17 21:02:49 2017
@@ -36,7 +36,7 @@ public class IT_FilterLocalOverride
         throws IOException, URISyntaxException, VerificationException
     {
         File dir = TestUtils.getTestDir( "filter-local-override" );
-        Verifier verifier = new Verifier( dir.getAbsolutePath() );
+        Verifier verifier = TestUtils.newVerifier( dir );
         
         verifier.executeGoal( "generate-resources" );
         verifier.verifyErrorFreeLog();

Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundle.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundle.java?rev=1799022&r1=1799021&r2=1799022&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundle.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundle.java Sat Jun 17 21:02:49 2017
@@ -36,7 +36,7 @@ public class IT_GenerateFromBundle
         throws IOException, URISyntaxException, VerificationException
     {
         File dir = TestUtils.getTestDir( "generate-from-bundle" );
-        Verifier verifier = new Verifier( dir.getAbsolutePath() );
+        Verifier verifier = TestUtils.newVerifier( dir );
         
         verifier.executeGoal( "generate-resources" );
         verifier.verifyErrorFreeLog();

Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundleWithTypeAndClassifier.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundleWithTypeAndClassifier.java?rev=1799022&r1=1799021&r2=1799022&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundleWithTypeAndClassifier.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromBundleWithTypeAndClassifier.java Sat Jun 17 21:02:49 2017
@@ -36,7 +36,7 @@ public class IT_GenerateFromBundleWithTy
         throws IOException, URISyntaxException, VerificationException
     {
         File dir = TestUtils.getTestDir( "generate-from-bundle-with-type-and-classifier" );
-        Verifier verifier = new Verifier( dir.getAbsolutePath() );
+        Verifier verifier = TestUtils.newVerifier( dir );
         
         verifier.executeGoal( "generate-resources" );
         verifier.verifyErrorFreeLog();

Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromOverride.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromOverride.java?rev=1799022&r1=1799021&r2=1799022&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromOverride.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GenerateFromOverride.java Sat Jun 17 21:02:49 2017
@@ -36,7 +36,7 @@ public class IT_GenerateFromOverride
         throws IOException, URISyntaxException, VerificationException
     {
         File dir = TestUtils.getTestDir( "generate-from-override" );
-        Verifier verifier = new Verifier( dir.getAbsolutePath() );
+        Verifier verifier = TestUtils.newVerifier( dir );
         
         verifier.executeGoal( "generate-resources" );
         verifier.verifyErrorFreeLog();

Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GetDependencyProjects.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GetDependencyProjects.java?rev=1799022&r1=1799021&r2=1799022&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GetDependencyProjects.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_GetDependencyProjects.java Sat Jun 17 21:02:49 2017
@@ -42,12 +42,12 @@ public class IT_GetDependencyProjects
 
         Verifier verifier;
 
-        verifier = new Verifier( dir.getAbsolutePath() );
+        verifier = TestUtils.newVerifier( dir );
         verifier.executeGoal( "deploy" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 
-        verifier = new Verifier( new File( dir, "project" ).getAbsolutePath() );
+        verifier = TestUtils.newVerifier( new File( dir, "project" ) );
 
         verifier.deleteArtifacts( "org.apache.maven.plugin.rresource.it.gdp" );
 

Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_RunOnlyAtExecutionRoot.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_RunOnlyAtExecutionRoot.java?rev=1799022&r1=1799021&r2=1799022&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_RunOnlyAtExecutionRoot.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_RunOnlyAtExecutionRoot.java Sat Jun 17 21:02:49 2017
@@ -42,12 +42,12 @@ public class IT_RunOnlyAtExecutionRoot
 
         Verifier verifier;
 
-        verifier = new Verifier( new File( dir, "resource-projects" ).getAbsolutePath() );
+        verifier = TestUtils.newVerifier( new File( dir, "resource-projects" ) );
         verifier.executeGoal( "deploy" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 
-        verifier = new Verifier( dir.getAbsolutePath() );
+        verifier = TestUtils.newVerifier( dir );
 
         // I'm not sure what exactly the intention of the test was.
         // Based on the name i assumed to be sure the remote-resources-plugin

Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_SupplementalArtifact.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_SupplementalArtifact.java?rev=1799022&r1=1799021&r2=1799022&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_SupplementalArtifact.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/IT_SupplementalArtifact.java Sat Jun 17 21:02:49 2017
@@ -43,7 +43,7 @@ public class IT_SupplementalArtifact
 
         Verifier verifier;
 
-        verifier = new Verifier( resources.getAbsolutePath() );
+        verifier = TestUtils.newVerifier( resources );
         
         verifier.deleteArtifacts( "org.apache.maven.plugin.rresource.it.mrr43" );
 
@@ -51,7 +51,7 @@ public class IT_SupplementalArtifact
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 
-        verifier = new Verifier( dir.getAbsolutePath() );
+        verifier = TestUtils.newVerifier( dir );
 
         verifier.executeGoal( "generate-resources" );
         verifier.verifyErrorFreeLog();

Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/support/BootstrapInstaller.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/support/BootstrapInstaller.java?rev=1799022&r1=1799021&r2=1799022&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/support/BootstrapInstaller.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/support/BootstrapInstaller.java Sat Jun 17 21:02:49 2017
@@ -38,7 +38,7 @@ public class BootstrapInstaller
         {
             File bootstrapDir = TestUtils.getTestDir( "bootstrap" );
             
-            Verifier verifier = new Verifier( bootstrapDir.getAbsolutePath() );
+            Verifier verifier = TestUtils.newVerifier( bootstrapDir );
             
             verifier.executeGoal( "deploy" );
             

Modified: maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/support/TestUtils.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/support/TestUtils.java?rev=1799022&r1=1799021&r2=1799022&view=diff
==============================================================================
--- maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/support/TestUtils.java (original)
+++ maven/plugins/trunk/maven-remote-resources-plugin/src/test/java/org/apache/maven/plugin/resources/remote/it/support/TestUtils.java Sat Jun 17 21:02:49 2017
@@ -25,6 +25,9 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 
+import org.apache.maven.it.VerificationException;
+import org.apache.maven.it.Verifier;
+
 public class TestUtils
 {
     public static File getTestDir( final String name )
@@ -53,4 +56,13 @@ public class TestUtils
             return result.getAbsoluteFile();
         }
     }
+
+    public static Verifier newVerifier( File dir )
+        throws VerificationException
+    {
+        Verifier verifier = new Verifier( dir.getAbsolutePath() );
+        verifier.setLocalRepo( System.getProperty( "localRepositoryPath" ) );
+        return verifier;
+    }
+
 }


Loading...