1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.vfs.test;
18
19 import org.apache.commons.AbstractVfsTestCase;
20 import org.apache.commons.vfs.FileObject;
21 import org.apache.commons.vfs.FileSystemManager;
22 import org.apache.commons.vfs.FileType;
23 import org.apache.commons.vfs.VFS;
24
25 import java.io.File;
26
27 /***
28 * Test cases for the VFS factory.
29 *
30 * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
31 * @version $Revision: 480428 $ $Date: 2006-11-29 07:15:24 +0100 (Mi, 29 Nov 2006) $
32 */
33 public class FileSystemManagerFactoryTestCase
34 extends AbstractVfsTestCase
35 {
36 /***
37 * Sanity test.
38 */
39 public void testDefaultInstance() throws Exception
40 {
41
42 final FileSystemManager manager = VFS.getManager();
43
44
45 final File jarFile = getTestResource("test.jar");
46 FileObject file = manager.toFileObject(jarFile);
47 assertNotNull(file);
48 assertTrue(file.exists());
49 assertSame(FileType.FILE, file.getType());
50
51
52 file = manager.createFileSystem(file);
53 assertNotNull(file);
54 assertTrue(file.exists());
55 assertSame(FileType.FOLDER, file.getType());
56 }
57
58 }