diff --git a/Bench4Q-Master/RecordScriptTestCase/baidu.html b/Bench4Q-Master/RecordScriptTestCase/baidu.html deleted file mode 100644 index 52ca5b51..00000000 --- a/Bench4Q-Master/RecordScriptTestCase/baidu.html +++ /dev/null @@ -1,63 +0,0 @@ - - - -???--??????????? - - - - - - - - -
???????? - - - - - - -
 ???????????
-
-
-

????????????????ÖÎ????!


-
-
-
    -
  1. 1. ?????????????????????

  2. -
  3. 2. ?????????????????????????????????????????

  4. -
  5. 3. ??????????????????
  6. - -
  7. - 4.?????¦Ê??????ï…??????????????? -


    - ???????????????????????????????????????????????????????hao123 -
  8. ??
- - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Bench4Q-Master/pluginUI/hbase.xml b/Bench4Q-Master/pluginUI/hbase.xml deleted file mode 100644 index 637e73cf..00000000 --- a/Bench4Q-Master/pluginUI/hbase.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - -
- -
- - - - - - - - -
-
- - - - - - - - - - - - - - - - -
\ No newline at end of file diff --git a/Bench4Q-Master/pluginUI/pluginUITest.xml b/Bench4Q-Master/pluginUI/pluginUITest.xml deleted file mode 100644 index bfc70fb4..00000000 --- a/Bench4Q-Master/pluginUI/pluginUITest.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - reset - - - next - - - CsvProvider - - - The name of the input file(Required) - fileName - - - diff --git a/Bench4Q-Master/pluginUI/test.xml b/Bench4Q-Master/pluginUI/test.xml deleted file mode 100644 index 4bdf2c92..00000000 --- a/Bench4Q-Master/pluginUI/test.xml +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/api/TestPlanController.java b/Bench4Q-Master/src/main/java/org/bench4q/master/api/TestPlanController.java index a1eba10d..cd1553a4 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/api/TestPlanController.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/api/TestPlanController.java @@ -166,7 +166,6 @@ public class TestPlanController extends BaseController { return ret; } - @RequestMapping(value = "/getBehaviorsBrief/{testPlanRunID}/{scriptId}") @ResponseBody public ScriptBehaviorsBriefModel getBehaviorsBrief( @@ -177,7 +176,7 @@ public class TestPlanController extends BaseController { + "when get behaviors's brief", "/getBehaviorsBrief"); } ScriptBehaviorsBriefModel result = this - .getTestPlanScriptResultService().getScriptBehaviorsBrief( + .getTestPlanScriptResultService().getLatestScriptBehaviorsBrief( testPlanRunID, scriptId); return result; } @@ -192,7 +191,7 @@ public class TestPlanController extends BaseController { + "when get behaviors's brief", "/getBehaviorsBrief"); } ScriptPagesBriefModel pagesBriefModel = this - .getTestPlanScriptResultService().getScriptPagesBrief( + .getTestPlanScriptResultService().getLatestScriptPagesBrief( testPlanRunId, scriptId); return pagesBriefModel; } @@ -284,6 +283,7 @@ public class TestPlanController extends BaseController { e.printStackTrace(); } } + @RequestMapping(value = "/scriptBrief/{testPlanId}/{scriptId}/latestResult") @ResponseStatus(value = HttpStatus.OK) @ResponseBody diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/TestPlan.java b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/TestPlan.java index 5081c7a2..451c8d43 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/TestPlan.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/TestPlan.java @@ -272,7 +272,9 @@ public class TestPlan implements IAggregate { } } + + private List createMonitorFinishedResult() { List resultList = new LinkedList(); if (getMonitors() != null) { diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/TestPlanScript.java b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/TestPlanScript.java index 6769131c..f6d618a9 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/TestPlanScript.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/entity/TestPlanScript.java @@ -47,7 +47,6 @@ public class TestPlanScript implements RunningScriptInterface { private Set runningAgents; private Set testPlanScriptResults; private boolean finish; - private TestPlanFactory testPlanFactory; private TransactionFactory transactionFactory; private RunningScriptSampler sampler; diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/factory/TestPlanFactory.java b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/factory/TestPlanFactory.java index 1d90f356..cfd1e904 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/factory/TestPlanFactory.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/factory/TestPlanFactory.java @@ -189,11 +189,12 @@ public class TestPlanFactory { try { fields[i].setAccessible(true); - testPlanScriptResult.setResultContent(MarshalHelper.marshal( - fields[i].getType(), fields[i].get(scriptResultModel))); + String content=MarshalHelper.marshal( + fields[i].getType(), fields[i].get(scriptResultModel)); + testPlanScriptResult.setResultContent(content); } catch (IllegalArgumentException | IllegalAccessException | JAXBException e) { - Logger.getLogger(MonitorResult.class).info( + Logger.getLogger(this.getClass()).info( ExceptionLog.getStackTrace(e)); return null; } diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/service/TestPlanScriptResultService.java b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/service/TestPlanScriptResultService.java index 8e615518..05b316f8 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/service/TestPlanScriptResultService.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/service/TestPlanScriptResultService.java @@ -85,7 +85,7 @@ public class TestPlanScriptResultService { return results; } - public ScriptBehaviorsBriefModel getScriptBehaviorsBrief(UUID testPlanId, + public ScriptBehaviorsBriefModel getLatestScriptBehaviorsBrief(UUID testPlanId, int scriptId) { Session session = this.getSessionHelper().openSession(); try { @@ -108,7 +108,6 @@ public class TestPlanScriptResultService { return new ScriptBehaviorsBriefModel(); } - private TestPlanScriptResult doGetLastSampleResult(UUID testPlanId, int scriptId, Class resultType, Session session) { TestPlanScript testPlanScript = this.getTestPlanRepository() @@ -126,7 +125,7 @@ public class TestPlanScriptResultService { return null; } - public ScriptPagesBriefModel getScriptPagesBrief(UUID testPlanId, + public ScriptPagesBriefModel getLatestScriptPagesBrief(UUID testPlanId, int scriptId) { Session session = this.getSessionHelper().openSession(); ScriptPagesBriefModel result = new ScriptPagesBriefModel(); @@ -148,6 +147,7 @@ public class TestPlanScriptResultService { } return result; } + public ScriptBriefResultModel getLatestScriptBriefResultModel( UUID testPlanId, int scriptId) { Session session = this.getSessionHelper().openSession(); @@ -160,4 +160,5 @@ public class TestPlanScriptResultService { ScriptBriefResultModel.class, testPlanScriptResult.getResultContent()); } + } diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/valueobject/datastatistics/BehaviorsBriefStatistics.java b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/valueobject/datastatistics/BehaviorsBriefStatistics.java index 47c06f59..d2f30b6c 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/valueobject/datastatistics/BehaviorsBriefStatistics.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/valueobject/datastatistics/BehaviorsBriefStatistics.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; - import org.bench4q.share.models.agent.BehaviorBriefModel; import org.bench4q.share.models.agent.BehaviorStatusCodeResultModel; import org.bench4q.share.models.agent.statistics.DataStatisticsModel; @@ -51,14 +50,32 @@ public class BehaviorsBriefStatistics extends ScriptStatistics { statusList.add(getCopy(behaviorId, statusCode)); } behaviorBriefModel.setDetailStatusCodeResultModels(statusList); + this.setBehaviorCount(behaviorBriefModel); list.add(behaviorBriefModel); } agentBehaviorsBriefModel.setBehaviorBriefModels(list); - result.setTestBehaviorsBriefModel(agentBehaviorsBriefModel); + result.setBehaviorBriefModels(agentBehaviorsBriefModel + .getBehaviorBriefModels()); makeUpResultModelWithSamplingTime(result); return result; } + private void setBehaviorCount(BehaviorBriefModel behaviorBriefModel) { + long totalCount = 0, successfulCount = 0; + if (behaviorBriefModel.getDetailStatusCodeResultModels() == null) { + return; + } + for (BehaviorStatusCodeResultModel behaviorStatusCodeResultModel : behaviorBriefModel + .getDetailStatusCodeResultModels()) { + totalCount += behaviorStatusCodeResultModel.getCount(); + if (behaviorStatusCodeResultModel.getStatusCode() == 200) { + successfulCount += behaviorStatusCodeResultModel.getCount(); + } + } + behaviorBriefModel.setTotalCount(totalCount); + behaviorBriefModel.setSuccessfulCount(successfulCount); + } + private BehaviorStatusCodeResultModel getCopy(int behaviorId, int statusCode) { BehaviorStatusCodeResultModel statusInMap = this.getMap() .get(behaviorId).get(statusCode); diff --git a/Bench4Q-Master/src/test/java/org/bench4q/master/integrated/Test_RunningScriptSampler.java b/Bench4Q-Master/src/test/java/org/bench4q/master/integrated/Test_RunningScriptSampler.java index 85b6c705..196ba9bb 100644 --- a/Bench4Q-Master/src/test/java/org/bench4q/master/integrated/Test_RunningScriptSampler.java +++ b/Bench4Q-Master/src/test/java/org/bench4q/master/integrated/Test_RunningScriptSampler.java @@ -58,7 +58,7 @@ public class Test_RunningScriptSampler extends TestBase_MakeUpTestPlan { assertNotNull(scriptResultModel); assertNotNull(scriptResultModel.getScriptBriefResultModel()); assertTrue(scriptResultModel.getScriptBehaviorsBriefModel() - .getTestBehaviorsBriefModel().getBehaviorBriefModels().size() > 0); + .getBehaviorBriefModels().size() > 0); assertTrue(scriptResultModel.getScriptPagesBriefModel() .getScriptPageBriefModels().size() > 0); } diff --git a/Bench4Q-Master/src/test/java/org/bench4q/master/unitTest/service/Test_TestPlanScriptResultService.java b/Bench4Q-Master/src/test/java/org/bench4q/master/unitTest/service/Test_TestPlanScriptResultService.java index b03eff34..bf8e7a16 100644 --- a/Bench4Q-Master/src/test/java/org/bench4q/master/unitTest/service/Test_TestPlanScriptResultService.java +++ b/Bench4Q-Master/src/test/java/org/bench4q/master/unitTest/service/Test_TestPlanScriptResultService.java @@ -43,12 +43,12 @@ public class Test_TestPlanScriptResultService extends TestBase_MakeUpTestPlan { this.getScriptId(), 0); ScriptPagesBriefModel scriptPagesBriefModel = this .getTestPlanScriptResultService() - .getScriptPagesBrief( + .getLatestScriptPagesBrief( UUID.fromString("fdfe0e55-c65f-4829-ae7c-b1d3a90f62d5"), this.getScriptId()); ScriptBehaviorsBriefModel behavirosResults = this .getTestPlanScriptResultService() - .getScriptBehaviorsBrief( + .getLatestScriptBehaviorsBrief( UUID.fromString("fdfe0e55-c65f-4829-ae7c-b1d3a90f62d5"), this.getScriptId()); assertEquals(0, results.size());