@@ -96,6 +96,8 @@ public void testConcatAndMerged(String name) {
9696 assertNotEquals (stdHello , jvmHello );
9797 String stdHelloRaw = ByteDataUtil .toString (ZipCompressions .decompress (stdHello ));
9898 String jvmHelloRaw = ByteDataUtil .toString (ZipCompressions .decompress (jvmHello ));
99+ assertFalse (stdHelloRaw .isEmpty ());
100+ assertFalse (jvmHelloRaw .isEmpty ());
99101 assertTrue (stdHelloRaw .contains ("Hello world" ));
100102 assertTrue (jvmHelloRaw .contains ("The secret code is: ROSE" ));
101103 } catch (IOException ex ) {
@@ -115,6 +117,7 @@ public void testLocalHeaderDetectMismatch() {
115117
116118 LocalFileHeader hello = zipStd .getLocalFileByName ("Hello.class" );
117119 assertNotNull (hello );
120+ assertEquals (0 , hello .getFileData ().length ()); // Should be empty
118121
119122 // The local file header says the contents are 0 bytes, but the central header has the real length
120123 assertTrue (hello .hasDifferentValuesThanCentralDirectoryHeader ());
@@ -128,11 +131,12 @@ public void postProcessLocalFileHeader(@Nonnull LocalFileHeader file) {
128131 });
129132 LocalFileHeader helloAdopted = zipStdAndAdopt .getLocalFileByName ("Hello.class" );
130133 assertFalse (helloAdopted .hasDifferentValuesThanCentralDirectoryHeader ());
134+ assertNotEquals (0 , helloAdopted .getFileData ().length ()); // Should have data
131135
132- // Alternatively, just use the JVM strategy
136+ // The JVM strategy copies most properties, except for size.
133137 ZipArchive zipJvm = ZipIO .readJvm (path );
134138 helloAdopted = zipJvm .getLocalFileByName ("Hello.class" );
135- assertFalse ( helloAdopted .hasDifferentValuesThanCentralDirectoryHeader ());
139+ assertNotEquals ( 0 , helloAdopted .getFileData (). length ()); // Should have data, even if not sourced from values in the CEN
136140 } catch (IOException ex ) {
137141 fail (ex );
138142 }
0 commit comments