You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicemix.apache.org by gn...@apache.org on 2008/09/25 23:34:49 UTC
svn commit: r699101 -
/servicemix/smx4/kernel/trunk/gshell/gshell-admin/src/test/java/org/apache/servicemix/jpm/ProcessTest.java
Author: gnodet
Date: Thu Sep 25 14:34:49 2008
New Revision: 699101
URL: http://svn.apache.org/viewvc?rev=699101&view=rev
Log:
Try to fix test if java executable is not in the path
Modified:
servicemix/smx4/kernel/trunk/gshell/gshell-admin/src/test/java/org/apache/servicemix/jpm/ProcessTest.java
Modified: servicemix/smx4/kernel/trunk/gshell/gshell-admin/src/test/java/org/apache/servicemix/jpm/ProcessTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx4/kernel/trunk/gshell/gshell-admin/src/test/java/org/apache/servicemix/jpm/ProcessTest.java?rev=699101&r1=699100&r2=699101&view=diff
==============================================================================
--- servicemix/smx4/kernel/trunk/gshell/gshell-admin/src/test/java/org/apache/servicemix/jpm/ProcessTest.java (original)
+++ servicemix/smx4/kernel/trunk/gshell/gshell-admin/src/test/java/org/apache/servicemix/jpm/ProcessTest.java Thu Sep 25 14:34:49 2008
@@ -16,18 +16,24 @@
*/
package org.apache.servicemix.jpm;
+import java.io.File;
+
import org.junit.Test;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
+import org.apache.servicemix.jpm.impl.ScriptUtils;
public class ProcessTest {
@Test
public void testCreate() throws Exception {
+ String javaPath = new File(System.getProperty("java.home"), "bin/java" + (ScriptUtils.isWindows() ? ".exe" : "")).getCanonicalPath();
+ System.err.println(javaPath);
StringBuilder command = new StringBuilder();
- command.append("java -classpath ");
+ command.append(javaPath);
+ command.append(" -classpath ");
String clRes = getClass().getName().replace('.', '/') + ".class";
String str = getClass().getClassLoader().getResource(clRes).toString();
str = str.substring("file:".length(), str.indexOf(clRes));