change filter script to testplanscript from script
This commit is contained in:
parent
e4bd0ded75
commit
47d4b97131
|
@ -180,7 +180,7 @@ public class RunningAgentDB implements RunningAgentInterface {
|
|||
Script script2 = this.getTestPlanScript().getScript();
|
||||
RunScenarioModel runScenarioModel = (RunScenarioModel) MarshalHelper
|
||||
.tryUnmarshal(RunScenarioModel.class,
|
||||
script2.getFilteredScriptCnt());
|
||||
this.getTestPlanScript().getFilteredScriptCnt());
|
||||
runScenarioModel.setPoolSize(getLoadInUse());
|
||||
RunScenarioResultModel runScenarioResultModel = this
|
||||
.getAgentMessenger().submitScenrioWithParams(this.getAgent(),
|
||||
|
|
|
@ -27,7 +27,6 @@ public class Script {
|
|||
private int id;
|
||||
private String name;
|
||||
private String scriptContent;
|
||||
private String filteredScriptCnt;
|
||||
private int behaviorCount;
|
||||
private Date createDateTime;
|
||||
private User user;
|
||||
|
@ -135,12 +134,4 @@ public class Script {
|
|||
}
|
||||
return Arrays.asList(folder.listFiles());
|
||||
}
|
||||
|
||||
public String getFilteredScriptCnt() {
|
||||
return filteredScriptCnt;
|
||||
}
|
||||
|
||||
public void setFilteredScriptCnt(String filteredScriptCnt) {
|
||||
this.filteredScriptCnt = filteredScriptCnt;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@ public class TestPlanScript implements RunningScriptInterface {
|
|||
private RunningScriptSampler sampler;
|
||||
private Logger logger = Logger.getLogger(TestPlanScript.class);
|
||||
private static int SECOND_MILISECOND_UNIT_CONVERSION = 1000;
|
||||
private String filteredScriptCnt;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
|
@ -301,4 +302,12 @@ public class TestPlanScript implements RunningScriptInterface {
|
|||
public Date getStartTime() {
|
||||
return this.getTestPlan().getCurrentStartTime();
|
||||
}
|
||||
|
||||
public String getFilteredScriptCnt() {
|
||||
return filteredScriptCnt;
|
||||
}
|
||||
|
||||
public void setFilteredScriptCnt(String filteredScriptCnt) {
|
||||
this.filteredScriptCnt = filteredScriptCnt;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -156,18 +156,19 @@ public class TestPlanFactory {
|
|||
TestPlanScript testPlanScript = new TestPlanScript();
|
||||
testPlanScript.setRequireLoad(requireLoad);
|
||||
// filter the script
|
||||
testPlanScript.setScript(createAScriptWithFilter(
|
||||
scriptFilterOptionsModel,
|
||||
this.getScriptService().getScript(scriptId)));
|
||||
Script script = this.getScriptService().getScript(scriptId);
|
||||
testPlanScript.setFilteredScriptCnt(createAScriptWithFilter(
|
||||
scriptFilterOptionsModel,script.getScriptContent()));
|
||||
testPlanScript.setScript(script);
|
||||
testPlanScript.setPlanedConfig(createAPlanedConfigWithoutId(config));
|
||||
testPlanScript.setTestPlan(testPlanDB);
|
||||
return testPlanScript;
|
||||
}
|
||||
|
||||
private Script createAScriptWithFilter(
|
||||
ScriptFilterOptionsModel scriptFilterOptionsModel, Script script) {
|
||||
private String createAScriptWithFilter(
|
||||
ScriptFilterOptionsModel scriptFilterOptionsModel, String scriptContent) {
|
||||
RunScenarioModel runScenarioModel = (RunScenarioModel) MarshalHelper
|
||||
.tryUnmarshal(RunScenarioModel.class, script.getScriptContent());
|
||||
.tryUnmarshal(RunScenarioModel.class, scriptContent);
|
||||
List<String> filterPluginId = new ArrayList<String>();
|
||||
if (scriptFilterOptionsModel.isFilterTimer()) {
|
||||
for (UsePluginModel pluginModel : runScenarioModel.getUsePlugins()) {
|
||||
|
@ -197,8 +198,7 @@ public class TestPlanFactory {
|
|||
}
|
||||
String contentString = MarshalHelper.tryMarshal(runScenarioModel);
|
||||
System.out.println(contentString);
|
||||
script.setFilteredScriptCnt(contentString);
|
||||
return script;
|
||||
return contentString;
|
||||
}
|
||||
|
||||
private boolean isFilterType(String filterTypeMatch,
|
||||
|
|
Loading…
Reference in New Issue