// Don't pass any
in = new JarFile(new File(Archive.class
.getResource("/org/apache/harmony/pack200/tests/sqlUnpacked.jar").toURI()));
File file0 = File.createTempFile("sql", ".pack");
out = new FileOutputStream(file0);
PackingOptions options = new PackingOptions();
options.setGzip(false);
Archive archive = new Archive(in, out, options);
archive.pack();
in.close();
out.close();
// Pass one file
in = new JarFile(new File(Archive.class
.getResource("/org/apache/harmony/pack200/tests/sqlUnpacked.jar").toURI()));
file = File.createTempFile("sql", ".pack");
out = new FileOutputStream(file);
options = new PackingOptions();
options.setGzip(false);
options.addPassFile("bin/test/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.class");
assertTrue(options.isPassFile("bin/test/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.class"));
archive = new Archive(in, out, options);
archive.pack();
in.close();
out.close();
// Pass a whole directory
in = new JarFile(new File(Archive.class
.getResource("/org/apache/harmony/pack200/tests/sqlUnpacked.jar").toURI()));
File file2 = File.createTempFile("sql", ".pack");
out = new FileOutputStream(file2);
options = new PackingOptions();
options.setGzip(false);
options.addPassFile("bin/test/org/apache/harmony/sql/tests/java/sql");
assertTrue(options.isPassFile("bin/test/org/apache/harmony/sql/tests/java/sql/DatabaseMetaDataTest.class"));
assertFalse(options.isPassFile("bin/test/org/apache/harmony/sql/tests/java/sqldata/SqlData.class"));
archive = new Archive(in, out, options);
archive.pack();
in.close();
out.close();