[jboss-cvs] JBossAS SVN: r57721 - in projects/microcontainer/trunk/container/src: main/org/jboss/virtual main/org/jboss/virtual/plugins/context main/org/jboss/virtual/spi tests/org/jboss/test/virtual/support tests/org/jboss/test/virtual/test
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Oct 19 00:01:37 EDT 2006
Author: scott.stark at jboss.org
Date: 2006-10-19 00:01:29 -0400 (Thu, 19 Oct 2006)
New Revision: 57721
Modified:
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/VirtualFile.java
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/DelegatingHandler.java
projects/microcontainer/trunk/container/src/main/org/jboss/virtual/spi/VirtualFileHandler.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/AbstractMockVirtualFileHandler.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/AbstractVirtualFileHandlerTest.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/FileVFSUnitTestCase.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/SundryVFSUnitTestCase.java
projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/VirtualFileUnitTestCase.java
Log:
Drop the isArchive attribute on VirtualFile
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/VirtualFile.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/VirtualFile.java 2006-10-19 03:41:03 UTC (rev 57720)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/VirtualFile.java 2006-10-19 04:01:29 UTC (rev 57721)
@@ -170,20 +170,6 @@
}
/**
- * Whether it is an archive<p>
- *
- * NOTE: a file system directory can be an archive if it looks like an unpacked archive
- *
- * @return true when an archive
- * @throws IOException for any problem accessing the virtual file system
- * @throws IllegalStateException if the file is closed
- */
- public boolean isArchive() throws IOException
- {
- return getHandler().isArchive();
- }
-
- /**
* Whether it is hidden
*
* @return true when hidden
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/DelegatingHandler.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/DelegatingHandler.java 2006-10-19 03:41:03 UTC (rev 57720)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/plugins/context/DelegatingHandler.java 2006-10-19 04:01:29 UTC (rev 57721)
@@ -84,11 +84,6 @@
return delegate.getSize();
}
- public boolean isArchive() throws IOException
- {
- return delegate.isArchive();
- }
-
public boolean isLeaf() throws IOException
{
return delegate.isLeaf();
Modified: projects/microcontainer/trunk/container/src/main/org/jboss/virtual/spi/VirtualFileHandler.java
===================================================================
--- projects/microcontainer/trunk/container/src/main/org/jboss/virtual/spi/VirtualFileHandler.java 2006-10-19 03:41:03 UTC (rev 57720)
+++ projects/microcontainer/trunk/container/src/main/org/jboss/virtual/spi/VirtualFileHandler.java 2006-10-19 04:01:29 UTC (rev 57721)
@@ -101,17 +101,6 @@
boolean isLeaf() throws IOException;
/**
- * Whether it is an archive<p>
- *
- * NOTE: a file system directory can be an archive if it looks like an unpacked archive
- *
- * @return true when an archive
- * @throws IOException for any problem accessing the virtual file system
- * @throws IllegalStateException if the file is closed
- */
- boolean isArchive() throws IOException;
-
- /**
* Whether it is hidden
*
* @return true if hidden.
Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/AbstractMockVirtualFileHandler.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/AbstractMockVirtualFileHandler.java 2006-10-19 03:41:03 UTC (rev 57720)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/support/AbstractMockVirtualFileHandler.java 2006-10-19 04:01:29 UTC (rev 57721)
@@ -63,9 +63,6 @@
/** Is a leaf */
private boolean leaf = true;
- /** Is an archive */
- private boolean archive;
-
/** Is a hidden */
private boolean hidden;
@@ -191,23 +188,6 @@
this.size = size;
}
- public boolean isArchive() throws IOException
- {
- checkClosed();
- throwIOException("isArchive");
- return archive;
- }
-
- /**
- * Set the archive.
- *
- * @param archive the archive.
- */
- public void setArchive(boolean archive)
- {
- this.archive = archive;
- }
-
public boolean isLeaf() throws IOException
{
checkClosed();
Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/AbstractVirtualFileHandlerTest.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/AbstractVirtualFileHandlerTest.java 2006-10-19 03:41:03 UTC (rev 57720)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/AbstractVirtualFileHandlerTest.java 2006-10-19 04:01:29 UTC (rev 57721)
@@ -275,38 +275,6 @@
}
}
- public void testRootIsArchive() throws Exception
- {
- VFSContext context = getVFSContext("archive.jar");
- VirtualFileHandler root = context.getRoot();
- assertTrue(root.isArchive());
- }
-
- public void testChildIsArchive() throws Exception
- {
- VFSContext context = getVFSContext("archive.jar");
- VirtualFileHandler root = context.getRoot();
- VirtualFileHandler child = context.findChild(root, "child");
- assertFalse(child.isArchive());
- }
-
- public void testIsArchiveClosed() throws Exception
- {
- VFSContext context = getVFSContext("simple");
- VirtualFileHandler root = context.getRoot();
- VirtualFileHandler child = context.findChild(root, "child");
- child.close();
- try
- {
- child.isArchive();
- fail("Should not be here!");
- }
- catch (Throwable t)
- {
- checkThrowable(IllegalStateException.class, t);
- }
- }
-
// TODO how to test a real hidden file across platforms?
public void testRootIsHidden() throws Exception
{
@@ -611,7 +579,6 @@
assertEquals(handler.getVFSContext().getVFS(), file.getVFS());
assertEquals(handler.getName(), file.getName());
assertEquals(handler.getPathName(), file.getPathName());
- assertEquals(handler.isArchive(), file.isArchive());
assertEquals(handler.isHidden(), file.isHidden());
assertEquals(handler.isLeaf(), file.isLeaf());
assertEquals(handler.getLastModified(), file.getLastModified());
Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/FileVFSUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/FileVFSUnitTestCase.java 2006-10-19 03:41:03 UTC (rev 57720)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/FileVFSUnitTestCase.java 2006-10-19 04:01:29 UTC (rev 57721)
@@ -1,9 +1,24 @@
/*
-* JBoss, the OpenSource J2EE webOS
-*
-* Distributable under LGPL license.
-* See terms of license at gnu.org.
-*/
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.test.virtual.test;
import java.io.File;
@@ -372,7 +387,6 @@
assertEquals("lastModified", lastModified, tmpVF.getLastModified());
assertEquals("size", size, tmpVF.getSize());
assertEquals("url", url, tmpVF.toURL());
- assertEquals("isArchive", false, tmpVF.isArchive());
assertEquals("isLeaf", true, tmpVF.isLeaf());
assertEquals("isHidden", false, tmpVF.isHidden());
@@ -387,7 +401,6 @@
assertEquals("lastModified", lastModified, tmpVF2.getLastModified());
assertEquals("size", size, tmpVF2.getSize());
assertEquals("url", url, tmpVF2.toURL());
- assertEquals("isArchive", false, tmpVF2.isArchive());
assertEquals("isLeaf", true, tmpVF2.isLeaf());
assertEquals("isHidden", false, tmpVF2.isHidden());
}
@@ -443,7 +456,6 @@
assertEquals("lastModified", lastModified, tmpVF.getLastModified());
assertEquals("size", size, tmpVF.getSize());
assertEquals("url", url, tmpVF.toURL());
- assertEquals("isArchive", true, tmpVF.isArchive());
// TODO: these should pass
//assertEquals("isFile", true, tmpVF.isFile());
//assertEquals("isDirectory", false, tmpVF.isDirectory());
@@ -465,7 +477,6 @@
assertEquals("lastModified", lastModified, tmpVF2.getLastModified());
assertEquals("size", size, tmpVF2.getSize());
assertEquals("url", url, tmpVF2.toURL());
- assertEquals("isArchive", true, tmpVF2.isArchive());
// TODO: these should pass
//assertEquals("isFile", true, tmpVF2.isFile());
//assertEquals("isDirectory", false, tmpVF2.isDirectory());
Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/SundryVFSUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/SundryVFSUnitTestCase.java 2006-10-19 03:41:03 UTC (rev 57720)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/SundryVFSUnitTestCase.java 2006-10-19 04:01:29 UTC (rev 57721)
@@ -60,7 +60,7 @@
{
VirtualFile file = getVirtualFile("/vfs/sundry", "jar/archive.jar");
log.debug(file.getName() + " " + file);
- assertTrue("Should be an archive", file.isArchive());
+ assertFalse("Should not be a leaf", file.isLeaf());
file = file.findChild("empty");
log.debug(file.getName() + " " + file);
}
@@ -69,7 +69,7 @@
{
VirtualFile file = getVirtualFile("/vfs/sundry/", "jar/archive.jar");
log.debug(file.getName() + " " + file);
- assertTrue("Should be an archive", file.isArchive());
+ assertFalse("Should not be a leaf", file.isLeaf());
file = file.findChild("empty");
log.debug(file.getName() + " " + file);
}
@@ -81,7 +81,7 @@
VFS vfs = VFS.getVFS(url);
VirtualFile file = vfs.getRoot();
log.debug(file.getName() + " " + file);
- assertTrue("Should be an archive", file.isArchive());
+ assertFalse("Should not be a leaf", file.isLeaf());
file = file.findChild("empty");
log.debug(file.getName() + " " + file);
}
Modified: projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/VirtualFileUnitTestCase.java
===================================================================
--- projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/VirtualFileUnitTestCase.java 2006-10-19 03:41:03 UTC (rev 57720)
+++ projects/microcontainer/trunk/container/src/tests/org/jboss/test/virtual/test/VirtualFileUnitTestCase.java 2006-10-19 04:01:29 UTC (rev 57721)
@@ -296,52 +296,6 @@
}
}
- public void testIsArchive() throws Exception
- {
- MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setArchive(true);
-
- VirtualFile file = VFS.getRoot(context.getRootURI());
- assertEquals(true, file.isArchive());
-
- context.getMockRoot().setArchive(false);
- assertEquals(false, file.isArchive());
- }
-
- public void testIsArchiveIOException() throws Exception
- {
- MockVFSContext context = registerSimpleVFSContext();
- context.getMockRoot().setIOException("isArchive");
-
- VirtualFile file = VFS.getRoot(context.getRootURI());
- try
- {
- file.isArchive();
- fail("Should not be here");
- }
- catch (Throwable t)
- {
- checkThrowable(IOException.class, t);
- }
- }
-
- public void testIsArchiveClosed() throws Exception
- {
- MockVFSContext context = registerSimpleVFSContext();
-
- VirtualFile file = VFS.getRoot(context.getRootURI());
- file.close();
- try
- {
- file.isArchive();
- fail("Should not be here");
- }
- catch (Throwable t)
- {
- checkThrowable(IllegalStateException.class, t);
- }
- }
-
public void testIsHidden() throws Exception
{
MockVFSContext context = registerSimpleVFSContext();
More information about the jboss-cvs-commits
mailing list