commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Davey <Michael.Da...@coderage.org>
Subject Re: [vfs] How do I run the unit tests?
Date Tue, 09 Mar 2004 01:19:11 GMT
Gary Gregory wrote:

>Hello,
>
>You can run tests individually (TestCase subclasses) from tools like
>Eclipse or you can run the ant or maven build. I cannot recall which
>build I used, ant or maven, it's been a while. 
>
>Be aware that you will need to customize your local copy of
>project.properties in order to test HTTP, FTP, etc. There isn't much
>documentation in that area, you kinda have to figure it out as you go.
>  
>
Thanks for the pointers.  I edited build.xml to remove the <exclude tag that
excludes the entire testsuite, then excluded individual tests.  I ended up
excluding masses:

FtpProviderTestCase
HttpProviderTestCase
SftpProviderTestCase
SmbProviderTestCase
UrlProviderHttpTestCase
WebdavProviderTestCase
ZipProviderTestCase
FileSystemManagerFactoryTestCase
NestedZipTestCase
UrlProviderTestCase
VirtualProviderTestCase
TemporaryProviderTestCase
LocalProviderTestCase
JarProviderTestCase
NestedJarTestCase

I don't understand the nature of most of the tests yet - it might be 
possible to
get some of these working once I understand what the tests are trying to 
test.
I couldn't find any documentation listing an HTTP or FTP url for these vfs
tests, so those cases will be problematic.

Now to the crux of the problem - FileSystemManagerFactoryTestCase fails 
for me:

    [junit] Testsuite: 
org.apache.commons.vfs.test.FileSystemManagerFactoryTestCase
    [junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 2.867 sec

    [junit] Testcase: testDefaultInstance took 0.753 sec
    [junit]     Caused an ERROR
    [junit] Could not create a file system manager of class 
"org.apache.commons.vfs.impl.StandardFileSystemManager".
    [junit] org.apache.commons.vfs.FileSystemException: Could not create 
a file system manager of class 
"org.apache.commons.vfs.impl.StandardFileSystemManager".
    [junit]     at org.apache.commons.vfs.VFS.createManager(VFS.java:90)
    [junit]     at org.apache.commons.vfs.VFS.getManager(VFS.java:46)
    [junit]     at 
org.apache.commons.vfs.test.FileSystemManagerFactoryTestCase.testDefaultInstance(FileSystemManagerFactoryTestCase.java:40)
    [junit]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
    [junit]     at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    [junit]     at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    [junit] Caused by: java.lang.NoClassDefFoundError: 
org/apache/commons/httpclient/ConnectionInterceptor
    [junit]     at java.lang.ClassLoader.defineClass0(Native Method)
{snip}
    [junit]     at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
    [junit]     at 
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
    [junit]     at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
    [junit]     at 
org.apache.commons.vfs.impl.StandardFileSystemManager.findClass(StandardFileSystemManager.java:212)
    [junit]     at 
org.apache.commons.vfs.impl.StandardFileSystemManager.addProvider(StandardFileSystemManager.java:181)

Line 40 looks like this:
        final FileSystemManager manager = VFS.getManager();
It is the first line in the method and is the same line as used in the 
example on the VFS webpage.
ConnectionInterceptor is an interface that was removed from HttpClient 
prior to 2.0.
An examination of other VFS code shows that it is definately not expecting
HttpClient 1.0.  I can't find the VFS code that tries to do something 
with ConnectionInterceptor.

I have tried the ibiblio.org snapshot of VFS and get the same results.  
I use build.xml to get the
dependencies (except when I manually tried the versions of HttpClient 
from ibiblio.org) with
Ant 1.5.3 and Sun's SDK 1.4.2.  I am clearly missing something, but I 
just can't see what :(

-- 
Michael


Mime
View raw message