felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1587621 - /felix/trunk/deploymentadmin/deploymentadmin/src/test/java/org/apache/felix/deploymentadmin/ContentCopyingJarInputStreamTest.java
Date Tue, 15 Apr 2014 15:45:50 GMT
Author: jawi
Date: Tue Apr 15 15:45:50 2014
New Revision: 1587621

URL: http://svn.apache.org/r1587621
Log:
Rewrote the test to include a manifest.


Modified:
    felix/trunk/deploymentadmin/deploymentadmin/src/test/java/org/apache/felix/deploymentadmin/ContentCopyingJarInputStreamTest.java

Modified: felix/trunk/deploymentadmin/deploymentadmin/src/test/java/org/apache/felix/deploymentadmin/ContentCopyingJarInputStreamTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/deploymentadmin/deploymentadmin/src/test/java/org/apache/felix/deploymentadmin/ContentCopyingJarInputStreamTest.java?rev=1587621&r1=1587620&r2=1587621&view=diff
==============================================================================
--- felix/trunk/deploymentadmin/deploymentadmin/src/test/java/org/apache/felix/deploymentadmin/ContentCopyingJarInputStreamTest.java
(original)
+++ felix/trunk/deploymentadmin/deploymentadmin/src/test/java/org/apache/felix/deploymentadmin/ContentCopyingJarInputStreamTest.java
Tue Apr 15 15:45:50 2014
@@ -39,19 +39,20 @@ public class ContentCopyingJarInputStrea
 {
     private static final String MANIFEST_NAME = JarFile.MANIFEST_NAME;
     private static final String INDEX_NAME = "META-INF/INDEX.LIST";
-    
+
     private File m_tempDir;
     private File m_jarFile;
 
     /**
-     * Tests that we can copy a simple {@link JarInputStream}. 
+     * Tests that we can copy a {@link JarInputStream} containing only a manifest. 
      */
-    public void disabledTestCopyEmptyJarOk() throws Exception
+    public void testCopyEmptyJarWithManifestOnlyOk() throws Exception
     {
-        // DISABLED because it fails on JDK6, but succeeds on JDK7?!
-        createEmptyJar();
+        Manifest man = createManifest();
+
+        createEmptyJar(man);
 
-        assertJarContents(null);
+        assertJarContents(man);
     }
 
     /**
@@ -145,7 +146,7 @@ public class ContentCopyingJarInputStrea
 
                 // Without reading the actual contents, the copy should already exist...
                 assertTrue(entry.getName() + " does not exist?!", f.exists());
-                
+
                 int size = (INDEX_NAME.equals(entry.getName()) ? 33 : 1024);
 
                 byte[] input = new byte[size];
@@ -166,10 +167,11 @@ public class ContentCopyingJarInputStrea
             jis.close();
         }
     }
-    
-    private void createEmptyJar() throws IOException {
+
+    private void createEmptyJar(Manifest man) throws IOException
+    {
         FileOutputStream fos = new FileOutputStream(m_jarFile);
-        JarOutputStream jos = new JarOutputStream(fos);
+        JarOutputStream jos = new JarOutputStream(fos, man);
         jos.close();
     }
 



Mime
View raw message