File fileFeports = new File(REPORTS);
if (!fileFeports.exists()) {
fileFeports.mkdir();
}
JMeter jmeter = new JMeter();
String[] files = new File(JMXFOLDER).list();
for (String file : files) {
if (file.toLowerCase().endsWith(jmxExtension)) {
// Launching JMeter for each JMX test plan found
String fileNoExt = file.substring(0, file.length()
- jmxExtension.length());
String outputFileJtl = REPORTS + fileNoExt + jtlExtension;
String[] arguments = { "-n", "-t", JMXFOLDER + file, "-p",
jmeterProperties, "-d", ROOT, "-l", outputFileJtl,
"-j", logFile };
jmeter.start(arguments);
// Waiting for JMeter ending
ByteArrayOutputStream baos = new ByteArrayOutputStream();
System.setOut(new PrintStream(baos));
boolean running = true;