You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2018/04/02 11:13:51 UTC

[maven-dependency-plugin] branch MDEP-584 updated (f247b2d -> a185951)

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

khmarbaise pushed a change to branch MDEP-584
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git.


 discard f247b2d  [MDEP-584] - Upgrade plexus-utils to version 3.1.0
     new a185951  [MDEP-584] - Upgrade plexus-utils to version 3.1.0  o Code patch applied from Mark Raynsford <co...@io7m.com>  o This updates the plexus-utils dependency to 3.1.0. It corrects four    unit tests that were failing due to new behaviour in 3.1.0: It appears    that the new plexus-utils copies the lastModified attributes of files,    and the old tests were implicitly depending on the attributes not    being copied.

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (f247b2d)
            \
             N -- N -- N   refs/heads/MDEP-584 (a185951)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 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.


Summary of changes:
 .../dependency/fromConfiguration/TestCopyMojo.java | 22 ++++++++-------
 .../fromDependencies/TestCopyDependenciesMojo.java | 33 +++++++++-------------
 2 files changed, 26 insertions(+), 29 deletions(-)

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

[maven-dependency-plugin] 01/01: [MDEP-584] - Upgrade plexus-utils to version 3.1.0 o Code patch applied from Mark Raynsford o This updates the plexus-utils dependency to 3.1.0. It corrects four unit tests that were failing due to new behaviour in 3.1.0: It appears that the new plexus-utils copies the lastModified attributes of files, and the old tests were implicitly depending on the attributes not being copied.

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

khmarbaise pushed a commit to branch MDEP-584
in repository https://gitbox.apache.org/repos/asf/maven-dependency-plugin.git

commit a1859511f5d2391a49cd1fe16f2a3ff0b98204da
Author: Karl Heinz Marbaise <kh...@apache.org>
AuthorDate: Wed Feb 28 16:41:45 2018 +0100

    [MDEP-584] - Upgrade plexus-utils to version 3.1.0
     o Code patch applied from Mark Raynsford <co...@io7m.com>
     o This updates the plexus-utils dependency to 3.1.0. It corrects four
       unit tests that were failing due to new behaviour in 3.1.0: It appears
       that the new plexus-utils copies the lastModified attributes of files,
       and the old tests were implicitly depending on the attributes not
       being copied.
---
 pom.xml                                            |  2 +-
 .../dependency/fromConfiguration/TestCopyMojo.java | 22 ++++++++-------
 .../fromDependencies/TestCopyDependenciesMojo.java | 33 +++++++++-------------
 3 files changed, 27 insertions(+), 30 deletions(-)

diff --git a/pom.xml b/pom.xml
index de8f26e..d2152a2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -183,7 +183,7 @@ under the License.
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
-      <version>3.0.24</version>
+      <version>3.1.0</version>
     </dependency>
     <dependency>
       <groupId>org.apache.maven.shared</groupId>
diff --git a/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestCopyMojo.java b/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestCopyMojo.java
index 7cc11e2..3519e4d 100644
--- a/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestCopyMojo.java
+++ b/src/test/java/org/apache/maven/plugins/dependency/fromConfiguration/TestCopyMojo.java
@@ -671,7 +671,8 @@ public class TestCopyMojo
     {
         stubFactory.setCreateFiles( true );
         Artifact release = stubFactory.getReleaseArtifact();
-        assertTrue( release.getFile().setLastModified( System.currentTimeMillis() - 2000 ) );
+        assertTrue( release.getFile().setLastModified( 1000L ) );
+        assertEquals( 1000L, release.getFile().lastModified() );         
 
         ArtifactItem item = new ArtifactItem( release );
 
@@ -685,13 +686,13 @@ public class TestCopyMojo
 
         File copiedFile = new File( item.getOutputDirectory(), item.getDestFileName() );
 
-        // round up to the next second
-        long time = System.currentTimeMillis() - 2000;
-        assertTrue( copiedFile.setLastModified( time ) );
+        assertTrue( copiedFile.setLastModified( 2000L ) );
+        assertEquals( 2000L, copiedFile.lastModified() );
 
         mojo.execute();
 
-        assertTrue( time < copiedFile.lastModified() );
+        long timeCopyNow = copiedFile.lastModified();
+        assertEquals( 1000L, timeCopyNow );
     }
 
     public void testCopyOverWriteSnapshot()
@@ -699,7 +700,8 @@ public class TestCopyMojo
     {
         stubFactory.setCreateFiles( true );
         Artifact artifact = stubFactory.getSnapshotArtifact();
-        assertTrue( artifact.getFile().setLastModified( System.currentTimeMillis() - 2000 ) );
+        assertTrue( artifact.getFile().setLastModified( 1000L ) );
+        assertEquals( 1000L, artifact.getFile().lastModified() );         
 
         ArtifactItem item = new ArtifactItem( artifact );
 
@@ -714,13 +716,13 @@ public class TestCopyMojo
 
         File copiedFile = new File( item.getOutputDirectory(), item.getDestFileName() );
 
-        // round up to the next second
-        long time = System.currentTimeMillis() - 2000;
-        assertTrue( copiedFile.setLastModified( time ) );
+        assertTrue( copiedFile.setLastModified( 2000L ) );
+        assertEquals( 2000L, copiedFile.lastModified() );
 
         mojo.execute();
 
-        assertTrue( time < copiedFile.lastModified() );
+        long timeCopyNow = copiedFile.lastModified();
+        assertEquals( 1000L, timeCopyNow );
     }
 
     public void testCopyOverWriteIfNewer()
diff --git a/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestCopyDependenciesMojo.java b/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestCopyDependenciesMojo.java
index 61fbdeb..dea0419 100644
--- a/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestCopyDependenciesMojo.java
+++ b/src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestCopyDependenciesMojo.java
@@ -557,8 +557,10 @@ public class TestCopyDependenciesMojo
 
         Set<Artifact> artifacts = new HashSet<Artifact>();
         Artifact release = stubFactory.getReleaseArtifact();
-        assertTrue( release.getFile().setLastModified( System.currentTimeMillis() - 2000 ) );
 
+        assertTrue( release.getFile().setLastModified( 1000L ) );
+        assertEquals( 1000L, release.getFile().lastModified() );
+        
         artifacts.add( release );
 
         mojo.getProject().setArtifacts( artifacts );
@@ -571,19 +573,14 @@ public class TestCopyDependenciesMojo
 
         File copiedFile = new File( mojo.outputDirectory, DependencyUtil.getFormattedFileName( release, false ) );
 
-        Thread.sleep( 100 );
-        // round down to the last second
-        long time = System.currentTimeMillis();
-        time = time - ( time % 1000 );
-        assertTrue( copiedFile.setLastModified( time ) );
-        // wait at least a second for filesystems that only record to the
-        // nearest second.
-        Thread.sleep( 1000 );
+        assertTrue( copiedFile.setLastModified( 2000L ) );
+        assertEquals( 2000L, copiedFile.lastModified() );
 
         mojo.execute();
 
-        assertTrue( "time = " + time + " should be < to " + copiedFile.lastModified(),
-                    time < copiedFile.lastModified() );
+        long timeCopyNow = copiedFile.lastModified();
+        assertEquals( 1000L, timeCopyNow );
+
     }
 
     public void testDontOverWriteSnap()
@@ -592,7 +589,8 @@ public class TestCopyDependenciesMojo
 
         Set<Artifact> artifacts = new HashSet<Artifact>();
         Artifact snap = stubFactory.getSnapshotArtifact();
-        assertTrue( snap.getFile().setLastModified( System.currentTimeMillis() - 2000 ) );
+        assertTrue( snap.getFile().setLastModified( 1000L ) );
+        assertEquals( 1000L, snap.getFile().lastModified() );         
 
         artifacts.add( snap );
 
@@ -607,16 +605,13 @@ public class TestCopyDependenciesMojo
 
         File copiedFile = new File( mojo.outputDirectory, DependencyUtil.getFormattedFileName( snap, false ) );
 
-        Thread.sleep( 100 );
-        // round up to the next second
-        long time = System.currentTimeMillis() + 1000;
-        time = time - ( time % 1000 );
-        assertTrue( copiedFile.setLastModified( time ) );
-        Thread.sleep( 100 );
+        assertTrue( copiedFile.setLastModified( 2000L ) );
+        assertEquals( 2000L, copiedFile.lastModified() );
 
         mojo.execute();
 
-        assertEquals( time, copiedFile.lastModified() );
+        long timeCopyNow = copiedFile.lastModified();
+        assertEquals( 1000L, timeCopyNow );
     }
 
     public void testOverWriteSnap()

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