You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2020/04/10 11:40:44 UTC

[maven-integration-testing] branch MNG-4660 created (now f3e1e40)

This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a change to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git.


      at f3e1e40  Share a bit more context why we're doing the ugly Thread.sleep

This branch includes the following new commits:

     new d7d4a53  Add integration test to show that --resume-from works
     new 0b786f7  Change order of modules in POM
     new 9f7229a  Introduce a compile-time dependency from module B to A
     new 4dd69b8  Rename test method so it's more descriptive
     new c7bf10a  No longer necessary to first install the whole project locally
     new 2a76ab8  Only run test for Maven 3.7.0-SNAPSHOT and up
     new beb7bc2  Remove TODO
     new c276f8d  Formatting
     new 5107d44  Corrected the Maven version to be 3.7.0 instead of -SNAPSHOT.
     new c5032bd  Reverted the change in the other integration test
     new b0215a6  Putting our integration test on top of the list, to order the tests from new to old (and not alphabetically on ticket number)
     new 1e8f055  Run test twice, once with packaged and once without packaged artifact
     new 173fe4d  Test case for checking whether a packaged artifact is up to date with the compiled artifact
     new e3d942e  Remove System.err.println invocations
     new 6eca36b  Rename method so it better describes the test
     new 1b2da11  Revert unrelated change
     new f40ccda  Removed the dependency on the compiler plugin
     new 9f5451b  Changed junit dependencies to version 4.12, which is the same as the testsuite itself is using.
     new c8736d5  Add assertions to analyze failing Linux+JDK8
     new e8e95ac  Add dependency on full Hamcrest package
     new 45203d6  Additional assertions on files being present
     new 14a6dd9  Base assertions and detailed failure message on the same info
     new 605ba4a  Add small delay between two Verifier invocations.
     new f3e1e40  Share a bit more context why we're doing the ugly Thread.sleep

The 24 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-integration-testing] 22/24: Base assertions and detailed failure message on the same info

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit 14a6dd9f560c2c56f47526d6af1b1a70f95a6d2d
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Tue Apr 7 19:34:43 2020 +0200

    Base assertions and detailed failure message on the same info
---
 .../apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java    | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
index d3b4c91..ea8100f 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
@@ -78,7 +78,8 @@ public class MavenITmng4660OutdatedPackagedArtifact extends AbstractMavenIntegra
                 .toAbsolutePath();
 
         verifier2.assertFilePresent( module1PropertiesFile.toString() );
-        assertThat( Files.getLastModifiedTime( module1PropertiesFile ), greaterThan ( Files.getLastModifiedTime( module1Jar ) ) );
+        assertThat( Files.getLastModifiedTime( module1PropertiesFile ),
+                greaterThan ( Files.getLastModifiedTime( module1Jar ) ) );
 
         Path module1Class = testDir.toPath().resolve( "module-a/target/classes/org/apache/maven/it/Example.class" )
                         .toAbsolutePath();
@@ -102,9 +103,9 @@ public class MavenITmng4660OutdatedPackagedArtifact extends AbstractMavenIntegra
         catch ( VerificationException e )
         {
             String message = e.getMessage() + System.lineSeparator();
-            message += "  " + module1Jar.getFileName() + " > " + Files.getLastModifiedTime( module1Jar )
+            message += "  " + module1Jar.getFileName() + " -> " + Files.getLastModifiedTime( module1Jar )
                             + System.lineSeparator();
-            message += "  " + module1Class.getFileName() + " > " + Files.getLastModifiedTime( module1Class )
+            message += "  " + module1PropertiesFile.getFileName() + " -> " + Files.getLastModifiedTime( module1PropertiesFile )
                             + System.lineSeparator();
             throw new VerificationException( message, e.getCause() );
         }


[maven-integration-testing] 02/24: Change order of modules in POM

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit 0b786f73abaab9d7b1d08fc5e49ec0bfee3e3675
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Wed Jan 29 15:10:43 2020 +0100

    Change order of modules in POM
---
 core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml b/core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml
index 5fa0e49..a2d0bcd 100644
--- a/core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml
+++ b/core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml
@@ -37,8 +37,8 @@ under the License.
     </properties>
 
     <modules>
-        <module>module-a</module>
         <module>module-b</module>
+        <module>module-a</module>
     </modules>
 
     <dependencies>


[maven-integration-testing] 16/24: Revert unrelated change

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit 1b2da118fe2fea20d0b5066cacd71cd65b26afda
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Fri Mar 27 11:30:37 2020 +0100

    Revert unrelated change
---
 .../src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java  | 1 +
 1 file changed, 1 insertion(+)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java
index c1abf34..77b7248 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java
@@ -19,6 +19,7 @@ package org.apache.maven.it;
  * under the License.
  */
 
+import org.apache.maven.it.Verifier;
 import org.apache.maven.it.util.ResourceExtractor;
 
 import java.io.File;


[maven-integration-testing] 18/24: Changed junit dependencies to version 4.12, which is the same as the testsuite itself is using.

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit 9f5451bbe7742b248c4b4d8846f74cc10fb41b11
Author: Martin Kanters <Ma...@infosupport.com>
AuthorDate: Sat Mar 28 21:37:52 2020 +0100

    Changed junit dependencies to version 4.12, which is the same as the testsuite itself is using.
---
 .../src/test/resources/mng-4660-outdated-packaged-artifact/pom.xml      | 2 +-
 core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/pom.xml b/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/pom.xml
index 22df1eb..565b2fc 100644
--- a/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/pom.xml
+++ b/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/pom.xml
@@ -51,7 +51,7 @@ under the License.
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>4.4</version>
+            <version>4.12</version>
             <scope>test</scope>
         </dependency>
     </dependencies>
diff --git a/core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml b/core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml
index 98e4f82..1589fd0 100644
--- a/core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml
+++ b/core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml
@@ -51,7 +51,7 @@ under the License.
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
-            <version>4.4</version>
+            <version>4.12</version>
             <scope>test</scope>
         </dependency>
     </dependencies>


[maven-integration-testing] 07/24: Remove TODO

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit beb7bc23d09da3b041d30772eba5ea1d97df5eb4
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Fri Feb 14 13:29:59 2020 +0100

    Remove TODO
---
 .../src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java  | 1 -
 1 file changed, 1 deletion(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
index 6a1788a..a1c6ec1 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
@@ -32,7 +32,6 @@ import java.io.File;
 public class MavenITmng4660ResumeFromTest extends AbstractMavenIntegrationTestCase {
     public MavenITmng4660ResumeFromTest()
     {
-        // TODO Update version range once bug has been fixed!
         super( "[3.7.0-SNAPSHOT,)" );
     }
 


[maven-integration-testing] 06/24: Only run test for Maven 3.7.0-SNAPSHOT and up

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit 2a76ab86a6d5c0b6336c134af7a09fe786276487
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Fri Feb 14 13:29:38 2020 +0100

    Only run test for Maven 3.7.0-SNAPSHOT and up
---
 .../src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
index 7405cac..6a1788a 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
@@ -33,7 +33,7 @@ public class MavenITmng4660ResumeFromTest extends AbstractMavenIntegrationTestCa
     public MavenITmng4660ResumeFromTest()
     {
         // TODO Update version range once bug has been fixed!
-        super( "[3.6.3,)" );
+        super( "[3.7.0-SNAPSHOT,)" );
     }
 
     /**


[maven-integration-testing] 10/24: Reverted the change in the other integration test

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit c5032bda4af9332d5b9997a21d2a3d4801cf2c6d
Author: Martin Kanters <Ma...@ing.com>
AuthorDate: Sat Feb 22 10:07:18 2020 -0500

    Reverted the change in the other integration test
---
 .../src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java
index d561ef5..c1abf34 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java
@@ -60,7 +60,7 @@ public class MavenITmng6090CIFriendlyTest
         
         verifier.addCliOption( "-Drevision=1.2" );
         verifier.setLogFileName( "install-log.txt" );
-        verifier.executeGoal( "verify" );
+        verifier.executeGoals( Arrays.asList( "clean", "install" ) );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 


[maven-integration-testing] 05/24: No longer necessary to first install the whole project locally

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit c7bf10afc850d5f4266efbcfad8984643eb224e6
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Fri Feb 14 12:06:13 2020 +0100

    No longer necessary to first install the whole project locally
---
 .../test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java    | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java
index 77b7248..d561ef5 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6090CIFriendlyTest.java
@@ -19,7 +19,6 @@ package org.apache.maven.it;
  * under the License.
  */
 
-import org.apache.maven.it.Verifier;
 import org.apache.maven.it.util.ResourceExtractor;
 
 import java.io.File;
@@ -61,7 +60,7 @@ public class MavenITmng6090CIFriendlyTest
         
         verifier.addCliOption( "-Drevision=1.2" );
         verifier.setLogFileName( "install-log.txt" );
-        verifier.executeGoals( Arrays.asList( "clean", "install" ) );
+        verifier.executeGoal( "verify" );
         verifier.verifyErrorFreeLog();
         verifier.resetStreams();
 


[maven-integration-testing] 12/24: Run test twice, once with packaged and once without packaged artifact

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit 1e8f055fd2259b3b6d9396df4b6e3549df2b6cba
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Mon Mar 9 14:46:59 2020 +0100

    Run test twice, once with packaged and once without packaged artifact
---
 .../maven/it/MavenITmng4660ResumeFromTest.java     | 42 ++++++++++++++++++++--
 1 file changed, 40 insertions(+), 2 deletions(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
index d43e796..6d2b471 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
@@ -38,8 +38,9 @@ public class MavenITmng4660ResumeFromTest extends AbstractMavenIntegrationTestCa
     /**
      * Test that the --resume-from flag resolves dependencies inside the same Maven project
      * without having them installed first.
+     * This test case uses the target/classes folder of module-a.
      */
-    public void testShouldResolveDependenciesFromEarlierBuild() throws Exception
+    public void testShouldResolveUnpackagedArtifactFromEarlierBuild() throws Exception
     {
         final File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4660-resume-from" );
 
@@ -49,7 +50,44 @@ public class MavenITmng4660ResumeFromTest extends AbstractMavenIntegrationTestCa
 
         try
         {
-            verifier1.executeGoal( "verify" );
+            verifier1.executeGoal( "test" ); // The test goal will not create a packaged artifact
+            fail( "Expected this invocation to fail" ); // See TestCase.java
+        }
+        catch ( final VerificationException ve )
+        {
+            verifier1.verifyTextInLog( "Deliberately fail test case" );
+        }
+        finally
+        {
+            verifier1.resetStreams();
+        }
+
+        final Verifier verifier2 = newVerifier( testDir.getAbsolutePath() );
+        verifier2.setAutoclean( false );
+        verifier2.addCliOption( "--resume-from" );
+        verifier2.addCliOption( ":module-b" );
+        verifier2.executeGoal( "compile" ); // to prevent the unit test from failing (again)
+
+        verifier2.verifyErrorFreeLog();
+        verifier2.resetStreams();
+    }
+
+    /**
+     * Test that the --resume-from flag resolves dependencies inside the same Maven project
+     * without having them installed first.
+     * This test case uses the packaged artifact of module-a.
+     */
+    public void testShouldResolvePackagedArtifactFromEarlierBuild() throws Exception
+    {
+        final File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4660-resume-from" );
+
+        final Verifier verifier1 = newVerifier( testDir.getAbsolutePath() );
+        verifier1.deleteDirectory( "target" );
+        verifier1.deleteArtifacts( "org.apache.maven.its.mng4660" );
+
+        try
+        {
+            verifier1.executeGoal( "verify" ); // The verify goal will create a packaged artifact
             fail( "Expected this invocation to fail" ); // See TestCase.java
         }
         catch ( final VerificationException ve )


[maven-integration-testing] 04/24: Rename test method so it's more descriptive

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit 4dd69b8075d7d55bcc0f88a4bb6cd6cb45375095
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Fri Feb 14 12:05:03 2020 +0100

    Rename test method so it's more descriptive
---
 .../src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
index c1cbf66..7405cac 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
@@ -40,7 +40,7 @@ public class MavenITmng4660ResumeFromTest extends AbstractMavenIntegrationTestCa
      * Test that the --resume-from flag resolves dependencies inside the same Maven project
      * without having them installed first.
      */
-    public void testIt() throws Exception
+    public void testShouldResolveDependenciesFromEarlierBuild() throws Exception
     {
         final File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4660-resume-from" );
 


[maven-integration-testing] 15/24: Rename method so it better describes the test

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit 6eca36baaaf23d4e28f89d97f02529cfec235019
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Fri Mar 27 11:04:31 2020 +0100

    Rename method so it better describes the test
    
    Also update the Javadoc a bit to better explain what the
    scenario is in this case.
---
 .../test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java  | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
index 6d2b471..b223812 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
@@ -38,9 +38,10 @@ public class MavenITmng4660ResumeFromTest extends AbstractMavenIntegrationTestCa
     /**
      * Test that the --resume-from flag resolves dependencies inside the same Maven project
      * without having them installed first.
-     * This test case uses the target/classes folder of module-a.
+     * This test case uses the target/classes folder of module-a, for the situation where
+     * module-a has not been packaged.
      */
-    public void testShouldResolveUnpackagedArtifactFromEarlierBuild() throws Exception
+    public void testShouldResolveOutputDirectoryFromEarlierBuild() throws Exception
     {
         final File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4660-resume-from" );
 


[maven-integration-testing] 19/24: Add assertions to analyze failing Linux+JDK8

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit c8736d53d9d03363887b834307947f52ffebde17
Author: rfscholte <rf...@apache.org>
AuthorDate: Tue Mar 31 21:36:04 2020 +0200

    Add assertions to analyze failing Linux+JDK8
---
 .../it/MavenITmng4660OutdatedPackagedArtifact.java | 24 +++++++++++++++++-----
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
index 99dabf7..de00b93 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
@@ -55,22 +55,24 @@ public class MavenITmng4660OutdatedPackagedArtifact extends AbstractMavenIntegra
 
         verifier1.executeGoal( "package" );
 
+        Path module1Jar = testDir.toPath().resolve( "module-a/target/module-a-1.0.jar" ).toAbsolutePath();
         verifier1.verifyErrorFreeLog();
+        verifier1.assertFilePresent( module1Jar.toString() );
         verifier1.resetStreams();
 
         // 2. Create a properties file with some content and compile only that module (module A).
         final Verifier verifier2 = newVerifier( testDir.getAbsolutePath() );
-
-        final Path resourcesDirectory = Files.createDirectories( Paths.get( testDir.toString(), "module-a", "src", "main", "resources" ) );
-        final Path fileToWrite = resourcesDirectory.resolve( "example.properties" );
-        FileUtils.fileWrite( fileToWrite.toString(), "x=42" );
+        verifier2.deleteDirectory( "module-a/target/classes" );
 
         verifier2.setAutoclean( false );
         verifier2.addCliOption( "--projects" );
         verifier2.addCliOption( ":module-a" );
         verifier2.executeGoal( "compile" );
 
+        Path module1Class = testDir.toPath().resolve( "module-a/target/classes/org/apache/maven/it/Example.class" )
+                        .toAbsolutePath();
         verifier2.verifyErrorFreeLog();
+        verifier2.assertFilePresent( module1Class.toString() );
         verifier2.resetStreams();
 
         // 3. Resume project build from module B, that depends on module A we just touched. Its packaged artifact
@@ -82,7 +84,19 @@ public class MavenITmng4660OutdatedPackagedArtifact extends AbstractMavenIntegra
         verifier3.executeGoal( "compile" );
 
         verifier3.verifyErrorFreeLog();
-        verifier3.verifyTextInLog( "Packaged artifact is not up-to-date" );
+        try
+        {
+            verifier3.verifyTextInLog( "Packaged artifact is not up-to-date" );
+        }
+        catch ( VerificationException e )
+        {
+            String message = e.getMessage() + System.lineSeparator();
+            message += "  " + module1Jar.getFileName() + " > " + Files.getLastModifiedTime( module1Jar )
+                            + System.lineSeparator();
+            message += "  " + module1Class.getFileName() + " > " + Files.getLastModifiedTime( module1Class )
+                            + System.lineSeparator();
+            throw new VerificationException( message, e.getCause() );
+        }
         verifier3.resetStreams();
     }
 }


[maven-integration-testing] 13/24: Test case for checking whether a packaged artifact is up to date with the compiled artifact

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit 173fe4d846ea0fe38cdd108da07d0202cfbd6d08
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Thu Mar 26 14:02:42 2020 +0100

    Test case for checking whether a packaged artifact is up to date with the compiled artifact
---
 .../org/apache/maven/it/IntegrationTestSuite.java  |  1 +
 .../it/MavenITmng4660OutdatedPackagedArtifact.java | 91 ++++++++++++++++++++++
 .../module-a/pom.xml                               | 36 +++++++++
 .../src/main/java/org/apache/maven/it/Example.java | 24 ++++++
 .../module-b/pom.xml                               | 44 +++++++++++
 .../java/org/apache/maven/it/AnotherExample.java   | 28 +++++++
 .../test/java/org/apache/maven/it/TestCase.java    | 31 ++++++++
 .../mng-4660-outdated-packaged-artifact/pom.xml    | 62 +++++++++++++++
 .../java/org/apache/maven/it/AnotherExample.java   | 28 +++++++
 9 files changed, 345 insertions(+)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
index 09aeb18..3f0cbc8 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
@@ -108,6 +108,7 @@ public class IntegrationTestSuite
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
         suite.addTestSuite( MavenITmng4660ResumeFromTest.class );
+        suite.addTestSuite( MavenITmng4660OutdatedPackagedArtifact.class );
         suite.addTestSuite( MavenITmng6759TransitiveDependencyRepositoriesTest.class );
         suite.addTestSuite( MavenITmng6720FailFastTest.class );
         suite.addTestSuite( MavenITmng6558ToolchainsBuildingEventTest.class );
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
new file mode 100644
index 0000000..289a357
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
@@ -0,0 +1,91 @@
+package org.apache.maven.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.it.util.ResourceExtractor;
+import org.apache.maven.shared.utils.io.FileUtils;
+
+import java.io.File;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+/**
+ * This is a test case for a new check introduced with <a href="https://issues.apache.org/jira/browse/MNG-4660">MNG-4660</a>.
+ * That check verifies if a packaged artifact within the Reactor is up-to-date with the outputDirectory of the same project.
+ *
+ * @author Maarten Mulders
+ * @author Martin Kanters
+ */
+public class MavenITmng4660OutdatedPackagedArtifact extends AbstractMavenIntegrationTestCase {
+    public MavenITmng4660OutdatedPackagedArtifact()
+    {
+        super( "[3.7.0,)" );
+    }
+
+    /**
+     * Test that Maven logs a warning when a packaged artifact is found that is older than the outputDirectory of the
+     * same artifact.
+     */
+    public void testShouldWarnWhenPackagedArtifactIsOutdated() throws Exception
+    {
+        final File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4660-outdated-packaged-artifact" );
+
+        // 1. Package the whole project
+        final Verifier verifier1 = newVerifier( testDir.getAbsolutePath() );
+        verifier1.deleteDirectory( "target" );
+        verifier1.deleteArtifacts( "org.apache.maven.its.mng4660" );
+
+        verifier1.executeGoal( "package" );
+
+        verifier1.verifyErrorFreeLog();
+        verifier1.resetStreams();
+
+
+        // 2. Create a properties file with some content and compile only that module (module A).
+        final Verifier verifier2 = newVerifier( testDir.getAbsolutePath() );
+
+        final Path resourcesDirectory = Files.createDirectories( Paths.get( testDir.toString(), "module-a", "src", "main", "resources" ) );
+        System.err.println( "Created directory " + resourcesDirectory.toAbsolutePath().toString() );
+        final Path fileToWrite = resourcesDirectory.resolve( "example.properties" );
+        FileUtils.fileWrite( fileToWrite.toString(), "x=42" );
+        System.err.println( "Wrote file " + fileToWrite.toAbsolutePath().toString() );
+
+        verifier2.setAutoclean( false );
+        verifier2.addCliOption( "--projects" );
+        verifier2.addCliOption( ":module-a" );
+        verifier2.executeGoal( "compile" );
+
+        verifier2.verifyErrorFreeLog();
+        verifier2.resetStreams();
+
+        // 3. Resume project build from module B, that depends on module A we just touched. Its packaged artifact
+        // is no longer in sync with its compiled artifacts.
+        final Verifier verifier3 = newVerifier( testDir.getAbsolutePath() );
+        verifier3.setAutoclean( false );
+        verifier3.addCliOption( "--resume-from" );
+        verifier3.addCliOption( ":module-b" );
+        verifier3.executeGoal( "compile" );
+
+        verifier3.verifyErrorFreeLog();
+        verifier3.verifyTextInLog( "Packaged artifact is not up-to-date" );
+        verifier3.resetStreams();
+    }
+}
diff --git a/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/module-a/pom.xml b/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/module-a/pom.xml
new file mode 100644
index 0000000..f6e2caa
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/module-a/pom.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>module-a</artifactId>
+
+    <parent>
+        <groupId>org.apache.maven.its.mng4660</groupId>
+        <artifactId>parent</artifactId>
+        <version>1.0</version>
+    </parent>
+
+</project>
diff --git a/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/module-a/src/main/java/org/apache/maven/it/Example.java b/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/module-a/src/main/java/org/apache/maven/it/Example.java
new file mode 100644
index 0000000..1608aba
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/module-a/src/main/java/org/apache/maven/it/Example.java
@@ -0,0 +1,24 @@
+package org.apache.maven.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public class Example
+{
+}
\ No newline at end of file
diff --git a/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/module-b/pom.xml b/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/module-b/pom.xml
new file mode 100644
index 0000000..e00e63b
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/module-b/pom.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>module-b</artifactId>
+
+    <parent>
+        <groupId>org.apache.maven.its.mng4660</groupId>
+        <artifactId>parent</artifactId>
+        <version>1.0</version>
+    </parent>
+
+    <dependencies>
+      <dependency>
+          <groupId>org.apache.maven.its.mng4660</groupId>
+          <artifactId>module-a</artifactId>
+          <version>1.0</version>
+      </dependency>
+    </dependencies>
+
+</project>
diff --git a/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/module-b/src/main/java/org/apache/maven/it/AnotherExample.java b/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/module-b/src/main/java/org/apache/maven/it/AnotherExample.java
new file mode 100644
index 0000000..20ab187
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/module-b/src/main/java/org/apache/maven/it/AnotherExample.java
@@ -0,0 +1,28 @@
+package org.apache.maven.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public class AnotherExample
+{
+    public AnotherExample()
+    {
+        new Example();
+    }
+}
\ No newline at end of file
diff --git a/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/module-b/src/test/java/org/apache/maven/it/TestCase.java b/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/module-b/src/test/java/org/apache/maven/it/TestCase.java
new file mode 100644
index 0000000..74a4579
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/module-b/src/test/java/org/apache/maven/it/TestCase.java
@@ -0,0 +1,31 @@
+package org.apache.maven.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.junit.Test;
+
+public class TestCase
+{
+    @Test
+    public void testCase()
+    {
+        final Example example = new Example();
+    }
+}
\ No newline at end of file
diff --git a/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/pom.xml b/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/pom.xml
new file mode 100644
index 0000000..a2d0bcd
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/pom.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.apache.maven.its.mng4660</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0</version>
+
+    <packaging>pom</packaging>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+    </properties>
+
+    <modules>
+        <module>module-b</module>
+        <module>module-a</module>
+    </modules>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.4</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.8.1</version>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/core-it-suite/src/test/resources/mng-4660-resume-from/module-b/src/main/java/org/apache/maven/it/AnotherExample.java b/core-it-suite/src/test/resources/mng-4660-resume-from/module-b/src/main/java/org/apache/maven/it/AnotherExample.java
new file mode 100644
index 0000000..20ab187
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-4660-resume-from/module-b/src/main/java/org/apache/maven/it/AnotherExample.java
@@ -0,0 +1,28 @@
+package org.apache.maven.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+public class AnotherExample
+{
+    public AnotherExample()
+    {
+        new Example();
+    }
+}
\ No newline at end of file


[maven-integration-testing] 17/24: Removed the dependency on the compiler plugin

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit f40ccda1d3a6639c6de80453937100a378dacf89
Author: Martin Kanters <Ma...@infosupport.com>
AuthorDate: Sat Mar 28 20:09:03 2020 +0100

    Removed the dependency on the compiler plugin
---
 .../maven/it/MavenITmng4660OutdatedPackagedArtifact.java  |  1 -
 .../resources/mng-4660-outdated-packaged-artifact/pom.xml | 15 ++++++---------
 .../src/test/resources/mng-4660-resume-from/pom.xml       | 15 ++++++---------
 3 files changed, 12 insertions(+), 19 deletions(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
index d168696..99dabf7 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
@@ -58,7 +58,6 @@ public class MavenITmng4660OutdatedPackagedArtifact extends AbstractMavenIntegra
         verifier1.verifyErrorFreeLog();
         verifier1.resetStreams();
 
-
         // 2. Create a properties file with some content and compile only that module (module A).
         final Verifier verifier2 = newVerifier( testDir.getAbsolutePath() );
 
diff --git a/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/pom.xml b/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/pom.xml
index a2d0bcd..22df1eb 100644
--- a/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/pom.xml
+++ b/core-it-suite/src/test/resources/mng-4660-outdated-packaged-artifact/pom.xml
@@ -30,6 +30,12 @@ under the License.
 
     <packaging>pom</packaging>
 
+    <name>Maven Integration Test :: MNG-4660</name>
+    <description>
+        This is a test case for a new check which verifies if a packaged artifact
+        within the Reactor is up-to-date with the outputDirectory of the same project.
+    </description>
+
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <maven.compiler.source>1.8</maven.compiler.source>
@@ -50,13 +56,4 @@ under the License.
         </dependency>
     </dependencies>
 
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.8.1</version>
-            </plugin>
-        </plugins>
-    </build>
-
 </project>
diff --git a/core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml b/core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml
index a2d0bcd..98e4f82 100644
--- a/core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml
+++ b/core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml
@@ -30,6 +30,12 @@ under the License.
 
     <packaging>pom</packaging>
 
+    <name>Maven Integration Test :: MNG-4660</name>
+    <description>
+        Test that the --resume-from flag resolves dependencies inside the same Maven project
+        without having them installed first.
+    </description>
+
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <maven.compiler.source>1.8</maven.compiler.source>
@@ -50,13 +56,4 @@ under the License.
         </dependency>
     </dependencies>
 
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <version>3.8.1</version>
-            </plugin>
-        </plugins>
-    </build>
-
 </project>


[maven-integration-testing] 03/24: Introduce a compile-time dependency from module B to A

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit 9f7229ae26522794389d4e8b64bea2267a950223
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Wed Jan 29 15:11:17 2020 +0100

    Introduce a compile-time dependency from module B to A
---
 .../src/main/java/org/apache/maven/it/Example.java}           | 11 +----------
 .../module-b/src/test/java/org/apache/maven/it/TestCase.java  |  1 +
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/core-it-suite/src/test/resources/mng-4660-resume-from/module-b/src/test/java/org/apache/maven/it/TestCase.java b/core-it-suite/src/test/resources/mng-4660-resume-from/module-a/src/main/java/org/apache/maven/it/Example.java
similarity index 82%
copy from core-it-suite/src/test/resources/mng-4660-resume-from/module-b/src/test/java/org/apache/maven/it/TestCase.java
copy to core-it-suite/src/test/resources/mng-4660-resume-from/module-a/src/main/java/org/apache/maven/it/Example.java
index 0fe241b..1608aba 100644
--- a/core-it-suite/src/test/resources/mng-4660-resume-from/module-b/src/test/java/org/apache/maven/it/TestCase.java
+++ b/core-it-suite/src/test/resources/mng-4660-resume-from/module-a/src/main/java/org/apache/maven/it/Example.java
@@ -19,15 +19,6 @@ package org.apache.maven.it;
  * under the License.
  */
 
-import org.junit.Test;
-
-import static org.junit.Assert.fail;
-
-public class TestCase
+public class Example
 {
-    @Test
-    public void testCase()
-    {
-        fail( "Deliberately fail test case" );
-    }
 }
\ No newline at end of file
diff --git a/core-it-suite/src/test/resources/mng-4660-resume-from/module-b/src/test/java/org/apache/maven/it/TestCase.java b/core-it-suite/src/test/resources/mng-4660-resume-from/module-b/src/test/java/org/apache/maven/it/TestCase.java
index 0fe241b..932ff51 100644
--- a/core-it-suite/src/test/resources/mng-4660-resume-from/module-b/src/test/java/org/apache/maven/it/TestCase.java
+++ b/core-it-suite/src/test/resources/mng-4660-resume-from/module-b/src/test/java/org/apache/maven/it/TestCase.java
@@ -28,6 +28,7 @@ public class TestCase
     @Test
     public void testCase()
     {
+        final Example example = new Example();
         fail( "Deliberately fail test case" );
     }
 }
\ No newline at end of file


[maven-integration-testing] 23/24: Add small delay between two Verifier invocations.

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit 605ba4af750f1fc64166f8087becc29943c6df2f
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Tue Apr 7 19:35:40 2020 +0200

    Add small delay between two Verifier invocations.
    
    It also makes sure we're not hit by tests that run so fast, that the
    difference in file modification time is too small to observe. Some
    combinations of Java version, OS and filesystem return that value
    with "just" second precision, which is not detailed enough.
---
 .../org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java  | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
index ea8100f..983a112 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
@@ -63,6 +63,11 @@ public class MavenITmng4660OutdatedPackagedArtifact extends AbstractMavenIntegra
         verifier1.assertFilePresent( module1Jar.toString() );
         verifier1.resetStreams();
 
+        // Simulating the delay between two invocations. It also makes sure we're not hit by tests that run so fast,
+        // that the difference in file modification time (see below) is too small to observe. Some combinations of OS
+        // and filesystem return that value with "just" second precision, which is not detailed enough.
+        Thread.sleep(1_000);
+
         // 2. Create a properties file with some content and compile only that module (module A).
         final Verifier verifier2 = newVerifier( testDir.getAbsolutePath() );
         final Path resourcesDirectory = Files.createDirectories( Paths.get( testDir.toString(), "module-a", "src", "main", "resources" ) );


[maven-integration-testing] 08/24: Formatting

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit c276f8d3423d87854f86668da8f4b035cfed6375
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Fri Feb 14 15:18:43 2020 +0100

    Formatting
---
 .../src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
index a1c6ec1..a30febf 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
@@ -49,7 +49,7 @@ public class MavenITmng4660ResumeFromTest extends AbstractMavenIntegrationTestCa
 
         try
         {
-            verifier1.executeGoal("verify");
+            verifier1.executeGoal( "verify" );
             fail( "Expected this invocation to fail" ); // See TestCase.java
         }
         catch ( final VerificationException ve )


[maven-integration-testing] 20/24: Add dependency on full Hamcrest package

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit e8e95ac38d07199bc22948d2038c3ecad79b2db1
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Tue Apr 7 14:14:41 2020 +0200

    Add dependency on full Hamcrest package
---
 core-it-suite/pom.xml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/core-it-suite/pom.xml b/core-it-suite/pom.xml
index 1830219..2850f66 100644
--- a/core-it-suite/pom.xml
+++ b/core-it-suite/pom.xml
@@ -92,6 +92,12 @@ under the License.
       <!-- NOTE: Use compile scope for transitivity. -->
     </dependency>
     <dependency>
+      <groupId>org.hamcrest</groupId>
+      <artifactId>hamcrest-all</artifactId>
+      <version>1.3</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
       <version>1.5.8</version>


[maven-integration-testing] 09/24: Corrected the Maven version to be 3.7.0 instead of -SNAPSHOT.

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit 5107d44d709b683b6fca97c48ee60e49c12c9626
Author: Martin Kanters <Ma...@ing.com>
AuthorDate: Sat Feb 22 10:05:09 2020 -0500

    Corrected the Maven version to be 3.7.0 instead of -SNAPSHOT.
---
 .../src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
index a30febf..d43e796 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
@@ -32,7 +32,7 @@ import java.io.File;
 public class MavenITmng4660ResumeFromTest extends AbstractMavenIntegrationTestCase {
     public MavenITmng4660ResumeFromTest()
     {
-        super( "[3.7.0-SNAPSHOT,)" );
+        super( "[3.7.0,)" );
     }
 
     /**


[maven-integration-testing] 24/24: Share a bit more context why we're doing the ugly Thread.sleep

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit f3e1e4016c3ca363fffe9e89ce88fc8345ff7ec3
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Tue Apr 7 21:29:38 2020 +0200

    Share a bit more context why we're doing the ugly Thread.sleep
---
 .../maven/it/MavenITmng4660OutdatedPackagedArtifact.java      | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
index 983a112..afc46de 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
@@ -63,10 +63,13 @@ public class MavenITmng4660OutdatedPackagedArtifact extends AbstractMavenIntegra
         verifier1.assertFilePresent( module1Jar.toString() );
         verifier1.resetStreams();
 
-        // Simulating the delay between two invocations. It also makes sure we're not hit by tests that run so fast,
-        // that the difference in file modification time (see below) is too small to observe. Some combinations of OS
-        // and filesystem return that value with "just" second precision, which is not detailed enough.
-        Thread.sleep(1_000);
+        if ( System.getProperty( "java.version", "" ).startsWith( "1." ) )
+        {
+            // Simulating the delay between two invocations. It also makes sure we're not hit by tests that run so fast,
+            // that the difference in file modification time (see below) is too small to observe. Java 8 on Linux and
+            // macOS returns that value with "just" second precision, which is not detailed enough.
+            Thread.sleep( 1_000 );
+        }
 
         // 2. Create a properties file with some content and compile only that module (module A).
         final Verifier verifier2 = newVerifier( testDir.getAbsolutePath() );


[maven-integration-testing] 01/24: Add integration test to show that --resume-from works

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit d7d4a5373dc56810665caea3a9f289fe412e1e2d
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Wed Jan 29 11:20:35 2020 +0100

    Add integration test to show that --resume-from works
---
 .../org/apache/maven/it/IntegrationTestSuite.java  |  1 +
 .../maven/it/MavenITmng4660ResumeFromTest.java     | 74 ++++++++++++++++++++++
 .../mng-4660-resume-from/module-a/pom.xml          | 36 +++++++++++
 .../mng-4660-resume-from/module-b/pom.xml          | 44 +++++++++++++
 .../test/java/org/apache/maven/it/TestCase.java    | 33 ++++++++++
 .../test/resources/mng-4660-resume-from/pom.xml    | 62 ++++++++++++++++++
 6 files changed, 250 insertions(+)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
index 924e1fe..f722683 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
@@ -234,6 +234,7 @@ public class IntegrationTestSuite
         suite.addTestSuite( MavenITmng4679SnapshotUpdateInPluginTest.class );
         suite.addTestSuite( MavenITmng4677DisabledPluginConfigInheritanceTest.class );
         suite.addTestSuite( MavenITmng4666CoreRealmImportTest.class );
+        suite.addTestSuite( MavenITmng4660ResumeFromTest.class );
         suite.addTestSuite( MavenITmng4654ArtifactHandlerForMainArtifactTest.class );
         suite.addTestSuite( MavenITmng4644StrictPomParsingRejectsMisplacedTextTest.class );
         // suite.addTestSuite( MavenITmng4633DualCompilerExecutionsWeaveModeTest.class );
diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
new file mode 100644
index 0000000..c1cbf66
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660ResumeFromTest.java
@@ -0,0 +1,74 @@
+package org.apache.maven.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.apache.maven.it.util.ResourceExtractor;
+
+import java.io.File;
+
+/**
+ * This is a test case for <a href="https://issues.apache.org/jira/browse/MNG-4660">MNG-4660</a>.
+ *
+ * @author Maarten Mulders
+ * @author Martin Kanters
+ */
+public class MavenITmng4660ResumeFromTest extends AbstractMavenIntegrationTestCase {
+    public MavenITmng4660ResumeFromTest()
+    {
+        // TODO Update version range once bug has been fixed!
+        super( "[3.6.3,)" );
+    }
+
+    /**
+     * Test that the --resume-from flag resolves dependencies inside the same Maven project
+     * without having them installed first.
+     */
+    public void testIt() throws Exception
+    {
+        final File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-4660-resume-from" );
+
+        final Verifier verifier1 = newVerifier( testDir.getAbsolutePath() );
+        verifier1.deleteDirectory( "target" );
+        verifier1.deleteArtifacts( "org.apache.maven.its.mng4660" );
+
+        try
+        {
+            verifier1.executeGoal("verify");
+            fail( "Expected this invocation to fail" ); // See TestCase.java
+        }
+        catch ( final VerificationException ve )
+        {
+            verifier1.verifyTextInLog( "Deliberately fail test case" );
+        }
+        finally
+        {
+            verifier1.resetStreams();
+        }
+
+        final Verifier verifier2 = newVerifier( testDir.getAbsolutePath() );
+        verifier2.setAutoclean( false );
+        verifier2.addCliOption( "--resume-from" );
+        verifier2.addCliOption( ":module-b" );
+        verifier2.executeGoal( "compile" ); // to prevent the unit test from failing (again)
+
+        verifier2.verifyErrorFreeLog();
+        verifier2.resetStreams();
+    }
+}
diff --git a/core-it-suite/src/test/resources/mng-4660-resume-from/module-a/pom.xml b/core-it-suite/src/test/resources/mng-4660-resume-from/module-a/pom.xml
new file mode 100644
index 0000000..f6e2caa
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-4660-resume-from/module-a/pom.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>module-a</artifactId>
+
+    <parent>
+        <groupId>org.apache.maven.its.mng4660</groupId>
+        <artifactId>parent</artifactId>
+        <version>1.0</version>
+    </parent>
+
+</project>
diff --git a/core-it-suite/src/test/resources/mng-4660-resume-from/module-b/pom.xml b/core-it-suite/src/test/resources/mng-4660-resume-from/module-b/pom.xml
new file mode 100644
index 0000000..e00e63b
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-4660-resume-from/module-b/pom.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>module-b</artifactId>
+
+    <parent>
+        <groupId>org.apache.maven.its.mng4660</groupId>
+        <artifactId>parent</artifactId>
+        <version>1.0</version>
+    </parent>
+
+    <dependencies>
+      <dependency>
+          <groupId>org.apache.maven.its.mng4660</groupId>
+          <artifactId>module-a</artifactId>
+          <version>1.0</version>
+      </dependency>
+    </dependencies>
+
+</project>
diff --git a/core-it-suite/src/test/resources/mng-4660-resume-from/module-b/src/test/java/org/apache/maven/it/TestCase.java b/core-it-suite/src/test/resources/mng-4660-resume-from/module-b/src/test/java/org/apache/maven/it/TestCase.java
new file mode 100644
index 0000000..0fe241b
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-4660-resume-from/module-b/src/test/java/org/apache/maven/it/TestCase.java
@@ -0,0 +1,33 @@
+package org.apache.maven.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import org.junit.Test;
+
+import static org.junit.Assert.fail;
+
+public class TestCase
+{
+    @Test
+    public void testCase()
+    {
+        fail( "Deliberately fail test case" );
+    }
+}
\ No newline at end of file
diff --git a/core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml b/core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml
new file mode 100644
index 0000000..5fa0e49
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-4660-resume-from/pom.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>org.apache.maven.its.mng4660</groupId>
+    <artifactId>parent</artifactId>
+    <version>1.0</version>
+
+    <packaging>pom</packaging>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <maven.compiler.source>1.8</maven.compiler.source>
+        <maven.compiler.target>1.8</maven.compiler.target>
+    </properties>
+
+    <modules>
+        <module>module-a</module>
+        <module>module-b</module>
+    </modules>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.4</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>3.8.1</version>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>


[maven-integration-testing] 11/24: Putting our integration test on top of the list, to order the tests from new to old (and not alphabetically on ticket number)

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit b0215a639412ac2d3d81bc0209947ef6c0683da1
Author: Martin Kanters <Ma...@ing.com>
AuthorDate: Mon Mar 9 09:34:58 2020 +0100

    Putting our integration test on top of the list, to order the tests from new to old (and not alphabetically on ticket number)
---
 .../src/test/java/org/apache/maven/it/IntegrationTestSuite.java         | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
index f722683..09aeb18 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java
@@ -107,6 +107,7 @@ public class IntegrationTestSuite
         // -------------------------------------------------------------------------------------------------------------
         // suite.addTestSuite( MavenIT0108SnapshotUpdateTest.class ); -- MNG-3137
 
+        suite.addTestSuite( MavenITmng4660ResumeFromTest.class );
         suite.addTestSuite( MavenITmng6759TransitiveDependencyRepositoriesTest.class );
         suite.addTestSuite( MavenITmng6720FailFastTest.class );
         suite.addTestSuite( MavenITmng6558ToolchainsBuildingEventTest.class );
@@ -234,7 +235,6 @@ public class IntegrationTestSuite
         suite.addTestSuite( MavenITmng4679SnapshotUpdateInPluginTest.class );
         suite.addTestSuite( MavenITmng4677DisabledPluginConfigInheritanceTest.class );
         suite.addTestSuite( MavenITmng4666CoreRealmImportTest.class );
-        suite.addTestSuite( MavenITmng4660ResumeFromTest.class );
         suite.addTestSuite( MavenITmng4654ArtifactHandlerForMainArtifactTest.class );
         suite.addTestSuite( MavenITmng4644StrictPomParsingRejectsMisplacedTextTest.class );
         // suite.addTestSuite( MavenITmng4633DualCompilerExecutionsWeaveModeTest.class );


[maven-integration-testing] 14/24: Remove System.err.println invocations

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit e3d942e272da9e02975ddbc72e8152594766558a
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Fri Mar 27 11:01:35 2020 +0100

    Remove System.err.println invocations
---
 .../org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java     | 2 --
 1 file changed, 2 deletions(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
index 289a357..d168696 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
@@ -63,10 +63,8 @@ public class MavenITmng4660OutdatedPackagedArtifact extends AbstractMavenIntegra
         final Verifier verifier2 = newVerifier( testDir.getAbsolutePath() );
 
         final Path resourcesDirectory = Files.createDirectories( Paths.get( testDir.toString(), "module-a", "src", "main", "resources" ) );
-        System.err.println( "Created directory " + resourcesDirectory.toAbsolutePath().toString() );
         final Path fileToWrite = resourcesDirectory.resolve( "example.properties" );
         FileUtils.fileWrite( fileToWrite.toString(), "x=42" );
-        System.err.println( "Wrote file " + fileToWrite.toAbsolutePath().toString() );
 
         verifier2.setAutoclean( false );
         verifier2.addCliOption( "--projects" );


[maven-integration-testing] 21/24: Additional assertions on files being present

Posted by rf...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rfscholte pushed a commit to branch MNG-4660
in repository https://gitbox.apache.org/repos/asf/maven-integration-testing.git

commit 45203d6f5396f8b16d01dbd155fb9aa742e34469
Author: Maarten Mulders <ma...@infosupport.com>
AuthorDate: Tue Apr 7 14:16:39 2020 +0200

    Additional assertions on files being present
---
 .../maven/it/MavenITmng4660OutdatedPackagedArtifact.java    | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
index de00b93..d3b4c91 100644
--- a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng4660OutdatedPackagedArtifact.java
@@ -27,6 +27,9 @@ import java.nio.file.Files;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 
+import static org.junit.Assert.assertThat;
+import static org.hamcrest.Matchers.greaterThan;
+
 /**
  * This is a test case for a new check introduced with <a href="https://issues.apache.org/jira/browse/MNG-4660">MNG-4660</a>.
  * That check verifies if a packaged artifact within the Reactor is up-to-date with the outputDirectory of the same project.
@@ -62,13 +65,21 @@ public class MavenITmng4660OutdatedPackagedArtifact extends AbstractMavenIntegra
 
         // 2. Create a properties file with some content and compile only that module (module A).
         final Verifier verifier2 = newVerifier( testDir.getAbsolutePath() );
-        verifier2.deleteDirectory( "module-a/target/classes" );
+        final Path resourcesDirectory = Files.createDirectories( Paths.get( testDir.toString(), "module-a", "src", "main", "resources" ) );
+        final Path fileToWrite = resourcesDirectory.resolve( "example.properties" );
+        FileUtils.fileWrite( fileToWrite.toString(), "x=42" );
 
         verifier2.setAutoclean( false );
         verifier2.addCliOption( "--projects" );
         verifier2.addCliOption( ":module-a" );
         verifier2.executeGoal( "compile" );
 
+        Path module1PropertiesFile = testDir.toPath().resolve( "module-a/target/classes/example.properties" )
+                .toAbsolutePath();
+
+        verifier2.assertFilePresent( module1PropertiesFile.toString() );
+        assertThat( Files.getLastModifiedTime( module1PropertiesFile ), greaterThan ( Files.getLastModifiedTime( module1Jar ) ) );
+
         Path module1Class = testDir.toPath().resolve( "module-a/target/classes/org/apache/maven/it/Example.class" )
                         .toAbsolutePath();
         verifier2.verifyErrorFreeLog();