Merge branch 'master' of https://github.com/lostcharlie/Bench4Q.git
This commit is contained in:
commit
3349e5e0dc
|
@ -12,6 +12,7 @@ import org.bench4q.agent.scenario.Scenario;
|
|||
import org.bench4q.agent.scenario.behavior.Behavior;
|
||||
import org.bench4q.agent.scenario.engine.ScenarioContext;
|
||||
import org.bench4q.agent.scenario.engine.ScenarioEngine;
|
||||
import org.bench4q.agent.scenario.engine.Schedule;
|
||||
import org.bench4q.share.helper.MarshalHelper;
|
||||
import org.bench4q.share.models.agent.BehaviorBriefModel;
|
||||
import org.bench4q.share.models.agent.BehaviorStatusCodeResultModel;
|
||||
|
@ -20,6 +21,7 @@ import org.bench4q.share.models.agent.RunScenarioModel;
|
|||
import org.bench4q.share.models.agent.RunScenarioResultModel;
|
||||
import org.bench4q.share.models.agent.StopTestModel;
|
||||
import org.bench4q.share.models.agent.TestBriefStatusModel;
|
||||
import org.bench4q.share.models.agent.scriptrecord.ScheduleModel;
|
||||
import org.bench4q.share.models.agent.statistics.AgentBriefStatusModel;
|
||||
import org.bench4q.share.models.agent.statistics.AgentBehaviorsBriefModel;
|
||||
import org.bench4q.share.models.agent.statistics.AgentPageBriefModel;
|
||||
|
@ -88,8 +90,11 @@ public class TestController {
|
|||
System.out.println(scenarioModel);
|
||||
RunScenarioModel runScenarioModel = (RunScenarioModel) MarshalHelper
|
||||
.unmarshal(RunScenarioModel.class, scenarioModel);
|
||||
ScheduleModel scheduleModel = (ScheduleModel) MarshalHelper
|
||||
.unmarshal(ScheduleModel.class, scheduleContent);
|
||||
this.getScenarioEngine().submitScenario(runId,
|
||||
Scenario.scenarioBuilderWithCompile(runScenarioModel), realStartTime);
|
||||
Scenario.scenarioBuilderWithCompile(runScenarioModel),
|
||||
Schedule.build(scheduleModel), realStartTime);
|
||||
return MarshalHelper.tryMarshal(buildWith(runId));
|
||||
} catch (Exception e) {
|
||||
logger.error("/submitScenarioWithParams", e);
|
||||
|
|
|
@ -5,7 +5,6 @@ import java.util.Collections;
|
|||
import java.util.List;
|
||||
|
||||
import org.bench4q.agent.scenario.behavior.Behavior;
|
||||
import org.bench4q.agent.scenario.engine.Schedule;
|
||||
import org.bench4q.share.helper.MarshalHelper;
|
||||
import org.bench4q.share.models.agent.ParameterModel;
|
||||
import org.bench4q.share.models.agent.RunScenarioModel;
|
||||
|
@ -17,7 +16,6 @@ public class Scenario {
|
|||
private UsePlugin[] usePlugins;
|
||||
private Page[] pages;
|
||||
private List<Behavior> behaviors;
|
||||
private Schedule schedule;
|
||||
|
||||
public UsePlugin[] getUsePlugins() {
|
||||
return usePlugins;
|
||||
|
@ -43,14 +41,6 @@ public class Scenario {
|
|||
this.behaviors = behaviors;
|
||||
}
|
||||
|
||||
public Schedule getSchedule() {
|
||||
return schedule;
|
||||
}
|
||||
|
||||
private void setSchedule(Schedule schedule) {
|
||||
this.schedule = schedule;
|
||||
}
|
||||
|
||||
public Scenario() {
|
||||
this.setBehaviors(new ArrayList<Behavior>());
|
||||
}
|
||||
|
@ -98,7 +88,6 @@ public class Scenario {
|
|||
scenario.setPages(new Page[runScenarioModel.getPages().size()]);
|
||||
extractUsePlugins(runScenarioModel, scenario);
|
||||
extractPages(runScenarioModel, scenario);
|
||||
scenario.setSchedule(Schedule.build(runScenarioModel.getScheduleModel()));
|
||||
return scenario;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ public class ScenarioContext implements Observer {
|
|||
private boolean finished;
|
||||
private final DataCollector dataCollector;
|
||||
private final PluginManager pluginManager;
|
||||
private Schedule schedule;
|
||||
|
||||
public ScenarioContext(UUID testId, Date startDate,
|
||||
ThreadPoolExecutor executor, DataCollector dataCollector, PluginManager pluginManager) {
|
||||
|
@ -79,15 +80,16 @@ public class ScenarioContext implements Observer {
|
|||
return pluginManager;
|
||||
}
|
||||
|
||||
public static ScenarioContext buildScenarioContext(UUID testId,
|
||||
final Scenario scenario, int poolSize, PluginManager pluginManager) {
|
||||
ScenarioContext scenarioContext = buildScenarioContextWithoutScenario(
|
||||
testId, poolSize, pluginManager);
|
||||
scenarioContext.setScenario(scenario);
|
||||
scenario.getSchedule().addObserver(scenarioContext);
|
||||
return scenarioContext;
|
||||
Schedule getSchedule() {
|
||||
return schedule;
|
||||
}
|
||||
|
||||
private void setSchedule(Schedule schedule) {
|
||||
this.schedule = schedule;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static ScenarioContext buildScenarioContextWithoutScenario(
|
||||
UUID testId, int poolSize, PluginManager pluginManager) {
|
||||
final ArrayBlockingQueue<Runnable> workQueue = new ArrayBlockingQueue<Runnable>(
|
||||
|
@ -101,11 +103,13 @@ public class ScenarioContext implements Observer {
|
|||
return scenarioContext;
|
||||
}
|
||||
|
||||
public ScenarioContext addScenrio(final Scenario scenario, final long realStartTime) {
|
||||
public ScenarioContext addScenrio(final Scenario scenario, Schedule schedule, final long realStartTime) {
|
||||
ScenarioContext result = new ScenarioContext(this.testId, new Date(realStartTime), executor, this.dataCollector, pluginManager);
|
||||
result.setEndDate(new Date(scenario.getSchedule().getScheduleRange() + this.getStartDate().getTime()));
|
||||
result.setSchedule(schedule);
|
||||
result.setEndDate(new Date(result.getSchedule().getScheduleRange() + this.getStartDate().getTime()));
|
||||
result.setFinished(this.isFinished());
|
||||
result.setScenario(scenario);
|
||||
this.getSchedule().addObserver(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,10 +50,10 @@ public class ScenarioEngine implements Observer {
|
|||
}
|
||||
}
|
||||
|
||||
public void submitScenario(final UUID runId, final Scenario scenario, final long realStartTime) {
|
||||
public void submitScenario(final UUID runId, final Scenario scenario, final Schedule schedule, final long realStartTime) {
|
||||
try {
|
||||
ScenarioContext old = this.getRunningTests().get(runId);
|
||||
this.getRunningTests().put(runId, old.addScenrio(scenario, realStartTime));
|
||||
this.getRunningTests().put(runId, old.addScenrio(scenario, schedule, realStartTime));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -74,7 +74,6 @@ public class ScenarioEngine implements Observer {
|
|||
}
|
||||
try {
|
||||
int currentLoad = scenarioContext
|
||||
.getScenario()
|
||||
.getSchedule()
|
||||
.loadFor(
|
||||
System.currentTimeMillis()
|
||||
|
|
|
@ -15,18 +15,18 @@ public class Supervisor extends Observable {
|
|||
}
|
||||
|
||||
void start(){
|
||||
long time = context.getScenario().getSchedule().getScheduleRange()
|
||||
long time = context.getSchedule().getScheduleRange()
|
||||
+ context.getStartDate().getTime();
|
||||
this.timer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
context.getScenario().getSchedule().stop();
|
||||
context.getSchedule().stop();
|
||||
}
|
||||
}, new Date(time));
|
||||
}
|
||||
|
||||
void stop(){
|
||||
this.context.getScenario().getSchedule().stop();
|
||||
this.context.getSchedule().stop();
|
||||
this.context.stop();
|
||||
this.timer.cancel();
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package org.bench4q.agent.test;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
@ -12,6 +13,7 @@ import org.bench4q.agent.plugin.ParameterBarn;
|
|||
import org.bench4q.agent.plugin.PluginManager;
|
||||
import org.bench4q.agent.scenario.Scenario;
|
||||
import org.bench4q.agent.scenario.engine.ScenarioContext;
|
||||
import org.bench4q.agent.scenario.engine.Schedule;
|
||||
import org.bench4q.agent.scenario.engine.VUser;
|
||||
import org.bench4q.share.helper.TestHelper;
|
||||
import org.bench4q.share.models.agent.ParameterModel;
|
||||
|
@ -119,7 +121,24 @@ public abstract class TestBase {
|
|||
}
|
||||
|
||||
public VUser createVUser(Scenario scenario, UUID testId) {
|
||||
return new VUser(ScenarioContext.buildScenarioContext(testId, scenario,
|
||||
return new VUser(buildScenarioContext(testId, scenario,
|
||||
10, pluginManager), 1, this.getPluginManager());
|
||||
}
|
||||
|
||||
public static ScenarioContext buildScenarioContext(UUID testId,
|
||||
final Scenario scenario, int poolSize, PluginManager pluginManager) {
|
||||
ScenarioContext scenarioContext = ScenarioContext.buildScenarioContextWithoutScenario(
|
||||
testId, poolSize, pluginManager);
|
||||
return scenarioContext.addScenrio(scenario, Schedule.build(buildScheduleModel()), new Date().getTime());
|
||||
}
|
||||
|
||||
public static ScheduleModel buildScheduleModel(){
|
||||
ScheduleModel scheduleModel = new ScheduleModel();
|
||||
List<PointModel> points = new LinkedList<ScheduleModel.PointModel>();
|
||||
points.add(new PointModel(0, 0));
|
||||
points.add(new PointModel(20 * 1000, 20));
|
||||
points.add(new PointModel(60 * 1000, 20));
|
||||
scheduleModel.setPoints(points);
|
||||
return scheduleModel;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,8 +5,9 @@ import java.io.ByteArrayOutputStream;
|
|||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
@ -200,16 +201,14 @@ public class TestWithScriptFile {
|
|||
assertNotNull(bookResponse);
|
||||
assertNotNull(bookResponse.getRunId().toString());
|
||||
System.out.println(bookResponse.getRunId().toString());
|
||||
Map<String, String> stringPart = new LinkedHashMap<String, String>();
|
||||
stringPart.put("scenarioModel", MarshalHelper.tryMarshal(getScenarioModel()));
|
||||
//TODO:
|
||||
HttpResponse httpResponse = this.getHttpRequester().postFiles(
|
||||
null,
|
||||
url + "/submitScenarioWithParams/"
|
||||
+ bookResponse.getRunId().toString(), "files[]", files,
|
||||
"scenarioModel", new LinkedList<String>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
{
|
||||
add(MarshalHelper.tryMarshal(getScenarioModel()));
|
||||
}
|
||||
});
|
||||
stringPart);
|
||||
assertNotNull(httpResponse);
|
||||
assertNotNull(httpResponse.getContent());
|
||||
assertEquals(200, httpResponse.getCode());
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.util.concurrent.TimeUnit;
|
|||
import org.bench4q.agent.plugin.PluginManager;
|
||||
import org.bench4q.agent.scenario.Scenario;
|
||||
import org.bench4q.agent.scenario.engine.ScenarioContext;
|
||||
import org.bench4q.agent.test.TestBase;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -16,13 +17,13 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|||
|
||||
@RunWith(SpringJUnit4ClassRunner.class)
|
||||
@ContextConfiguration(locations = { "classpath:application-context.xml" })
|
||||
public class Test_ScenarioContext {
|
||||
public class Test_ScenarioContext extends TestBase {
|
||||
@Autowired
|
||||
private PluginManager pluginManager;
|
||||
|
||||
@Test
|
||||
public void testBuildScenarioContext() {
|
||||
ScenarioContext context = ScenarioContext.buildScenarioContext(
|
||||
ScenarioContext context = buildScenarioContext(
|
||||
UUID.randomUUID(), new Scenario(), 20, this.pluginManager);
|
||||
assertEquals(10,
|
||||
context.getExecutor().getKeepAliveTime(TimeUnit.MINUTES));
|
||||
|
|
|
@ -41,7 +41,7 @@ public class Test_ScenarioEngine extends TestBase {
|
|||
|
||||
@Test
|
||||
public void test_UpdatePopulation() {
|
||||
ScenarioContext scenarioContext = ScenarioContext.buildScenarioContext(
|
||||
ScenarioContext scenarioContext = buildScenarioContext(
|
||||
testId,
|
||||
Scenario.scenarioBuilderWithCompile(buildRunScenarioModelWith(
|
||||
new ArrayList<UsePluginModel>(), BehaviorModel
|
||||
|
@ -56,7 +56,7 @@ public class Test_ScenarioEngine extends TestBase {
|
|||
|
||||
@Test
|
||||
public void test_RunWithContext() throws IOException {
|
||||
ScenarioContext scenarioContext = ScenarioContext.buildScenarioContext(
|
||||
ScenarioContext scenarioContext = buildScenarioContext(
|
||||
testId, Scenario.scenarioBuilderWithCompile(FileUtils
|
||||
.readFileToString(new File("Scripts"
|
||||
+ System.getProperty("file.separator")
|
||||
|
|
|
@ -84,4 +84,6 @@ public class Test_Shedule {
|
|||
Segment segment = schedule.getSegment(500 * 1000);
|
||||
assertNotNull(segment);
|
||||
}
|
||||
|
||||
//TODO : add more test about getSegment, you will got some error
|
||||
}
|
||||
|
|
|
@ -2,8 +2,9 @@ package org.bench4q.master.infrastructure.communication.impl;
|
|||
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
@ -79,15 +80,14 @@ public class AgentMessengerImpl implements AgentMessenger {
|
|||
try {
|
||||
final String modelContent = MarshalHelper
|
||||
.tryMarshal(runScenarioModel);
|
||||
final Map<String, String> stringParts = new LinkedHashMap<String, String>();
|
||||
stringParts.put("scenarioModel", modelContent);
|
||||
stringParts.put("realStartTime",
|
||||
String.valueOf(realStartDate.getTime()));
|
||||
httpResponse = this.httpRequester.postFiles(null,
|
||||
buildBaseUrl(agent) + "/test/submitScenarioWithParams/"
|
||||
+ agentRunId+ "/" + realStartDate.getTime(), "files[]", paramFiles,
|
||||
"scenarioModel", new LinkedList<String>() {
|
||||
private static final long serialVersionUID = 1L;
|
||||
{
|
||||
add(modelContent);
|
||||
}
|
||||
});
|
||||
+ agentRunId + "/" + realStartDate.getTime(),
|
||||
"files[]", paramFiles, stringParts);
|
||||
return (RunScenarioResultModel) MarshalHelper.unmarshal(
|
||||
RunScenarioResultModel.class, httpResponse.getContent());
|
||||
} catch (Exception e) {
|
||||
|
@ -98,7 +98,8 @@ public class AgentMessengerImpl implements AgentMessenger {
|
|||
|
||||
public Future<RunScenarioResultModel> submitScenarioWithParamsAsync(
|
||||
final Agent agent, final UUID agentRunId,
|
||||
final List<File> paramFiles, final RunScenarioModel runScenarioModel, final Date realStartDate) {
|
||||
final List<File> paramFiles,
|
||||
final RunScenarioModel runScenarioModel, final Date realStartDate) {
|
||||
return this.executorService
|
||||
.submit(new Callable<RunScenarioResultModel>() {
|
||||
@Override
|
||||
|
|
|
@ -116,8 +116,7 @@ public class HttpRequester {
|
|||
}
|
||||
|
||||
public HttpResponse postFiles(Map<String, String> headers, String url,
|
||||
String filePartName, List<File> files, String stringPartName,
|
||||
List<String> strings) {
|
||||
String filePartName, List<File> files, Map<String, String> stringParts) {
|
||||
if (!url.startsWith("http"))
|
||||
url = "http://" + url;
|
||||
PostMethod postMethod = new PostMethod(url);
|
||||
|
@ -131,15 +130,17 @@ public class HttpRequester {
|
|||
}
|
||||
|
||||
}
|
||||
Part[] parts = new Part[files.size() + strings.size()];
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
Part[] parts = new Part[files.size() + stringParts.size()];
|
||||
int i = 0;
|
||||
for (; i < files.size(); i++) {
|
||||
FilePart filePart = new FilePart(filePartName, files.get(i)
|
||||
.getName(), files.get(i));
|
||||
parts[i] = filePart;
|
||||
}
|
||||
for (int i = 0; i < strings.size(); i++) {
|
||||
parts[i + files.size()] = new StringPart(stringPartName,
|
||||
strings.get(i));
|
||||
for (Entry<String, String> entry : stringParts.entrySet()) {
|
||||
parts[i + files.size()] = new StringPart(entry.getKey(),
|
||||
entry.getValue());
|
||||
i++;
|
||||
}
|
||||
postMethod.setRequestEntity(new MultipartRequestEntity(parts,
|
||||
postMethod.getParams()));
|
||||
|
@ -154,7 +155,7 @@ public class HttpRequester {
|
|||
|
||||
public HttpResponse postFilesMulti(Map<String, String> headers, String url,
|
||||
String filePartName, MultipartFile[] multipartFiles,
|
||||
String stringPartName, List<String> strings) throws IOException {
|
||||
Map<String, String> stringParts) throws IOException {
|
||||
List<File> files = new LinkedList<File>();
|
||||
if (multipartFiles != null) {
|
||||
for (MultipartFile multipartFile : multipartFiles) {
|
||||
|
@ -165,8 +166,7 @@ public class HttpRequester {
|
|||
}
|
||||
}
|
||||
|
||||
return postFiles(headers, url, filePartName, files, stringPartName,
|
||||
strings);
|
||||
return postFiles(headers, url, filePartName, files, stringParts);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
package org.bench4q.web.masterMessager;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.xml.bind.JAXBException;
|
||||
|
@ -64,15 +63,13 @@ public class ScriptMessager extends MasterMessager {
|
|||
public OperateScriptServerResponseModel uploadScriptFile(
|
||||
String accessToken, String scriptName, String scenarioModel) {
|
||||
String url = this.getBaseUrl() + "/uploadScript" + "/" + scriptName;
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
params.put("scenarioModel", scenarioModel);
|
||||
Map<String, String> stringPart = new HashMap<String, String>();
|
||||
stringPart.put("scenarioModel", scenarioModel);
|
||||
HttpResponse httpResponse = null;
|
||||
List<String> stringPartsList = new LinkedList<String>();
|
||||
stringPartsList.add(scenarioModel);
|
||||
try {
|
||||
httpResponse = this.getHttpRequester().postFilesMulti(
|
||||
makeAccessTockenMap(accessToken), url, "paramFiles[]",
|
||||
null, "scenarioModel", stringPartsList);
|
||||
null, stringPart);
|
||||
System.out.println(httpResponse.getContent());
|
||||
if (!validateHttpResponse(httpResponse))
|
||||
return null;
|
||||
|
@ -90,14 +87,14 @@ public class ScriptMessager extends MasterMessager {
|
|||
public OperateScriptServerResponseModel uploadScript(String accessToken,
|
||||
String scriptName, String scenarioModel, MultipartFile[] paramFiles) {
|
||||
String url = this.getBaseUrl() + "/uploadScript" + "/" + scriptName;
|
||||
List<String> stringPart = new LinkedList<String>();
|
||||
stringPart.add(scenarioModel);
|
||||
HttpResponse httpResponse = null;
|
||||
|
||||
try {
|
||||
Map<String, String> stringParts = new LinkedHashMap<String, String>();
|
||||
stringParts.put("scenarioModel", scenarioModel);
|
||||
httpResponse = this.getHttpRequester().postFilesMulti(
|
||||
makeAccessTockenMap(accessToken), url, "paramFiles[]",
|
||||
paramFiles, "scenarioModel", stringPart);
|
||||
paramFiles, stringParts);
|
||||
if (!validateHttpResponse(httpResponse))
|
||||
return null;
|
||||
return (OperateScriptServerResponseModel) MarshalHelper.unmarshal(
|
||||
|
|
|
@ -117,6 +117,7 @@ addIp=Add IP
|
|||
testPlanName=Test Plan Name
|
||||
plugin_jsp_addNewPlugin=Add a new plug-in
|
||||
plugin_jsp_chooseBehaviors=Choose the behaviors of plug-in
|
||||
plugin_jsp_chooseFilter=Choose the filter of behaviors
|
||||
plugin_jsp_removeAll=Remove All
|
||||
plugin_jsp_remove=Remove
|
||||
plugin_jsp_cancel=Cancel
|
||||
|
@ -132,6 +133,7 @@ plugin_jsp_scriptName=Script Name:
|
|||
plugin_jsp_insertBefore=Insert Before
|
||||
plugin_jsp_insertAfter=Insert After
|
||||
plugin_jsp_clear=Clear
|
||||
plugin_jsp_filter=Filter
|
||||
plugin_jsp_insertChild=Insert Child
|
||||
plugin_jsp_addPage=Add Page
|
||||
script_jsp_makeScript=ScriptEdit
|
||||
|
@ -207,4 +209,6 @@ testExecuteTime=Execute Time
|
|||
startServerFail=Fail to start record server:
|
||||
stopTestPlan=Stop Test
|
||||
stop=Stop
|
||||
testProxySettings=testProxySettings
|
||||
testProxySettings=testProxySettings
|
||||
startRecording=startRecording
|
||||
startrecording=start recording to generate a script or upload a script to server
|
|
@ -118,6 +118,7 @@ startTest=\u5F00\u59CB\u6D4B\u8BD5
|
|||
testPlanName=\u6D4B\u8BD5\u540D\u79F0
|
||||
plugin_jsp_addNewPlugin=\u6DFB\u52A0\u4E00\u4E2A\u65B0\u7684\u63D2\u4EF6
|
||||
plugin_jsp_chooseBehaviors=\u9009\u62E9\u63D2\u4EF6\u7684\u52A8\u4F5C
|
||||
plugin_jsp_chooseFilter=\u9009\u62e9\u8981\u8fc7\u6ee4\u7684\u884c\u4e3a
|
||||
plugin_jsp_removeAll=\u5168\u90E8\u79FB\u9664
|
||||
plugin_jsp_remove=\u79FB\u9664
|
||||
plugin_jsp_cancel=\u53D6\u6D88
|
||||
|
@ -134,6 +135,7 @@ plugin_jsp_insertBefore=\u524D\u5BFC\u5165
|
|||
plugin_jsp_insertAfter=\u540E\u5BFC\u5165
|
||||
plugin_jsp_insertChild=\u63D2\u5165
|
||||
plugin_jsp_clear=\u6E05\u7A7A
|
||||
plugin_jsp_filter=\u8fc7\u6ee4
|
||||
plugin_jsp_addPage=\u52A0\u9875
|
||||
script_jsp_makeScript=\u811A\u672C\u7F16\u8F91
|
||||
script_jsp_recordScript=\u5F55\u5236\u811A\u672C
|
||||
|
@ -208,4 +210,6 @@ startServer=\u70B9\u51FB\u542F\u52A8\u670D\u52A1\u5F55\u5236\u811A\u672C\u6216\u
|
|||
testExecuteTime=\u6267\u884C\u65F6\u95F4
|
||||
stopTestPlan=\u505C\u6B62\u6D4B\u8BD5
|
||||
stop=\u505C\u6B62
|
||||
testProxySettings=\u6d4b\u8bd5Proxy\u8bbe\u7f6e
|
||||
testProxySettings=\u6d4b\u8bd5Proxy\u8bbe\u7f6e
|
||||
startRecording=\u5f00\u59cb\u5f55\u5236
|
||||
startrecording=\u70b9\u51fb\u5f00\u59cb\u5f55\u5236\u5f55\u5236\u811a\u672c
|
|
@ -45,4 +45,6 @@ stopRecord=The script recording has been stopped, please input the script name a
|
|||
saveScriptSuccess=Save successfully.
|
||||
saveScriptFail=Fail to save script.
|
||||
plugin_jsp_addPage=Add Page
|
||||
stopTestPlan_fail=Stop running test plan fail
|
||||
stopTestPlan_fail=Stop running test plan fail
|
||||
RecordingScript=Recording Script
|
||||
stopRecord=click stop server to stop recording script
|
|
@ -41,4 +41,6 @@ stopRecord=\u505C\u6B62\u811A\u672C\u5F55\u5236\uFF0C\u8BF7\u8F93\u5165\u811A\u6
|
|||
saveScriptSuccess=\u4FDD\u5B58\u6210\u529F\u3002
|
||||
saveScriptFail=\u4FDD\u5B58\u811A\u672C\u5931\u8D25
|
||||
plugin_jsp_addPage=\u52A0\u9875
|
||||
stopTestPlan_fail=\u505C\u6B62\u8FD0\u884C\u6D4B\u8BD5\u8BA1\u5212\u5931\u8D25
|
||||
stopTestPlan_fail=\u505C\u6B62\u8FD0\u884C\u6D4B\u8BD5\u8BA1\u5212\u5931\u8D25
|
||||
RecordingScript=\u6b63\u5728\u5f55\u5236\u811a\u672c
|
||||
stopRecord=\u70b9\u51fb\u505c\u6b62\u670d\u52a1\u5668\u505c\u6b62\u5f55\u5236\u811a\u672c
|
|
@ -155,13 +155,6 @@ body {
|
|||
<fmt:message key="uploadScript" />
|
||||
</button>
|
||||
</div>
|
||||
<div id="fileName" style="display: none" class="modal-footer">
|
||||
<input class="input-mini" name="scriptname"></input>
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="saveScript()">
|
||||
<fmt:message key="savefile" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal hide fade" id="mySecondModal">
|
||||
|
@ -185,13 +178,6 @@ body {
|
|||
<fmt:message key="plugin_jsp_cancel" />
|
||||
</button>
|
||||
</div>
|
||||
<div id="fileName" style="display: none" class="modal-footer">
|
||||
<input class="input-mini" name="scriptname"></input>
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="saveScript()">
|
||||
<fmt:message key="savefile" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal hide fade" id="myThirdModal">
|
||||
|
|
|
@ -70,6 +70,7 @@ function stopServer() {
|
|||
}
|
||||
|
||||
else {
|
||||
$('#stopServer').attr('disabled', false);
|
||||
$('#fileName').show();
|
||||
$('#scriptInfo3').text(
|
||||
$.i18n.prop("stopRecord")
|
||||
|
@ -136,7 +137,7 @@ function testRecordProxy() {
|
|||
$('#scriptInfo3').text(
|
||||
$.i18n.prop("RecordingScript"));
|
||||
//$('#startServer').attr('disabled', true);
|
||||
$('#stopServer').attr('disabled', true);
|
||||
//$('#stopServer').attr('disabled', true);
|
||||
} else {
|
||||
$('#scriptInfo2').html(
|
||||
$.i18n.prop("ProxySettingError") + data.failedMessage);
|
||||
|
@ -157,7 +158,11 @@ function startRecording() {
|
|||
$('#startRecording').attr('disabled', true);
|
||||
}
|
||||
else {
|
||||
window.open('http://www.baidu.com/')
|
||||
$('#scriptInfo3').text($.i18n.prop("stopRecord"));
|
||||
var url = $('#target-url').val();
|
||||
window.open(url);
|
||||
$('#stopServer').attr('disabled', false);
|
||||
$('#startRecording').attr('disabled', true);
|
||||
}
|
||||
}, "json");
|
||||
} else {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
var script = new Array();
|
||||
var filter = new Array();
|
||||
$(document).ready(function() {
|
||||
$.post("loadScripts", {}, function(data) {
|
||||
if (!data.success) {
|
||||
|
@ -23,6 +24,53 @@ $(document).ready(function() {
|
|||
$(document).ready(function() {
|
||||
loadSchedulePlot();
|
||||
});
|
||||
|
||||
|
||||
function createFilter(){
|
||||
$.post("loadFilterTypeList", {}, function(data) {
|
||||
if(!data.success){
|
||||
information(data.failedMessage);
|
||||
return;
|
||||
}else{
|
||||
$('#selectFilter').show();
|
||||
data = data.filterTypeList;
|
||||
for ( var i = 0; i < data.length; i++)
|
||||
filter.push(data[i]);
|
||||
for( var j = 0; j < filter.length; j++){
|
||||
var textNode = document.createTextNode(filter[j]);
|
||||
var checkboxNode = document.createElement("input");
|
||||
checkboxNode.setAttribute("type", "checkbox");
|
||||
checkboxNode.setAttribute("name", "filterList");
|
||||
checkboxNode.setAttribute("id", "filterList"+j);
|
||||
checkboxNode.appendChild(textNode);
|
||||
|
||||
/* var line = $("<div style='cursor:pointer;'>");
|
||||
line.click(function(){
|
||||
document.getElementById(id).checked = true;
|
||||
})
|
||||
var input = $("<input type='radio' name="+name+" id="+id+">");
|
||||
input.attr("value",value);
|
||||
input.attr("text",text);
|
||||
var span = $("<label for="+id+" style='cursor:pointer;'>");
|
||||
span.html(text);
|
||||
line.append(input);
|
||||
line.append(span);
|
||||
line.addClass("line");
|
||||
*/
|
||||
$('#filterList').append(checkboxNode);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$("#selectFilter #ok").click(function() {
|
||||
$("#selectFilter").hide();
|
||||
});
|
||||
|
||||
$("#selectFilter #cancel").click(function() {
|
||||
$("#selectFilter").hide();
|
||||
});
|
||||
|
||||
function toggleTestExecutionPlan() {
|
||||
$("#loadTestExecutionPlan").slideToggle();
|
||||
$('#loadConfigMessage').attr("class", "hide");
|
||||
|
|
|
@ -151,14 +151,14 @@ body {
|
|||
|
||||
</select></td>
|
||||
|
||||
<td><input type="checkbox" name="staticResources"
|
||||
<!-- <td><input type="checkbox" name="staticResources"
|
||||
value="false" data-toggle="tooltip" data-placement="left"
|
||||
title=<fmt:message key="staticTip" />> <fmt:message
|
||||
key="filterStatic" /></td>
|
||||
<td><input type="checkbox" name="timer" value="false"
|
||||
data-toggle="tooltip" data-placement="left"
|
||||
title=<fmt:message key="timeTip" />> <fmt:message
|
||||
key="filterTime" /><br></td>
|
||||
key="filterTime" /><br></td> -->
|
||||
<td><a href="#" class="button" onClick="viewScript(this)"><img
|
||||
src="images/script_edit.png" alt="Add"> <fmt:message
|
||||
key="test-editScript" /></a></td>
|
||||
|
@ -183,7 +183,27 @@ body {
|
|||
onClick="createNewScript()">
|
||||
<fmt:message key="test_jsp_makeNewScript" />
|
||||
</button>
|
||||
|
||||
|
||||
<button type="submit" class="btn btn-primary" id="createFilter"
|
||||
onClick="createFilter()">
|
||||
<fmt:message key="plugin_jsp_filter" />
|
||||
</button>
|
||||
<div class="modal hide" id="selectFilter">
|
||||
<!-- <div class="modal-header">
|
||||
<h3><fmt:message key="plugin_jsp_addNewPlugin" /></h3>
|
||||
</div> -->
|
||||
<div class="modal-body">
|
||||
<div class="inset scroll" id="filterList"></div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary btn-width" id="ok">
|
||||
<fmt:message key="plugin_jsp_finish" />
|
||||
</button>
|
||||
<button type="button" class="btn btn-primary btn-width" id="cancel">
|
||||
<fmt:message key="plugin_jsp_cancel" />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="userConfigMessage" class="hide">all input can not
|
||||
be empty and must be greater than zero!</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue