aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/ijar/test
diff options
context:
space:
mode:
authorGravatar cushon <cushon@google.com>2018-02-12 08:28:15 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2018-02-12 08:29:43 -0800
commit584f9dffbad34a0f86bd1bc9c5cd9dbbbaa25146 (patch)
tree2d24af8c5356b2a80a402ca8856f8828f0133b7a /third_party/ijar/test
parent33ca88f7a757d9c5c103e539fd097abdd613b037 (diff)
Use a different date time when normalizing zip entries
PiperOrigin-RevId: 185381597
Diffstat (limited to 'third_party/ijar/test')
-rw-r--r--third_party/ijar/test/IjarTests.java6
-rwxr-xr-xthird_party/ijar/test/ijar_test.sh2
2 files changed, 4 insertions, 4 deletions
diff --git a/third_party/ijar/test/IjarTests.java b/third_party/ijar/test/IjarTests.java
index 467680552b..a2e10db570 100644
--- a/third_party/ijar/test/IjarTests.java
+++ b/third_party/ijar/test/IjarTests.java
@@ -23,11 +23,11 @@ import com.google.common.io.ByteStreams;
import com.google.devtools.build.java.bazel.BazelJavaCompiler;
import java.io.File;
import java.io.IOException;
-import java.time.Instant;
+import java.time.LocalDateTime;
+import java.time.ZoneOffset;
import java.util.Arrays;
import java.util.Collections;
import java.util.Enumeration;
-import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
@@ -289,7 +289,7 @@ public class IjarTests {
assertThat(attributes.getValue("Injecting-Rule-Kind")).isEqualTo("foo_library");
assertThat(jf.getEntry(JarFile.MANIFEST_NAME).getLastModifiedTime().toInstant())
.isEqualTo(
- Instant.ofEpochMilli(new GregorianCalendar(1980, 0, 1, 0, 0, 0).getTimeInMillis()));
+ LocalDateTime.of(2010, 1, 1, 0, 0, 0).atZone(ZoneOffset.systemDefault()).toInstant());
}
}
}
diff --git a/third_party/ijar/test/ijar_test.sh b/third_party/ijar/test/ijar_test.sh
index eacf6e42bb..1a4959da24 100755
--- a/third_party/ijar/test/ijar_test.sh
+++ b/third_party/ijar/test/ijar_test.sh
@@ -230,7 +230,7 @@ function test_ijar_output() {
# Check that -interface.jar timestamps are normalized:
check_eq 0 $(TZ=UTC $JAR tvf $A_INTERFACE_JAR |
- grep -v 'Tue Jan 01 00:00:00 UTC 1980' | wc -l) \
+ grep -v 'Fri Jan 01 00:00:00 UTC 2010' | wc -l) \
"Interface jar contained non-zero timestamps!"