fix broken unit test because getting the last modified time is a time zone dependent thing and we don't _all_ live in germany and italy

This commit is contained in:
Jesse McConnell 2012-05-22 13:57:58 -05:00
parent b371315606
commit 32f8900040
1 changed files with 11 additions and 1 deletions

View File

@ -24,11 +24,15 @@ import java.io.FilenameFilter;
import java.io.InputStream;
import java.net.URI;
import java.net.URL;
import java.sql.Time;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import java.util.TimeZone;
import java.util.zip.ZipFile;
import org.eclipse.jetty.toolchain.test.MavenTestingUtils;
import org.eclipse.jetty.toolchain.test.OS;
import org.eclipse.jetty.util.IO;
import org.junit.BeforeClass;
@ -317,8 +321,14 @@ public class ResourceTest
throws Exception
{
String s = "jar:"+__userURL+"TestData/test.zip!/subdir/numbers";
// TODO move this into src/test/resources!!!
ZipFile zf = new ZipFile(MavenTestingUtils.getProjectFile("src/test/java/org/eclipse/jetty/util/resource/TestData/test.zip"));
long last = zf.getEntry("subdir/numbers").getTime();
Resource r = Resource.newResource(s);
assertEquals(971425252000L,r.lastModified()); // Known date value inside zip
assertEquals(last,r.lastModified()); // Known date value inside zip
}
/* ------------------------------------------------------------ */