87 LD_LIBRARY_PATH_64 + "=" + LD_LIBRARY_PATH_64_VALUE |
87 LD_LIBRARY_PATH_64 + "=" + LD_LIBRARY_PATH_64_VALUE |
88 }; |
88 }; |
89 |
89 |
90 static final File testJarFile = new File("EcoFriendly.jar"); |
90 static final File testJarFile = new File("EcoFriendly.jar"); |
91 |
91 |
92 static final String LIBJVM = TestHelper.isWindows |
|
93 ? "jvm.dll" |
|
94 : "libjvm" + (TestHelper.isMacOSX ? ".dylib" : ".so"); |
|
95 |
|
96 public ExecutionEnvironment() { |
92 public ExecutionEnvironment() { |
97 createTestJar(); |
93 createTestJar(); |
98 } |
94 } |
99 |
95 |
100 static void createTestJar() { |
96 static void createTestJar() { |
190 env.put(pairs[0], pairs[1]); |
186 env.put(pairs[0], pairs[1]); |
191 } |
187 } |
192 |
188 |
193 tr = doExec(env, javaCmd, "-jar", testJarFile.getAbsolutePath()); |
189 tr = doExec(env, javaCmd, "-jar", testJarFile.getAbsolutePath()); |
194 verifyJavaLibraryPathGeneric(tr); |
190 verifyJavaLibraryPathGeneric(tr); |
195 } else { |
191 } else { // Solaris |
196 // no override |
192 // no override |
197 env.clear(); |
193 env.clear(); |
198 env.put(LD_LIBRARY_PATH, LD_LIBRARY_PATH_VALUE); |
194 env.put(LD_LIBRARY_PATH, LD_LIBRARY_PATH_VALUE); |
199 tr = doExec(env, javaCmd, "-jar", testJarFile.getAbsolutePath()); |
195 tr = doExec(env, javaCmd, "-jar", testJarFile.getAbsolutePath()); |
200 verifyJavaLibraryPathGeneric(tr); |
196 verifyJavaLibraryPathGeneric(tr); |
234 " java.library.path contains " + LD_LIBRARY_PATH_VALUE); |
230 " java.library.path contains " + LD_LIBRARY_PATH_VALUE); |
235 } |
231 } |
236 } |
232 } |
237 |
233 |
238 /* |
234 /* |
239 * ensures we have indeed exec'ed the correct vm of choice, all VMs support |
235 * ensures we have indeed exec'ed the correct vm of choice if it exists |
240 * -server, however 32-bit VMs support -client and -server. |
|
241 */ |
236 */ |
242 @Test |
237 @Test |
243 void testVmSelection() { |
238 void testVmSelection() { |
244 |
239 |
245 TestResult tr = null; |
240 TestResult tr = null; |
246 |
241 |
247 if (is32Bit) { |
242 if (haveClientVM) { |
248 tr = doExec(javaCmd, "-client", "-version"); |
243 tr = doExec(javaCmd, "-client", "-version"); |
249 if (!tr.matches(".*Client VM.*")) { |
244 if (!tr.matches(".*Client VM.*")) { |
250 flagError(tr, "the expected vm -client did not launch"); |
245 flagError(tr, "the expected vm -client did not launch"); |
251 } |
246 } |
252 } |
247 } |
253 tr = doExec(javaCmd, "-server", "-version"); |
248 if (haveServerVM) { |
254 if (!tr.matches(".*Server VM.*")) { |
249 tr = doExec(javaCmd, "-server", "-version"); |
255 flagError(tr, "the expected vm -server did not launch"); |
250 if (!tr.matches(".*Server VM.*")) { |
|
251 flagError(tr, "the expected vm -server did not launch"); |
|
252 } |
256 } |
253 } |
257 } |
254 } |
258 |
255 |
259 /* |
256 /* |
260 * checks to see there is no extra libjvm.so than needed |
257 * checks to see there is no extra libjvm.so than needed |