本文整理汇总了Java中org.apache.jmeter.NewDriver类的典型用法代码示例。如果您正苦于以下问题:Java NewDriver类的具体用法?Java NewDriver怎么用?Java NewDriver使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
NewDriver类属于org.apache.jmeter包,在下文中一共展示了NewDriver类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testStarted
import org.apache.jmeter.NewDriver; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void testStarted() {
if (getBasedir() != null && getBasedir().length() > 0) {
try {
FileServer.getFileServer().setBasedir(FileServer.getFileServer().getBaseDir() + getBasedir());
} catch (IllegalStateException e) {
log.error("Failed to set file server base dir with " + getBasedir(), e);
}
}
// we set the classpath
String[] paths = this.getTestPlanClasspathArray();
for (String path : paths) {
NewDriver.addURL(path);
log.info("add " + path + " to classpath");
}
}
示例2: testStarted
import org.apache.jmeter.NewDriver; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void testStarted() {
if (getBasedir() != null && getBasedir().length() > 0) {
try {
FileServer.getFileServer().setBasedir(FileServer.getFileServer().getBaseDir() + getBasedir());
} catch (IllegalStateException e) {
log.error("Failed to set file server base dir with " + getBasedir(), e);
}
}
// we set the classpath
String[] paths = this.getTestPlanClasspathArray();
for (int idx=0; idx < paths.length; idx++) {
NewDriver.addURL(paths[idx]);
log.info("add " + paths[idx] + " to classpath");
}
}
示例3: execute
import org.apache.jmeter.NewDriver; //导入依赖的package包/类
public void execute(Test test, UUID batchId, Boolean persist) {
DbHelper db = new DbHelper();
try {
String testFile = test.getPath();
String reportFile = testReport + "/" + batchId + "/" + "Jmeter"+ "/" + test.getName() + "/" + test.getName() + ".jtl";
NewDriver.main(JmeterArgs.buildArgsArray(testFile,reportFile));
waitForTestComplete();
test = JmeterResultsParser.parse(test,reportFile);
db.addPerfResults(test, batchId, persist);
}catch (Exception ex){
ex.printStackTrace();
}
}