Modified to compile under JDK14

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@360499 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Alan Cabrera 2006-01-01 17:21:13 +00:00
parent 61ab31e758
commit 673f323e18
1 changed files with 12 additions and 12 deletions

View File

@ -16,13 +16,13 @@
*/ */
package org.apache.activemq.systest.impl; package org.apache.activemq.systest.impl;
import java.io.File;
import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.ActiveMQConnectionFactory;
import org.apache.activemq.systest.BrokerAgent; import org.apache.activemq.systest.BrokerAgent;
import javax.jms.ConnectionFactory; import javax.jms.ConnectionFactory;
import java.io.*;
import java.util.Iterator;
/** /**
* Runs a broker in a separate process * Runs a broker in a separate process
@ -94,20 +94,20 @@ public class SeparateBrokerProcessAgentImpl extends SeparateProcessAgent impleme
// Implementation methods // Implementation methods
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
protected Process createProcess() throws Exception { protected Process createProcess() throws Exception {
ProcessBuilder builder = new ProcessBuilder(getCommands()); String commands[] = getCommands();
File workingDir = createBrokerWorkingDirectory();
System.out.print("About to execute command:"); System.out.print("About to execute command:");
for (Iterator iter = builder.command().iterator(); iter.hasNext();) { for (int i=0; i<commands.length; i++) {
System.out.print(" " + iter.next()); System.out.print(" ");
System.out.print(commands[i]);
} }
System.out.println(); System.out.println();
File workingDir = createBrokerWorkingDirectory();
System.out.println("In directory: " + workingDir); System.out.println("In directory: " + workingDir);
builder = builder.directory(workingDir); Process answer = Runtime.getRuntime().exec(commands, null, workingDir);
builder = builder.redirectErrorStream(true);
Process answer = builder.start();
return answer; return answer;
} }