From c59ef6d44f31eda55192d12e17f3d19d06a0729d Mon Sep 17 00:00:00 2001 From: Brett Porter Date: Wed, 15 Mar 2006 21:42:31 +0000 Subject: [PATCH] make test case portable git-svn-id: https://svn.apache.org/repos/asf/maven/repository-manager/trunk@386172 13f79535-47bb-0310-9956-ffa450edef68 --- .../repository/converter/RepositoryConverterTest.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/maven-repository-converter/src/test/java/org/apache/maven/repository/converter/RepositoryConverterTest.java b/maven-repository-converter/src/test/java/org/apache/maven/repository/converter/RepositoryConverterTest.java index 74f8ee56c..ddd062fba 100644 --- a/maven-repository-converter/src/test/java/org/apache/maven/repository/converter/RepositoryConverterTest.java +++ b/maven-repository-converter/src/test/java/org/apache/maven/repository/converter/RepositoryConverterTest.java @@ -34,6 +34,7 @@ import org.codehaus.plexus.util.FileUtils; import java.io.File; import java.io.IOException; import java.net.MalformedURLException; +import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -583,11 +584,9 @@ public class RepositoryConverterTest long origTime = targetFile.lastModified(); long origPomTime = targetPomFile.lastModified(); - sourceFile.setLastModified( System.currentTimeMillis() ); - sourcePomFile.setLastModified( System.currentTimeMillis() ); - - // Need to guarantee last modified is not equal - Thread.sleep( SLEEP_MILLIS ); + SimpleDateFormat dateFormat = new SimpleDateFormat( "yyyy-MM-dd" ); + sourceFile.setLastModified( dateFormat.parse( "2006-01-01" ).getTime() ); + sourcePomFile.setLastModified( dateFormat.parse( "2006-02-02" ).getTime() ); repositoryConverter.convert( artifact, targetRepository, reporter ); checkSuccess();