Merge remote-tracking branch 'origin/master'

Conflicts:

	Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/RunningAgentDB.java

	Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/TestPlanScript.java
This commit is contained in:
coderfengyun 2014-09-04 14:09:13 +08:00
commit 55a78b46fe
4 changed files with 20 additions and 19 deletions

View File

@ -180,8 +180,8 @@ public class RunningAgentDB implements RunningAgentInterface {
public boolean distributeScriptAndParams() {
Script script2 = this.getTestPlanScript().getScript();
RunScenarioModel runScenarioModel = (RunScenarioModel) MarshalHelper
.tryUnmarshal(RunScenarioModel.class,
script2.getScriptContent());
.tryUnmarshal(RunScenarioModel.class, this.getTestPlanScript()
.getFilteredScriptCnt());
runScenarioModel.setPoolSize(getLoadInUse());
RunScenarioResultModel runScenarioResultModel = this
.getAgentMessenger().submitScenrioWithParams(

View File

@ -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;
}
}

View File

@ -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)
@ -305,4 +306,13 @@ public class TestPlanScript implements RunningScriptInterface {
public String getScheduleContent() {
return this.getPlanedConfig().getScheduleContent();
}
@Transient
public String getFilteredScriptCnt() {
return filteredScriptCnt;
}
public void setFilteredScriptCnt(String filteredScriptCnt) {
this.filteredScriptCnt = filteredScriptCnt;
}
}

View File

@ -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,