1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.commons.vfs2;
18
19 import java.util.Properties;
20
21 import junit.framework.AssertionFailedError;
22 import junit.framework.Test;
23 import junit.framework.TestResult;
24
25 public class RunTest {
26
27 public static void main(final String[] args) throws Exception {
28 final String ip = "192.168.0.128";
29
30 final Properties props = System.getProperties();
31 props.setProperty("test.data.src", "src/test-data");
32 props.setProperty(VfsTestUtils.TEST_BASE_DIR, "core/target/test-classes/test-data");
33 props.setProperty("test.basedir.res", "test-data");
34 props.setProperty("test.policy", "src/test-data/test.policy");
35 props.setProperty("test.secure", "false");
36 props.setProperty("test.smb.uri", "smb://HOME\\vfsusr:vfs%2f%25\\te:st@" + ip + "/vfsusr/vfstest");
37 props.setProperty("test.ftp.uri", "ftp://vfsusr:vfs%2f%25\\te:st@" + ip + "/vfstest");
38 props.setProperty("test.ftps.uri", "ftps://vfsusr:vfs%2f%25\\te:st@" + ip + "/vfstest");
39
40 props.setProperty("test.http.uri", "http://" + ip + "/vfstest");
41
42 props.setProperty("test.sftp.uri", "sftp://vfsusr:vfs%2f%25\\te:st@" + ip + "/vfstest");
43
44 final Test[] tests = {
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68 };
69
70 final TestResult result = new TestResult() {
71 @Override
72 public synchronized void addError(final Test test, final Throwable throwable) {
73
74 throwable.printStackTrace();
75 }
76
77 @Override
78 public synchronized void addFailure(final Test test, final AssertionFailedError assertionFailedError) {
79
80 assertionFailedError.printStackTrace();
81 }
82
83 @Override
84 public void endTest(final Test test) {
85
86 }
87
88 @Override
89 public void startTest(final Test test) {
90 System.out.println("start " + test);
91 System.out.flush();
92 }
93 };
94
95 for (int i = 0; i < tests.length; i++) {
96 System.out.println("start test#" + i);
97 System.out.flush();
98
99 final Test test = tests[i];
100 test.run(result);
101
102
103 }
104 }
105
106 }