diff options
author | cushon <cushon@google.com> | 2018-03-21 20:30:12 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-03-21 20:32:06 -0700 |
commit | f572845d04c579e81b2dc78e8efeea12dc7dbee7 (patch) | |
tree | 068525bf67cfaec5ed1c4d384b9de7dd0c0b0da5 /third_party/ijar/test/IjarTests.java | |
parent | 2410e1ab3e035382abe519003c618271a69a7b8e (diff) |
Include manifest size when presizing ijar output
PiperOrigin-RevId: 190010996
Diffstat (limited to 'third_party/ijar/test/IjarTests.java')
-rw-r--r-- | third_party/ijar/test/IjarTests.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/third_party/ijar/test/IjarTests.java b/third_party/ijar/test/IjarTests.java index a2e10db570..dc6c02062a 100644 --- a/third_party/ijar/test/IjarTests.java +++ b/third_party/ijar/test/IjarTests.java @@ -292,4 +292,16 @@ public class IjarTests { LocalDateTime.of(2010, 1, 1, 0, 0, 0).atZone(ZoneOffset.systemDefault()).toInstant()); } } + + @Test + public void testEmptyWithTargetLabel() throws Exception { + try (JarFile jf = new JarFile("third_party/ijar/test/empty_with_target_label.jar")) { + Manifest manifest = jf.getManifest(); + Attributes attributes = manifest.getMainAttributes(); + assertThat(attributes.getValue("Target-Label")).isEqualTo("//empty"); + assertThat(jf.getEntry(JarFile.MANIFEST_NAME).getLastModifiedTime().toInstant()) + .isEqualTo( + LocalDateTime.of(2010, 1, 1, 0, 0, 0).atZone(ZoneOffset.systemDefault()).toInstant()); + } + } } |