}
List<JMeterEngine> engines = new LinkedList<JMeterEngine>();
tree.add(tree.getArray()[0], new ListenToTest(parent, (remoteStart && remoteStop) ? engines : null));
println("Created the tree successfully using "+testFile);
JMeterEngine engine = null;
if (!remoteStart) {
engine = new StandardJMeterEngine();
engine.configure(tree);
long now=System.currentTimeMillis();
println("Starting the test @ "+new Date(now)+" ("+now+")");
engine.runTest();
} else {
java.util.StringTokenizer st = new java.util.StringTokenizer(remote_hosts_string, ",");//$NON-NLS-1$
while (st.hasMoreElements()) {
String el = (String) st.nextElement();
println("Configuring remote engine for " + el);
log.info("Configuring remote engine for " + el);
engines.add(doRemoteInit(el.trim(), tree));
}
println("Starting remote engines");
log.info("Starting remote engines");
long now=System.currentTimeMillis();
println("Starting the test @ "+new Date(now)+" ("+now+")");
Iterator<JMeterEngine> iter = engines.iterator();
while (iter.hasNext()) {
engine = iter.next();
if (engine != null){
engine.runTest();
}
}
println("Remote engines have been started");
log.info("Remote engines have been started");
}