1 16 package org.apache.commons.vfs.provider.zip.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.zip.ZipFileProvider; 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 ZipProviderTestCase 36 extends AbstractProviderTestConfig 37 implements ProviderTestConfig 38 { 39 42 public static Test suite() throws Exception 43 { 44 return new ProviderTestSuite(new ZipProviderTestCase()); 45 } 46 47 50 public void prepare(final DefaultFileSystemManager manager) throws Exception 51 { 52 manager.addProvider("zip", new ZipFileProvider()); 53 manager.addExtensionMap("zip", "zip"); 54 manager.addMimeTypeMap("application/zip", "zip"); 55 } 56 57 60 public FileObject getBaseTestFolder(final FileSystemManager manager) throws Exception 61 { 62 final File zipFile = AbstractVfsTestCase.getTestResource("test.zip"); 63 final String uri = "zip:" + zipFile.getAbsolutePath() + "!/"; 64 return manager.resolveFile(uri); 65 } 66 } 67 | Popular Tags |