@Test
public void run() throws Exception {
String className = getClass().getSimpleName();
ChainedOptionsBuilder runnerOptions = new OptionsBuilder()
.include(".*" + className + ".*")
.jvmArgs(JVM_ARGS);
if (getWarmupIterations() > 0) {
runnerOptions.warmupIterations(getWarmupIterations());
}
if (getMeasureIterations() > 0) {
runnerOptions.measurementIterations(getMeasureIterations());
}
if (getForks() > 0) {
runnerOptions.forks(getForks());
}
if (getReportDir() != null) {
String filePath = getReportDir() + className + ".json";
File file = new File(filePath);
if (file.exists()) {
file.delete();
} else {
file.getParentFile().mkdirs();
file.createNewFile();
}
runnerOptions.resultFormat(ResultFormatType.JSON);
runnerOptions.result(filePath);
}
new Runner(runnerOptions.build()).run();
}