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
Buildfile: build.xml
init:
get-deps:
[get] Getting: http://www.ibiblio.org/maven/ant/jars/ant-1.5.jar
[get] Not modified - so not downloaded
[get] Getting: http://www.ibiblio.org/maven/junit/jars/junit-3.8.1.jar
[get] Not modified - so not downloaded
[get] Getting:
http://www.ibiblio.org/maven/commons-net/jars/commons-net-1.0.0.jar
[get] Not modified - so not downloaded
[get] Getting:
http://www.ibiblio.org/maven/commons-logging/jars/commons-logging-1.0.jar
[get] Not modified - so not downloaded
[get] Getting: http://www.ibiblio.org/maven/jcifs/jars/jcifs-0.7.8.jar
[get] Not modified - so not downloaded
[get] Getting: http://www.ibiblio.org/maven/slide/jars/webdavlib-1.0.16.jar
[get] Not modified - so not downloaded
[get] Getting:
http://www.ibiblio.org/maven/commons-httpclient/jars/commons-httpclient-2.0-beta1.jar
[get] Not modified - so not downloaded
[get] Getting: http://www.ibiblio.org/maven/jsch/jars/jsch-0.1.5.jar
[get] Not modified - so not downloaded
[get] Getting: http://www.ibiblio.org/maven/xml-apis/jars/xml-apis-1.0.b2.jar
[get] Not modified - so not downloaded
compile:
compile-tests:
internal-test:
[echo] target/test-data : ftp://anonymous:[EMAIL PROTECTED]@localhost/vfs
[junit] Running org.apache.commons.vfs.provider.smb.test.FileNameTestCase
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 1.742 sec
[junit] Testsuite: org.apache.commons.vfs.provider.smb.test.FileNameTestCase
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 1.742 sec
[junit] Testcase: testParseUri took 0.042 sec
[junit] Testcase: testBadlyFormedUri took 0.094 sec
[junit] Running org.apache.commons.vfs.provider.test.GenericFileNameTestCase
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 1.648 sec
[junit] Testsuite: org.apache.commons.vfs.provider.test.GenericFileNameTestCase
[junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed: 1.648 sec
[junit] Testcase: testParseUri took 0.039 sec
[junit] Testcase: testBadlyFormedUri took 0.094 sec
[junit] Running org.apache.commons.vfs.test.FileSystemManagerFactoryTestCase
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 2.24 sec
[junit] Testsuite: org.apache.commons.vfs.test.FileSystemManagerFactoryTestCase
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 2.24 sec
[junit] Testcase: testDefaultInstance took 0.655 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)
[junit] at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
[junit] at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
[junit] at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
[junit] at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
[junit] at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
[junit] at java.security.AccessController.doPrivileged(Native Method)
[junit] at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
[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 java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
[junit] at java.lang.ClassLoader.defineClass0(Native Method)
[junit] at java.lang.ClassLoader.defineClass(ClassLoader.java:537)
[junit] at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
[junit] at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
[junit] at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
[junit] at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
[junit] at java.security.AccessController.doPrivileged(Native Method)
[junit] at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
[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)
[junit] at
org.apache.commons.vfs.impl.StandardFileSystemManager.configure(StandardFileSystemManager.java:115)
[junit] at
org.apache.commons.vfs.impl.StandardFileSystemManager.init(StandardFileSystemManager.java:87)
[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] at org.apache.commons.vfs.VFS.createManager(VFS.java:79)
[junit] ... 16 more
[junit] Testcase: testDefaultInstance
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
