FileServer.getFileServer().setBasedir(f.getAbsolutePath());
reader = new FileInputStream(f);
log.info("Loading file: " + f);
HashTree tree = SaveService.loadTree(reader);
JMeterTreeModel treeModel = new JMeterTreeModel(new Object());// Create non-GUI version to avoid headless problems
JMeterTreeNode root = (JMeterTreeNode) treeModel.getRoot();
treeModel.addSubTree(tree, root);
// Hack to resolve ModuleControllers in non GUI mode
SearchByClass replaceableControllers = new SearchByClass(ReplaceableController.class);
tree.traverse(replaceableControllers);
Collection replaceableControllersRes = replaceableControllers.getSearchResults();
for (Iterator iter = replaceableControllersRes.iterator(); iter.hasNext();) {
ReplaceableController replaceableController = (ReplaceableController) iter.next();
replaceableController.resolveReplacementSubTree(root);
}
// Remove the disabled items
// For GUI runs this is done in Start.java
convertSubTree(tree);
if (logFile != null) {
ResultCollector logger = new ResultCollector();
logger.setFilename(logFile);
tree.add(tree.getArray()[0], logger);
}
String summariserName = JMeterUtils.getPropDefault("summariser.name", "");//$NON-NLS-1$
if (summariserName.length() > 0) {
log.info("Creating summariser <" + summariserName + ">");
println("Creating summariser <" + summariserName + ">");
Summariser summer = new Summariser(summariserName);
tree.add(tree.getArray()[0], summer);
}
tree.add(tree.getArray()[0], new ListenToTest(parent));
println("Created the tree successfully");
JMeterEngine engine = null;
if (!remoteStart) {
engine = new StandardJMeterEngine();
engine.configure(tree);