You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by sj...@apache.org on 2009/01/22 14:59:17 UTC
svn commit: r736644 - in
/harmony/enhanced/classlib/trunk/modules/pack200/src/test:
java/org/apache/harmony/pack200/tests/ArchiveTest.java
resources/org/apache/harmony/pack200/tests/annotationsUnpacked.jar
Author: sjanuary
Date: Thu Jan 22 05:59:16 2009
New Revision: 736644
URL: http://svn.apache.org/viewvc?rev=736644&view=rev
Log:
Pack200 - test for annotations support
Added:
harmony/enhanced/classlib/trunk/modules/pack200/src/test/resources/org/apache/harmony/pack200/tests/annotationsUnpacked.jar (with props)
Modified:
harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ArchiveTest.java
Modified: harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ArchiveTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ArchiveTest.java?rev=736644&r1=736643&r2=736644&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ArchiveTest.java (original)
+++ harmony/enhanced/classlib/trunk/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/ArchiveTest.java Thu Jan 22 05:59:16 2009
@@ -192,6 +192,32 @@
out.close();
}
+ public void testAnnotations() throws IOException, Pack200Exception,
+ URISyntaxException {
+ in = new JarInputStream(
+ Archive.class
+ .getResourceAsStream("/org/apache/harmony/pack200/tests/annotationsUnpacked.jar"));
+ file = File.createTempFile("annotations", ".pack");
+ out = new FileOutputStream(file);
+ new Archive(in, out, false).pack();
+ in.close();
+ out.close();
+
+ // now unpack
+ InputStream in2 = new FileInputStream(file);
+ File file2 = File.createTempFile("annotationsout", ".jar");
+ JarOutputStream out2 = new JarOutputStream(new FileOutputStream(file2));
+ org.apache.harmony.unpack200.Archive archive = new org.apache.harmony.unpack200.Archive(
+ in2, out2);
+ archive.unpack();
+ JarFile jarFile = new JarFile(file2);
+ file2.deleteOnExit();
+ JarFile jarFile2 = new JarFile(new File(Archive.class.getResource(
+ "/org/apache/harmony/pack200/tests/annotationsUnpacked.jar").toURI()));
+
+ compareFiles(jarFile, jarFile2);
+ }
+
private void compareFiles(JarFile jarFile, JarFile jarFile2)
throws IOException {
Enumeration entries = jarFile.entries();
Added: harmony/enhanced/classlib/trunk/modules/pack200/src/test/resources/org/apache/harmony/pack200/tests/annotationsUnpacked.jar
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/pack200/src/test/resources/org/apache/harmony/pack200/tests/annotationsUnpacked.jar?rev=736644&view=auto
==============================================================================
Binary file - no diff available.
Propchange: harmony/enhanced/classlib/trunk/modules/pack200/src/test/resources/org/apache/harmony/pack200/tests/annotationsUnpacked.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream