* @throws Exception for any error
*/
public void testNotAnArchive() throws Exception
{
URL url = getResource("/vfs/context/jar/");
FileSystemContext ctx = new FileSystemContext(url);
// we just do basic sanity checks
// valid archive
VirtualFileHandler handler = ctx.getRoot().getChild("archive.jar");
//assertTrue("is vfszip", "vfszip".equals(handler.toURL().getProtocol()));
assertFalse("is leaf", handler.isLeaf());
assertTrue("exists", handler.exists());
assertNotNull("pathName not null", handler.getPathName());
assertNotNull("name not null", handler.getName());
assertNotNull("parent not null", handler.getParent());
assertTrue("lastModified > 0", handler.getLastModified() > 0);
assertTrue("size > 0", handler.getSize() > 0);
assertNotNull("VF not null", handler.getVirtualFile());
assertFalse("hasBeenModified == false", handler.hasBeenModified());
assertFalse("hidden == false", handler.isHidden());
assertFalse("nested == false", handler.isNested());
assertNotNull("toURI not null", handler.toURI());
assertNotNull("toURL not null", handler.toURL());
assertNotNull("toVfsUrl not null", handler.toVfsUrl());
ByteArrayOutputStream memOut = new ByteArrayOutputStream();
VFSUtils.copyStreamAndClose(handler.openStream(), memOut);
assertTrue("read archive content", memOut.size() == handler.getSize());
// invalid archive
handler = ctx.getRoot().getChild("notanarchive.jar");
//assertTrue("is leaf", handler.isLeaf());
assertTrue("exists", handler.exists());
assertTrue("lastModified > 0", handler.getLastModified() > 0);
assertNotNull("pathName not null", handler.getPathName());
assertNotNull("name not null", handler.getName());