1 16 package org.apache.commons.vfs.provider.jar.test; 17 18 import junit.framework.Test; 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.impl.DefaultFileSystemManager; 23 import org.apache.commons.vfs.provider.jar.JarFileProvider; 24 import org.apache.commons.vfs.test.AbstractProviderTestConfig; 25 import org.apache.commons.vfs.test.ProviderTestConfig; 26 import org.apache.commons.vfs.test.ProviderTestSuite; 27 28 import java.io.File ; 29 30 35 public class NestedJarTestCase 36 extends AbstractProviderTestConfig 37 implements ProviderTestConfig 38 { 39 42 public static Test suite() throws Exception 43 { 44 return new ProviderTestSuite(new NestedJarTestCase()); 45 } 46 47 50 public void prepare(final DefaultFileSystemManager manager) 51 throws Exception 52 { 53 manager.addProvider("jar", new JarFileProvider()); 54 manager.addExtensionMap("jar", "jar"); 55 } 56 57 60 public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception 61 { 62 final File outerFile = AbstractVfsTestCase.getTestResource("nested.jar"); 64 final String uri = "jar:" + outerFile.getAbsolutePath() + "!/test.jar"; 65 final FileObject jarFile = manager.resolveFile(uri); 66 67 final FileObject nestedFS = manager.createFileSystem(jarFile); 69 return nestedFS.resolveFile("/"); 70 } 71 } 72 | Popular Tags |