Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2012-07-19 10:13:21 -0400
committerGlyn Normington2012-07-19 10:13:21 -0400
commit947dde66aa2e254b298726c070dc56da2b6b61ec (patch)
treed51b2f451f34c2203aed9b4602d60bf4d0807124 /org.eclipse.virgo.kernel.artifact
parentda7060cdda709a60779361f6a3c32896202cacfb (diff)
downloadorg.eclipse.virgo.kernel-947dde66aa2e254b298726c070dc56da2b6b61ec.tar.gz
org.eclipse.virgo.kernel-947dde66aa2e254b298726c070dc56da2b6b61ec.tar.xz
org.eclipse.virgo.kernel-947dde66aa2e254b298726c070dc56da2b6b61ec.zip
383874: fix test by replacing duff JAR
Diffstat (limited to 'org.eclipse.virgo.kernel.artifact')
-rw-r--r--org.eclipse.virgo.kernel.artifact/src/test/java/org/eclipse/virgo/kernel/artifact/fs/internal/JarFileArtifactFSTests.java15
-rw-r--r--org.eclipse.virgo.kernel.artifact/src/test/resources/artifacts/bundle.jarbin0 -> 823 bytes
2 files changed, 14 insertions, 1 deletions
diff --git a/org.eclipse.virgo.kernel.artifact/src/test/java/org/eclipse/virgo/kernel/artifact/fs/internal/JarFileArtifactFSTests.java b/org.eclipse.virgo.kernel.artifact/src/test/java/org/eclipse/virgo/kernel/artifact/fs/internal/JarFileArtifactFSTests.java
index 0fefc3e5..6bc33e84 100644
--- a/org.eclipse.virgo.kernel.artifact/src/test/java/org/eclipse/virgo/kernel/artifact/fs/internal/JarFileArtifactFSTests.java
+++ b/org.eclipse.virgo.kernel.artifact/src/test/java/org/eclipse/virgo/kernel/artifact/fs/internal/JarFileArtifactFSTests.java
@@ -14,7 +14,6 @@ package org.eclipse.virgo.kernel.artifact.fs.internal;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
import java.io.File;
import java.io.IOException;
@@ -209,4 +208,18 @@ public class JarFileArtifactFSTests {
File file = this.artifactFS.getFile();
assertEquals("simple.jar", file.getName());
}
+
+ @Test
+ public void testDirectory() {
+ ArtifactFS artifactFS = new JarFileArtifactFS(new File("src/test/resources/artifacts/bundle.jar"));
+ ArtifactFSEntry dir = artifactFS.getEntry("META-INF/spring/");
+ assertTrue(dir.exists());
+ ArtifactFSEntry[] files = dir.getChildren();
+ assertEquals(1, files.length);
+ ArtifactFSEntry entry = files[0];
+ InputStream inputStream = entry.getInputStream();
+ String contents = new Scanner(inputStream).useDelimiter("\\A").next();
+ assertTrue(contents.startsWith("<beans xmlns=\"http://www.springframework.org/schema/beans\""));
+ }
+
}
diff --git a/org.eclipse.virgo.kernel.artifact/src/test/resources/artifacts/bundle.jar b/org.eclipse.virgo.kernel.artifact/src/test/resources/artifacts/bundle.jar
new file mode 100644
index 00000000..1de4b411
--- /dev/null
+++ b/org.eclipse.virgo.kernel.artifact/src/test/resources/artifacts/bundle.jar
Binary files differ

Back to the top