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