KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > vfs > RunTest


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 JavaDoc;
31
32 public class RunTest
33 {
34     public static void main(String JavaDoc[] args) throws Exception JavaDoc
35     {
36         Properties JavaDoc 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         // SmbProviderTestCase.suite(),
54

55         // LocalProviderTestCase.suite(),
56
// FtpProviderTestCase.suite(),
57

58         // UrlProviderHttpTestCase.suite(),
59

60         // VirtualProviderTestCase.suite(),
61
// TemporaryProviderTestCase.suite(),
62
// UrlProviderTestCase.suite(),
63
// ResourceProviderTestCase.suite(),
64

65         // HttpProviderTestCase.suite(),
66

67         // WebdavProviderTestCase.suite(),
68

69         SftpProviderTestCase.suite(),
70
71         // JarProviderTestCase.suite(),
72
// NestedJarTestCase.suite(),
73
// ZipProviderTestCase.suite(),
74
// NestedZipTestCase.suite(),
75
// TarProviderTestCase.suite(),
76
// TgzProviderTestCase.suite(),
77
// Tbz2ProviderTestCase.suite(),
78
// NestedTarTestCase.suite(),
79
// NestedTgzTestCase.suite(),
80
// NestedTbz2TestCase.suite(),
81
};
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                 // System.err.println("end " + test);
94
}
95
96             public synchronized void addError(Test test, Throwable JavaDoc throwable)
97             {
98                 // throw new RuntimeException(throwable.getMessage());
99
throwable.printStackTrace();
100             }
101
102             public synchronized void addFailure(Test test,
103                     AssertionFailedError assertionFailedError)
104             {
105                 // throw new RuntimeException(assertionFailedError.getMessage());
106
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             // break;
119
}
120     }
121 }
122
Popular Tags