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 public static void main(final String[] args) throws Exception {
27 final String ip = "192.168.0.128";
28
29 final Properties props = System.getProperties();
30 props.setProperty("test.data.src", "src/test-data");
31 props.setProperty("test.basedir", "core/target/test-classes/test-data");
32 props.setProperty("test.basedir.res", "test-data");
33 props.setProperty("test.policy", "src/test-data/test.policy");
34 props.setProperty("test.secure", "false");
35 props.setProperty("test.smb.uri", "smb://HOME\\vfsusr:vfs%2f%25\\te:st@" + ip + "/vfsusr/vfstest");
36 props.setProperty("test.ftp.uri", "ftp://vfsusr:vfs%2f%25\\te:st@" + ip + "/vfstest");
37 props.setProperty("test.ftps.uri", "ftps://vfsusr:vfs%2f%25\\te:st@" + ip + "/vfstest");
38
39 props.setProperty("test.http.uri", "http://" + ip + "/vfstest");
40
41 props.setProperty("test.sftp.uri", "sftp://vfsusr:vfs%2f%25\\te:st@" + ip + "/vfstest");
42
43 final Test[] tests = new Test[] {
44
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 final TestResult result = new TestResult() {
70 @Override
71 public synchronized void addError(final Test test, final Throwable throwable) {
72
73 throwable.printStackTrace();
74 }
75
76 @Override
77 public synchronized void addFailure(final Test test, final AssertionFailedError assertionFailedError) {
78
79 assertionFailedError.printStackTrace();
80 }
81
82 @Override
83 public void endTest(final Test test) {
84
85 }
86
87 @Override
88 public void startTest(final Test test) {
89 System.out.println("start " + test);
90 System.out.flush();
91 }
92 };
93
94 for (int i = 0; i < tests.length; i++) {
95 System.out.println("start test#" + i);
96 System.out.flush();
97
98 final Test test = tests[i];
99 test.run(result);
100
101
102 }
103 }
104 }