83 |
04 Mar 05 |
nicklas |
1 |
/* |
192 |
17 Mar 05 |
jari |
$Id$ |
83 |
04 Mar 05 |
nicklas |
3 |
|
4889 |
06 Apr 09 |
nicklas |
Copyright (C) 2005, 2006 Jari Häkkinen, Nicklas Nordborg |
83 |
04 Mar 05 |
nicklas |
5 |
|
2304 |
22 May 06 |
jari |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
Available at http://base.thep.lu.se/ |
83 |
04 Mar 05 |
nicklas |
8 |
|
83 |
04 Mar 05 |
nicklas |
BASE is free software; you can redistribute it and/or |
83 |
04 Mar 05 |
nicklas |
modify it under the terms of the GNU General Public License |
4480 |
05 Sep 08 |
jari |
as published by the Free Software Foundation; either version 3 |
83 |
04 Mar 05 |
nicklas |
of the License, or (at your option) any later version. |
83 |
04 Mar 05 |
nicklas |
13 |
|
83 |
04 Mar 05 |
nicklas |
BASE is distributed in the hope that it will be useful, |
83 |
04 Mar 05 |
nicklas |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
83 |
04 Mar 05 |
nicklas |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
83 |
04 Mar 05 |
nicklas |
GNU General Public License for more details. |
83 |
04 Mar 05 |
nicklas |
18 |
|
83 |
04 Mar 05 |
nicklas |
You should have received a copy of the GNU General Public License |
4514 |
11 Sep 08 |
jari |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
83 |
04 Mar 05 |
nicklas |
21 |
*/ |
94 |
07 Mar 05 |
nicklas |
22 |
import net.sf.basedb.core.Application; |
4249 |
24 Apr 08 |
nicklas |
23 |
import net.sf.basedb.core.Config; |
94 |
07 Mar 05 |
nicklas |
24 |
import net.sf.basedb.core.SessionControl; |
94 |
07 Mar 05 |
nicklas |
25 |
import net.sf.basedb.core.DbControl; |
94 |
07 Mar 05 |
nicklas |
26 |
import net.sf.basedb.core.BaseException; |
120 |
09 Mar 05 |
nicklas |
27 |
import net.sf.basedb.core.Item; |
125 |
09 Mar 05 |
nicklas |
28 |
import net.sf.basedb.core.Permission; |
5608 |
15 Apr 11 |
nicklas |
29 |
import net.sf.basedb.core.Version; |
7899 |
20 Jan 21 |
nicklas |
30 |
import net.sf.basedb.core.Application.StartupOptions; |
6424 |
25 Feb 14 |
nicklas |
31 |
import net.sf.basedb.core.authentication.LoginRequest; |
83 |
04 Mar 05 |
nicklas |
32 |
|
5146 |
20 Oct 09 |
nicklas |
33 |
import java.io.File; |
5146 |
20 Oct 09 |
nicklas |
34 |
import java.io.FileFilter; |
94 |
07 Mar 05 |
nicklas |
35 |
import java.net.InetAddress; |
4249 |
24 Apr 08 |
nicklas |
36 |
import java.sql.Connection; |
4249 |
24 Apr 08 |
nicklas |
37 |
import java.sql.DatabaseMetaData; |
4249 |
24 Apr 08 |
nicklas |
38 |
import java.sql.Driver; |
7521 |
06 Nov 18 |
nicklas |
39 |
import java.sql.DriverManager; |
4249 |
24 Apr 08 |
nicklas |
40 |
import java.util.Properties; |
94 |
07 Mar 05 |
nicklas |
41 |
|
83 |
04 Mar 05 |
nicklas |
42 |
public class TestUtil |
83 |
04 Mar 05 |
nicklas |
43 |
{ |
83 |
04 Mar 05 |
nicklas |
44 |
|
121 |
09 Mar 05 |
nicklas |
45 |
static |
121 |
09 Mar 05 |
nicklas |
46 |
{ |
121 |
09 Mar 05 |
nicklas |
// Require that asserts are enabled for test programs |
121 |
09 Mar 05 |
nicklas |
48 |
boolean assertsEnabled = false; |
2314 |
23 May 06 |
nicklas |
49 |
assert (assertsEnabled = true) == true; |
121 |
09 Mar 05 |
nicklas |
50 |
if (!assertsEnabled) throw new AssertionError("Asserts must be enabled."); |
121 |
09 Mar 05 |
nicklas |
51 |
} |
121 |
09 Mar 05 |
nicklas |
52 |
|
1529 |
27 Oct 05 |
nicklas |
53 |
private static boolean silent = false; |
1529 |
27 Oct 05 |
nicklas |
54 |
private static boolean waitBeforeDelete = false; |
83 |
04 Mar 05 |
nicklas |
55 |
private static String login; |
83 |
04 Mar 05 |
nicklas |
56 |
private static String password; |
83 |
04 Mar 05 |
nicklas |
57 |
private static String client; |
83 |
04 Mar 05 |
nicklas |
58 |
|
83 |
04 Mar 05 |
nicklas |
59 |
public static void checkArgs(String[] args) |
83 |
04 Mar 05 |
nicklas |
60 |
{ |
83 |
04 Mar 05 |
nicklas |
61 |
login = "root"; |
83 |
04 Mar 05 |
nicklas |
62 |
password = "root"; |
83 |
04 Mar 05 |
nicklas |
63 |
client = "net.sf.basedb.clients.test"; |
1529 |
27 Oct 05 |
nicklas |
64 |
|
1529 |
27 Oct 05 |
nicklas |
65 |
for (int i = 0; i < args.length; ++i) |
83 |
04 Mar 05 |
nicklas |
66 |
{ |
1529 |
27 Oct 05 |
nicklas |
67 |
String arg = args[i]; |
1529 |
27 Oct 05 |
nicklas |
68 |
if (arg.startsWith("-")) |
83 |
04 Mar 05 |
nicklas |
69 |
{ |
1529 |
27 Oct 05 |
nicklas |
70 |
parseOption(arg); |
83 |
04 Mar 05 |
nicklas |
71 |
} |
1529 |
27 Oct 05 |
nicklas |
72 |
else |
83 |
04 Mar 05 |
nicklas |
73 |
{ |
1529 |
27 Oct 05 |
nicklas |
74 |
if (args.length != i+2) |
1529 |
27 Oct 05 |
nicklas |
75 |
{ |
1529 |
27 Oct 05 |
nicklas |
76 |
showUsage(); |
1529 |
27 Oct 05 |
nicklas |
77 |
System.exit(0); |
1529 |
27 Oct 05 |
nicklas |
78 |
} |
1529 |
27 Oct 05 |
nicklas |
79 |
login = arg; |
1529 |
27 Oct 05 |
nicklas |
80 |
password = args[i+1]; |
2213 |
04 May 06 |
nicklas |
81 |
i = args.length; |
83 |
04 Mar 05 |
nicklas |
82 |
} |
83 |
04 Mar 05 |
nicklas |
83 |
} |
83 |
04 Mar 05 |
nicklas |
84 |
} |
83 |
04 Mar 05 |
nicklas |
85 |
|
1529 |
27 Oct 05 |
nicklas |
86 |
private static void parseOption(String option) |
83 |
04 Mar 05 |
nicklas |
87 |
{ |
1529 |
27 Oct 05 |
nicklas |
88 |
if ("-s".equals(option)) |
83 |
04 Mar 05 |
nicklas |
89 |
{ |
83 |
04 Mar 05 |
nicklas |
90 |
silent = true; |
83 |
04 Mar 05 |
nicklas |
91 |
} |
1529 |
27 Oct 05 |
nicklas |
92 |
else if ("-w".equals(option)) |
1529 |
27 Oct 05 |
nicklas |
93 |
{ |
1529 |
27 Oct 05 |
nicklas |
94 |
waitBeforeDelete = true; |
1529 |
27 Oct 05 |
nicklas |
95 |
} |
83 |
04 Mar 05 |
nicklas |
96 |
else |
83 |
04 Mar 05 |
nicklas |
97 |
{ |
83 |
04 Mar 05 |
nicklas |
98 |
showUsage(); |
83 |
04 Mar 05 |
nicklas |
99 |
System.exit(0); |
83 |
04 Mar 05 |
nicklas |
100 |
} |
83 |
04 Mar 05 |
nicklas |
101 |
} |
83 |
04 Mar 05 |
nicklas |
102 |
|
83 |
04 Mar 05 |
nicklas |
103 |
private static void showUsage() |
83 |
04 Mar 05 |
nicklas |
104 |
{ |
1529 |
27 Oct 05 |
nicklas |
105 |
System.out.println("Usage: run.sh class [-s] [-w] [user password]"); |
1529 |
27 Oct 05 |
nicklas |
106 |
System.out.println(" class: One of the Test* class files"); |
83 |
04 Mar 05 |
nicklas |
107 |
System.out.println(" -s: silent mode"); |
1529 |
27 Oct 05 |
nicklas |
108 |
System.out.println(" -w: wait for keypress before items are deleted"); |
83 |
04 Mar 05 |
nicklas |
109 |
System.out.println(" user: The login for a user account"); |
83 |
04 Mar 05 |
nicklas |
110 |
System.out.println(" password: The password for the user account"); |
83 |
04 Mar 05 |
nicklas |
111 |
} |
83 |
04 Mar 05 |
nicklas |
112 |
|
83 |
04 Mar 05 |
nicklas |
113 |
public static boolean getSilent() |
83 |
04 Mar 05 |
nicklas |
114 |
{ |
83 |
04 Mar 05 |
nicklas |
115 |
return silent; |
83 |
04 Mar 05 |
nicklas |
116 |
} |
1529 |
27 Oct 05 |
nicklas |
117 |
|
1529 |
27 Oct 05 |
nicklas |
118 |
public static boolean waitBeforeDelete() |
1529 |
27 Oct 05 |
nicklas |
119 |
{ |
1529 |
27 Oct 05 |
nicklas |
120 |
return waitBeforeDelete; |
1529 |
27 Oct 05 |
nicklas |
121 |
} |
83 |
04 Mar 05 |
nicklas |
122 |
|
83 |
04 Mar 05 |
nicklas |
123 |
private static SessionControl sc = null; |
83 |
04 Mar 05 |
nicklas |
124 |
|
83 |
04 Mar 05 |
nicklas |
125 |
public static DbControl getDbControl() |
83 |
04 Mar 05 |
nicklas |
126 |
throws BaseException |
83 |
04 Mar 05 |
nicklas |
127 |
{ |
7962 |
04 Jun 21 |
nicklas |
128 |
DbControl dc = sc.newDbControl("Test"); |
83 |
04 Mar 05 |
nicklas |
129 |
return dc; |
83 |
04 Mar 05 |
nicklas |
130 |
} |
130 |
10 Mar 05 |
nicklas |
131 |
|
126 |
10 Mar 05 |
nicklas |
132 |
public static boolean hasPermission(Permission permission, Item itemType) |
83 |
04 Mar 05 |
nicklas |
133 |
{ |
126 |
10 Mar 05 |
nicklas |
134 |
return sc.hasPermission(permission, itemType); |
83 |
04 Mar 05 |
nicklas |
135 |
} |
83 |
04 Mar 05 |
nicklas |
136 |
|
83 |
04 Mar 05 |
nicklas |
137 |
public static String getLogin() |
83 |
04 Mar 05 |
nicklas |
138 |
{ |
83 |
04 Mar 05 |
nicklas |
139 |
return login; |
83 |
04 Mar 05 |
nicklas |
140 |
} |
83 |
04 Mar 05 |
nicklas |
141 |
public static String getPassword() |
83 |
04 Mar 05 |
nicklas |
142 |
{ |
83 |
04 Mar 05 |
nicklas |
143 |
return password; |
83 |
04 Mar 05 |
nicklas |
144 |
} |
3846 |
16 Oct 07 |
martin |
145 |
|
3846 |
16 Oct 07 |
martin |
146 |
public static String getClient() |
3846 |
16 Oct 07 |
martin |
147 |
{ |
3846 |
16 Oct 07 |
martin |
148 |
return client; |
3846 |
16 Oct 07 |
martin |
149 |
} |
83 |
04 Mar 05 |
nicklas |
150 |
|
83 |
04 Mar 05 |
nicklas |
151 |
public static void begin() |
83 |
04 Mar 05 |
nicklas |
152 |
{ |
83 |
04 Mar 05 |
nicklas |
153 |
try |
83 |
04 Mar 05 |
nicklas |
154 |
{ |
5595 |
17 Mar 11 |
nicklas |
155 |
Config.setProperty("plugins.dir", System.getProperty("user.dir")); |
4249 |
24 Apr 08 |
nicklas |
156 |
showDbInfo(); |
7899 |
20 Jan 21 |
nicklas |
157 |
Application.start(new StartupOptions() |
7899 |
20 Jan 21 |
nicklas |
158 |
.disableExtensions(true) |
7899 |
20 Jan 21 |
nicklas |
159 |
.disableInternalJobQueue(true) |
7899 |
20 Jan 21 |
nicklas |
160 |
); |
5146 |
20 Oct 09 |
nicklas |
161 |
Application.getStaticCache().cleanUp(new FileFilter() |
5146 |
20 Oct 09 |
nicklas |
162 |
{ |
5146 |
20 Oct 09 |
nicklas |
163 |
@Override |
5146 |
20 Oct 09 |
nicklas |
164 |
public boolean accept(File pathname) |
5146 |
20 Oct 09 |
nicklas |
165 |
{ |
5146 |
20 Oct 09 |
nicklas |
166 |
return true; |
5146 |
20 Oct 09 |
nicklas |
167 |
} |
5146 |
20 Oct 09 |
nicklas |
168 |
}); |
94 |
07 Mar 05 |
nicklas |
169 |
sc = Application.newSessionControl(client, getLocalIp(), null); |
129 |
10 Mar 05 |
nicklas |
170 |
login(); |
83 |
04 Mar 05 |
nicklas |
171 |
} |
816 |
23 Jun 05 |
nicklas |
172 |
catch (Throwable ex) |
83 |
04 Mar 05 |
nicklas |
173 |
{ |
83 |
04 Mar 05 |
nicklas |
174 |
System.out.println("FAILURE INITIALIZING TEST"); |
83 |
04 Mar 05 |
nicklas |
175 |
ex.printStackTrace(); |
83 |
04 Mar 05 |
nicklas |
176 |
System.exit(0); |
83 |
04 Mar 05 |
nicklas |
177 |
} |
83 |
04 Mar 05 |
nicklas |
178 |
} |
129 |
10 Mar 05 |
nicklas |
179 |
|
129 |
10 Mar 05 |
nicklas |
180 |
public static void logout() |
129 |
10 Mar 05 |
nicklas |
181 |
throws BaseException |
129 |
10 Mar 05 |
nicklas |
182 |
{ |
129 |
10 Mar 05 |
nicklas |
183 |
sc.logout(); |
129 |
10 Mar 05 |
nicklas |
184 |
} |
129 |
10 Mar 05 |
nicklas |
185 |
|
129 |
10 Mar 05 |
nicklas |
186 |
public static void login() |
129 |
10 Mar 05 |
nicklas |
187 |
throws BaseException |
129 |
10 Mar 05 |
nicklas |
188 |
{ |
5827 |
26 Oct 11 |
nicklas |
189 |
login(login, password); |
129 |
10 Mar 05 |
nicklas |
190 |
} |
129 |
10 Mar 05 |
nicklas |
191 |
|
5827 |
26 Oct 11 |
nicklas |
192 |
public static void login(String login, String password) |
129 |
10 Mar 05 |
nicklas |
193 |
throws BaseException |
129 |
10 Mar 05 |
nicklas |
194 |
{ |
6424 |
25 Feb 14 |
nicklas |
195 |
LoginRequest loginRequest = new LoginRequest(login, password); |
6424 |
25 Feb 14 |
nicklas |
196 |
loginRequest.setComment("Running test program"); |
6424 |
25 Feb 14 |
nicklas |
197 |
sc.login(loginRequest); |
129 |
10 Mar 05 |
nicklas |
198 |
} |
83 |
04 Mar 05 |
nicklas |
199 |
|
83 |
04 Mar 05 |
nicklas |
200 |
public static void stop() |
83 |
04 Mar 05 |
nicklas |
201 |
{ |
83 |
04 Mar 05 |
nicklas |
202 |
try |
83 |
04 Mar 05 |
nicklas |
203 |
{ |
92 |
07 Mar 05 |
nicklas |
204 |
sc.logout(); |
83 |
04 Mar 05 |
nicklas |
205 |
Application.stop(); |
83 |
04 Mar 05 |
nicklas |
206 |
} |
358 |
04 Apr 05 |
nicklas |
207 |
catch (Throwable ex) |
83 |
04 Mar 05 |
nicklas |
208 |
{ |
83 |
04 Mar 05 |
nicklas |
209 |
ex.printStackTrace(); |
83 |
04 Mar 05 |
nicklas |
210 |
} |
83 |
04 Mar 05 |
nicklas |
211 |
} |
83 |
04 Mar 05 |
nicklas |
212 |
|
94 |
07 Mar 05 |
nicklas |
213 |
public static SessionControl getSessionControl() |
83 |
04 Mar 05 |
nicklas |
214 |
{ |
94 |
07 Mar 05 |
nicklas |
215 |
return sc; |
94 |
07 Mar 05 |
nicklas |
216 |
} |
94 |
07 Mar 05 |
nicklas |
217 |
|
94 |
07 Mar 05 |
nicklas |
218 |
public static String getLocalIp() |
94 |
07 Mar 05 |
nicklas |
219 |
{ |
94 |
07 Mar 05 |
nicklas |
220 |
try |
83 |
04 Mar 05 |
nicklas |
221 |
{ |
94 |
07 Mar 05 |
nicklas |
222 |
return InetAddress.getLocalHost().toString(); |
83 |
04 Mar 05 |
nicklas |
223 |
} |
358 |
04 Apr 05 |
nicklas |
224 |
catch (Throwable ex) |
94 |
07 Mar 05 |
nicklas |
225 |
{ |
94 |
07 Mar 05 |
nicklas |
226 |
return "unknown"; |
94 |
07 Mar 05 |
nicklas |
227 |
} |
83 |
04 Mar 05 |
nicklas |
228 |
} |
94 |
07 Mar 05 |
nicklas |
229 |
|
1529 |
27 Oct 05 |
nicklas |
230 |
public static void waitForEnter() |
1529 |
27 Oct 05 |
nicklas |
231 |
{ |
1529 |
27 Oct 05 |
nicklas |
232 |
try |
1529 |
27 Oct 05 |
nicklas |
233 |
{ |
1529 |
27 Oct 05 |
nicklas |
234 |
System.out.print("Press ENTER to continue..."); |
1529 |
27 Oct 05 |
nicklas |
235 |
System.in.read(); |
1529 |
27 Oct 05 |
nicklas |
236 |
System.in.skip(System.in.available()); |
1529 |
27 Oct 05 |
nicklas |
237 |
} |
1529 |
27 Oct 05 |
nicklas |
238 |
catch (Exception ex) |
1529 |
27 Oct 05 |
nicklas |
239 |
{} |
1529 |
27 Oct 05 |
nicklas |
240 |
} |
1529 |
27 Oct 05 |
nicklas |
241 |
|
2634 |
12 Sep 06 |
nicklas |
242 |
public static void listThreads() |
2634 |
12 Sep 06 |
nicklas |
243 |
{ |
2634 |
12 Sep 06 |
nicklas |
244 |
Thread[] threads = new Thread[Thread.activeCount()]; |
2634 |
12 Sep 06 |
nicklas |
245 |
int numThreads = Thread.enumerate(threads); |
2634 |
12 Sep 06 |
nicklas |
246 |
for (int i = 0; i < numThreads; i++) |
2634 |
12 Sep 06 |
nicklas |
247 |
{ |
2634 |
12 Sep 06 |
nicklas |
248 |
System.out.println(i + ": " + threads[i].getName()); |
2634 |
12 Sep 06 |
nicklas |
249 |
} |
2634 |
12 Sep 06 |
nicklas |
250 |
} |
2634 |
12 Sep 06 |
nicklas |
251 |
|
5319 |
20 Apr 10 |
nicklas |
252 |
public static boolean isWindows() |
5319 |
20 Apr 10 |
nicklas |
253 |
{ |
5319 |
20 Apr 10 |
nicklas |
254 |
return System.getProperty("os.name").toLowerCase().contains("windows"); |
5319 |
20 Apr 10 |
nicklas |
255 |
} |
5319 |
20 Apr 10 |
nicklas |
256 |
public static boolean isLinux() |
5319 |
20 Apr 10 |
nicklas |
257 |
{ |
5319 |
20 Apr 10 |
nicklas |
258 |
return System.getProperty("os.name").toLowerCase().contains("linux"); |
5319 |
20 Apr 10 |
nicklas |
259 |
} |
5319 |
20 Apr 10 |
nicklas |
260 |
public static boolean isMac() |
5319 |
20 Apr 10 |
nicklas |
261 |
{ |
5319 |
20 Apr 10 |
nicklas |
262 |
return System.getProperty("os.name").toLowerCase().contains("mac"); |
5319 |
20 Apr 10 |
nicklas |
263 |
} |
5319 |
20 Apr 10 |
nicklas |
264 |
|
4249 |
24 Apr 08 |
nicklas |
265 |
private static void showDbInfo() |
4249 |
24 Apr 08 |
nicklas |
266 |
{ |
4249 |
24 Apr 08 |
nicklas |
267 |
final Properties properties = System.getProperties(); |
7521 |
06 Nov 18 |
nicklas |
268 |
final String dbUrl = Config.getString("db.url"); |
7521 |
06 Nov 18 |
nicklas |
269 |
String driverClass = "unknown class"; |
4249 |
24 Apr 08 |
nicklas |
270 |
String driverVersion = "unknown version"; |
4249 |
24 Apr 08 |
nicklas |
271 |
String database = "Unknown database"; |
7521 |
06 Nov 18 |
nicklas |
272 |
|
4249 |
24 Apr 08 |
nicklas |
273 |
try |
4249 |
24 Apr 08 |
nicklas |
274 |
{ |
7521 |
06 Nov 18 |
nicklas |
275 |
final Driver driver = DriverManager.getDriver(dbUrl); |
7521 |
06 Nov 18 |
nicklas |
276 |
driverClass = driver.getClass().getName(); |
4249 |
24 Apr 08 |
nicklas |
277 |
driverVersion = "version " + driver.getMajorVersion() + "." + driver.getMinorVersion(); |
4249 |
24 Apr 08 |
nicklas |
278 |
Properties p = new Properties(); |
4249 |
24 Apr 08 |
nicklas |
279 |
p.setProperty("user", Config.getString("db.username")); |
4249 |
24 Apr 08 |
nicklas |
280 |
p.setProperty("password", Config.getString("db.password")); |
7521 |
06 Nov 18 |
nicklas |
281 |
Connection c = driver.connect(dbUrl, p); |
4249 |
24 Apr 08 |
nicklas |
282 |
DatabaseMetaData data = c.getMetaData(); |
4249 |
24 Apr 08 |
nicklas |
283 |
database = data.getDatabaseProductName() + " " + data.getDatabaseProductVersion(); |
4249 |
24 Apr 08 |
nicklas |
284 |
c.close(); |
4249 |
24 Apr 08 |
nicklas |
285 |
} |
4249 |
24 Apr 08 |
nicklas |
286 |
catch (Throwable t) |
4249 |
24 Apr 08 |
nicklas |
287 |
{} |
4249 |
24 Apr 08 |
nicklas |
288 |
|
4249 |
24 Apr 08 |
nicklas |
289 |
String message = |
4249 |
24 Apr 08 |
nicklas |
290 |
"--System information-----------------------------\n" + |
7522 |
06 Nov 18 |
nicklas |
291 |
"BASE : " + Version.getVersion() + "\n" + |
7522 |
06 Nov 18 |
nicklas |
292 |
"Database : " + database + "\n" + |
7522 |
06 Nov 18 |
nicklas |
293 |
"Dialect : " + Config.getString("db.dialect") + "\n" + |
7522 |
06 Nov 18 |
nicklas |
294 |
"Hibernate : " + org.hibernate.Version.getVersionString() + "\n"+ |
7522 |
06 Nov 18 |
nicklas |
295 |
"JDBC : " + driverClass + "; " + driverVersion + "\n" + |
7522 |
06 Nov 18 |
nicklas |
296 |
"URL : " + dbUrl + "\n" + |
7522 |
06 Nov 18 |
nicklas |
297 |
"Java : " + properties.getProperty("java.runtime.name") + "; " + |
4249 |
24 Apr 08 |
nicklas |
298 |
properties.getProperty("java.runtime.version") + "; " + |
4249 |
24 Apr 08 |
nicklas |
299 |
properties.getProperty("java.vendor") + "\n" + |
7522 |
06 Nov 18 |
nicklas |
300 |
"OS : " + properties.getProperty("os.name") +"; " + |
4249 |
24 Apr 08 |
nicklas |
301 |
properties.getProperty("os.arch") + "; " + |
4249 |
24 Apr 08 |
nicklas |
302 |
properties.getProperty("os.version") +"\n" + |
4249 |
24 Apr 08 |
nicklas |
303 |
"-------------------------------------------------"; |
4249 |
24 Apr 08 |
nicklas |
304 |
System.out.println(message); |
4249 |
24 Apr 08 |
nicklas |
305 |
} |
4249 |
24 Apr 08 |
nicklas |
306 |
|
83 |
04 Mar 05 |
nicklas |
307 |
} |
83 |
04 Mar 05 |
nicklas |
308 |
|