@ -79,6 +79,7 @@ public class JarFileTests {
public void jdkJarFile ( ) throws Exception {
public void jdkJarFile ( ) throws Exception {
// Sanity checks to see how the default jar file operates
// Sanity checks to see how the default jar file operates
java . util . jar . JarFile jarFile = new java . util . jar . JarFile ( this . rootJarFile ) ;
java . util . jar . JarFile jarFile = new java . util . jar . JarFile ( this . rootJarFile ) ;
assertThat ( jarFile . getComment ( ) ) . isEqualTo ( "outer" ) ;
Enumeration < java . util . jar . JarEntry > entries = jarFile . entries ( ) ;
Enumeration < java . util . jar . JarEntry > entries = jarFile . entries ( ) ;
assertThat ( entries . nextElement ( ) . getName ( ) ) . isEqualTo ( "META-INF/" ) ;
assertThat ( entries . nextElement ( ) . getName ( ) ) . isEqualTo ( "META-INF/" ) ;
assertThat ( entries . nextElement ( ) . getName ( ) ) . isEqualTo ( "META-INF/MANIFEST.MF" ) ;
assertThat ( entries . nextElement ( ) . getName ( ) ) . isEqualTo ( "META-INF/MANIFEST.MF" ) ;
@ -152,6 +153,11 @@ public class JarFileTests {
assertThat ( entry . getName ( ) ) . isEqualTo ( "1.dat" ) ;
assertThat ( entry . getName ( ) ) . isEqualTo ( "1.dat" ) ;
}
}
@Test
public void getComment ( ) {
assertThat ( this . jarFile . getComment ( ) ) . isEqualTo ( "outer" ) ;
}
@Test
@Test
public void getInputStream ( ) throws Exception {
public void getInputStream ( ) throws Exception {
InputStream inputStream = this . jarFile . getInputStream ( this . jarFile . getEntry ( "1.dat" ) ) ;
InputStream inputStream = this . jarFile . getInputStream ( this . jarFile . getEntry ( "1.dat" ) ) ;
@ -245,6 +251,7 @@ public class JarFileTests {
@Test
@Test
public void getNestedJarFile ( ) throws Exception {
public void getNestedJarFile ( ) throws Exception {
JarFile nestedJarFile = this . jarFile . getNestedJarFile ( this . jarFile . getEntry ( "nested.jar" ) ) ;
JarFile nestedJarFile = this . jarFile . getNestedJarFile ( this . jarFile . getEntry ( "nested.jar" ) ) ;
assertThat ( nestedJarFile . getComment ( ) ) . isEqualTo ( "nested" ) ;
Enumeration < java . util . jar . JarEntry > entries = nestedJarFile . entries ( ) ;
Enumeration < java . util . jar . JarEntry > entries = nestedJarFile . entries ( ) ;
assertThat ( entries . nextElement ( ) . getName ( ) ) . isEqualTo ( "META-INF/" ) ;
assertThat ( entries . nextElement ( ) . getName ( ) ) . isEqualTo ( "META-INF/" ) ;