public void testWebappVersionedResource() throws Exception { ClientResourceInfo resource = (ClientResourceInfo) manager.findResource(null, "duke.gif", "image/gif", getFacesContext()); assertTrue(resource != null); assertTrue(resource.getLibraryInfo() == null); assertTrue(resource.getHelper() instanceof WebappResourceHelper); assertTrue(!resource.isCompressable()); assertTrue(resource.getCompressedPath() == null); assertTrue("1_1".equals(resource.getVersion().toString())); assertTrue("duke.gif".equals(resource.getName())); assertTrue("/resources/duke.gif/1_1.gif".equals(resource.getPath())); }
public void testJarNonVersionedResources() throws Exception { ClientResourceInfo resource = (ClientResourceInfo) manager.findResource(null, "duke-jar-nv.gif", "image/gif", getFacesContext()); assertTrue(resource != null); assertTrue(resource.getLibraryInfo() == null); assertTrue(resource.getHelper() instanceof ClasspathResourceHelper); assertTrue(resource.getVersion() == null); assertTrue(!resource.isCompressable()); assertTrue(resource.getCompressedPath() == null); assertTrue("duke-jar-nv.gif".equals(resource.getName())); assertTrue("META-INF/resources/duke-jar-nv.gif".equals(resource.getPath())); }
public void testWebappVersionedLibraryNonVersionedResource() throws Exception { ClientResourceInfo resource = (ClientResourceInfo) manager.findResource("vLibrary", "duke-nv.gif", "image/gif", getFacesContext()); assertTrue(resource != null); // validate the library assertTrue(resource.getLibraryInfo() != null); assertTrue("vLibrary".equals(resource.getLibraryInfo().getName())); assertTrue("2_0".equals(resource.getLibraryInfo().getVersion().toString())); assertTrue(resource.getLibraryInfo().getHelper() instanceof WebappResourceHelper); assertTrue("/resources/vLibrary/2_0".equals(resource.getLibraryInfo().getPath())); // validate the resource assertTrue(resource.getHelper() instanceof WebappResourceHelper); assertTrue(!resource.isCompressable()); assertTrue(resource.getCompressedPath() == null); assertTrue(resource.getVersion() == null); assertTrue("duke-nv.gif".equals(resource.getName())); assertTrue("/resources/vLibrary/2_0/duke-nv.gif".equals(resource.getPath())); }