adammurdoch 2003/02/21 05:18:18
Modified: vfs/src/test/org/apache/commons/vfs/provider/test
JunctionTests.java
vfs/src/test/org/apache/commons/vfs/test NamingTests.java
ProviderTestSuite.java
Added: vfs/src/test/org/apache/commons/vfs/test UriTests.java
Log:
Split out the naming tests that require URI capability into a separate testcase. Now
the tests all pass for the virtual provider.
Revision Changes Path
1.4 +2 -1
jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/test/JunctionTests.java
Index: JunctionTests.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/provider/test/JunctionTests.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- JunctionTests.java 13 Feb 2003 04:28:46 -0000 1.3
+++ JunctionTests.java 21 Feb 2003 13:18:17 -0000 1.4
@@ -74,6 +74,7 @@
private FileObject getBaseDir() throws FileSystemException
{
final File file = AbstractVfsTestCase.getTestDirectory();
+ assertTrue( file.exists() );
return getManager().toFileObject( file );
}
1.3 +1 -22
jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/test/NamingTests.java
Index: NamingTests.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/test/NamingTests.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NamingTests.java 12 Feb 2003 07:44:16 -0000 1.2
+++ NamingTests.java 21 Feb 2003 13:18:17 -0000 1.3
@@ -72,27 +72,6 @@
extends AbstractProviderTestCase
{
/**
- * Tests resolution of absolute URI.
- */
- public void testAbsoluteURI() throws Exception
- {
- final FileObject readFolder = getReadFolder();
-
- // Try fetching base folder again by its URI
- final String uri = readFolder.getName().getURI();
- FileObject file = getManager().resolveFile( uri );
- assertSame( "file object", readFolder, file );
-
- // Try fetching the filesystem root by its URI
- final String rootUri = readFolder.getName().getRootURI();
- file = getManager().resolveFile( rootUri );
- assertSame( readFolder.getFileSystem().getRoot(), file );
- assertEquals( rootUri, file.getName().getRootURI() );
- assertEquals( rootUri, file.getName().getURI() );
- assertEquals( FileName.ROOT_PATH, file.getName().getPath() );
- }
-
- /**
* Tests resolution of relative file names via the FS manager
*/
public void testRelativeURI() throws Exception
1.10 +2 -1
jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/test/ProviderTestSuite.java
Index: ProviderTestSuite.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/test/ProviderTestSuite.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ProviderTestSuite.java 21 Feb 2003 05:13:59 -0000 1.9
+++ ProviderTestSuite.java 21 Feb 2003 13:18:18 -0000 1.10
@@ -121,6 +121,7 @@
*/
private void addBaseTests() throws Exception
{
+ addTests( UriTests.class );
addTests( NamingTests.class );
addTests( ContentTests.class );
addTests( ProviderReadTests.class );
1.1
jakarta-commons-sandbox/vfs/src/test/org/apache/commons/vfs/test/UriTests.java
Index: UriTests.java
===================================================================
/* ====================================================================
*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution, if
* any, must include the following acknowlegement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowlegement may appear in the software itself,
* if and wherever such third-party acknowlegements normally appear.
*
* 4. The names "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact [EMAIL PROTECTED]
*
* 5. Products derived from this software may not be called "Apache"
* nor may "Apache" appear in their names without prior written
* permission of the Apache Group.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package org.apache.commons.vfs.test;
import org.apache.commons.vfs.FileObject;
import org.apache.commons.vfs.FileName;
import org.apache.commons.vfs.Capability;
/**
* Absolute URI test cases.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Adam Murdoch</a>
* @version $Revision: 1.1 $ $Date: 2003/02/21 13:18:18 $
*/
public class UriTests
extends AbstractProviderTestCase
{
/**
* Returns the capabilities required by the tests of this test case.
*/
protected Capability[] getRequiredCaps()
{
return new Capability[]{Capability.URI};
}
/**
* Tests resolution of absolute URI.
*/
public void testAbsoluteURI() throws Exception
{
final FileObject readFolder = getReadFolder();
// Try fetching base folder again by its URI
final String uri = readFolder.getName().getURI();
FileObject file = getManager().resolveFile( uri );
assertSame( "file object", readFolder, file );
// Try fetching the filesystem root by its URI
final String rootUri = readFolder.getName().getRootURI();
file = getManager().resolveFile( rootUri );
assertSame( readFolder.getFileSystem().getRoot(), file );
assertEquals( rootUri, file.getName().getRootURI() );
assertEquals( rootUri, file.getName().getURI() );
assertEquals( FileName.ROOT_PATH, file.getName().getPath() );
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]