use of org.apache.catalina.WebResource in project tomcat by apache.
the class TestAbstractArchiveResourceSet method testBloomFilterWithDirectory.
/*
* https://bz.apache.org/bugzilla/show_bug.cgi?id=65586
*/
@Test
public void testBloomFilterWithDirectory() {
WebResourceRoot root = new TesterWebResourceRoot();
root.getContext().setUseBloomFilterForArchives(true);
File file = new File("webapps/examples/WEB-INF/lib/taglibs-standard-impl-1.2.5-migrated-0.0.1.jar");
JarResourceSet jarResourceSet = new JarResourceSet(root, "/WEB-INF/classes", file.getAbsolutePath(), "/");
jarResourceSet.getArchiveEntries(false);
WebResource r1 = jarResourceSet.getResource("/WEB-INF/classes/org/");
Assert.assertTrue(r1.isDirectory());
WebResource r2 = jarResourceSet.getResource("/WEB-INF/classes/org");
Assert.assertTrue(r2.isDirectory());
}
use of org.apache.catalina.WebResource in project tomcat by apache.
the class AbstractTestResourceSet method testGetManifest.
// ----------------------------------------------------------- getManifest()
@Test
public final void testGetManifest() {
WebResource exists = resourceRoot.getResource(getMount() + "/d1/d1-f1.txt");
boolean manifestExists = resourceRoot.getResource("/META-INF/MANIFEST.MF").exists();
Manifest m = exists.getManifest();
if (getMount().equals("") && manifestExists) {
Assert.assertNotNull(m);
} else {
Assert.assertNull(m);
}
}
Aggregations