|
我使用java vuser协议在LR中写了一段代码
代码如下:
import lrapi.lr;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import udms.core.client.UDMSClient;
import udms.core.process.common.TaskManager;
import udms.core.process.common.impl.RemoteTaskManager;
import udms.core.process.search.engine.Result;
import udms.core.process.search.engine.ResultList;
import udms.core.process.search.engine.SearchEngine;
public class Actions
{
UDMSClient client = new UDMSClient ("d:/Client.xml");
public int init() throws Throwable
{
return 0;
}//end of init
public int action() throws Throwable
{
TaskManager taskmanager= client.getTaskManager();
SearchEngine searchEngine = ((RemoteTaskManager)
taskmanager).getSearchEngine();
InputStream input = new FileInputStream(new File("d:/Search.xml"));
//lr.start_transaction("Search");
ResultList resultList = searchEngine.service(input);
//lr.end_transaction("Search", lr.PASS);
return 0;
}//end of action
public int end() throws Throwable
{
client.close();
return 0;
}//end of end
}
在Eclipse中代码正确、能正常的查询出数据
但是在LR场景中运行的时候提示
Error (-17998): Failed to get [param not passed in call] thread TLS entry错误
请大虾们帮忙看一下该怎的解决的?
还有请问一下:如果我把这段代码封装成jar文件、该如何的调用执行场景的? |
|