1 package org.apache.commons.vfs; 2 3 import junit.framework.AssertionFailedError; 4 import junit.framework.Test; 5 import junit.framework.TestResult; 6 import org.apache.commons.vfs.provider.http.test.HttpProviderTestCase; 7 import org.apache.commons.vfs.provider.jar.test.JarProviderTestCase; 8 import org.apache.commons.vfs.provider.jar.test.NestedJarTestCase; 9 import org.apache.commons.vfs.provider.sftp.test.SftpProviderTestCase; 10 import org.apache.commons.vfs.provider.smb.test.SmbProviderTestCase; 11 import org.apache.commons.vfs.provider.smb.test.FileNameTestCase; 12 import org.apache.commons.vfs.provider.tar.test.NestedTarTestCase; 13 import org.apache.commons.vfs.provider.tar.test.NestedTbz2TestCase; 14 import org.apache.commons.vfs.provider.tar.test.NestedTgzTestCase; 15 import org.apache.commons.vfs.provider.tar.test.TarProviderTestCase; 16 import org.apache.commons.vfs.provider.tar.test.Tbz2ProviderTestCase; 17 import org.apache.commons.vfs.provider.tar.test.TgzProviderTestCase; 18 import org.apache.commons.vfs.provider.webdav.test.WebdavProviderTestCase; 19 import org.apache.commons.vfs.provider.zip.test.NestedZipTestCase; 20 import org.apache.commons.vfs.provider.zip.test.ZipProviderTestCase; 21 import org.apache.commons.vfs.provider.ftp.test.FtpProviderTestCase; 22 import org.apache.commons.vfs.provider.local.test.LocalProviderTestCase; 23 import org.apache.commons.vfs.provider.res.test.ResourceProviderTestCase; 24 import org.apache.commons.vfs.provider.temp.test.TemporaryProviderTestCase; 25 import org.apache.commons.vfs.provider.url.test.UrlProviderTestCase; 26 import org.apache.commons.vfs.provider.url.test.UrlProviderHttpTestCase; 27 import org.apache.commons.vfs.provider.test.VirtualProviderTestCase; 28 import org.apache.commons.vfs.provider.test.GenericFileNameTestCase; 29 30 import java.util.Properties ; 31 32 public class RunTest 33 { 34 public static void main(String [] args) throws Exception 35 { 36 Properties props = System.getProperties(); 37 props.setProperty("test.data.src", "src/test-data"); 38 props.setProperty("test.basedir", "target/test-data"); 39 props.setProperty("test.policy", "src/test-data/test.policy"); 40 props.setProperty("test.secure", "false"); 41 props.setProperty("test.smb.uri", 42 "smb://HOME\\vfsusr:vfs%2f%25\\te:st@10.0.1.54/vfsusr/vfstest"); 43 props.setProperty("test.ftp.uri", 44 "ftp://vfsusr:vfs%2f%25\\te:st@10.0.1.54/vfstest"); 45 props.setProperty("test.http.uri", "http://10.0.1.54/vfstest"); 46 props.setProperty("test.webdav.uri", 47 "webdav://vfsusr:vfs%2f%25\\te:st@10.0.1.54/vfstest"); 48 props.setProperty("test.sftp.uri", 49 "sftp://vfsusr:vfs%2f%25\\te:st@10.0.1.54/vfstest"); 50 51 Test tests[] = new Test[] 52 { 53 55 58 60 65 67 69 SftpProviderTestCase.suite(), 70 71 }; 82 83 TestResult result = new TestResult() 84 { 85 public void startTest(Test test) 86 { 87 System.out.println("start " + test); 88 System.out.flush(); 89 } 90 91 public void endTest(Test test) 92 { 93 } 95 96 public synchronized void addError(Test test, Throwable throwable) 97 { 98 throwable.printStackTrace(); 100 } 101 102 public synchronized void addFailure(Test test, 103 AssertionFailedError assertionFailedError) 104 { 105 assertionFailedError.printStackTrace(); 107 } 108 }; 109 110 for (int i = 0; i < tests.length; i++) 111 { 112 System.out.println("start test#" + i); 113 System.out.flush(); 114 115 Test test = tests[i]; 116 test.run(result); 117 118 } 120 } 121 } 122 | Popular Tags |