diff --git a/Bench4Q-Agent/src/main/java/org/bench4q/agent/api/HomeController.java b/Bench4Q-Agent/src/main/java/org/bench4q/agent/api/HomeController.java index 22d6d739..1077e3a2 100644 --- a/Bench4Q-Agent/src/main/java/org/bench4q/agent/api/HomeController.java +++ b/Bench4Q-Agent/src/main/java/org/bench4q/agent/api/HomeController.java @@ -46,4 +46,10 @@ public class HomeController { } return serverStatusModel; } + + // @RequestMapping(method = { RequestMethod.GET, RequestMethod.POST }) + // @ResponseBody + // public ServerStatusModel reset() { + // + // } } diff --git a/Bench4Q-Agent/src/test/java/org/bench4q/agent/test/TestWithScriptFile.java b/Bench4Q-Agent/src/test/java/org/bench4q/agent/test/TestWithScriptFile.java index c8b474e6..c610ca04 100644 --- a/Bench4Q-Agent/src/test/java/org/bench4q/agent/test/TestWithScriptFile.java +++ b/Bench4Q-Agent/src/test/java/org/bench4q/agent/test/TestWithScriptFile.java @@ -62,7 +62,7 @@ public class TestWithScriptFile { public TestWithScriptFile() { this.setFilePath("Scripts" + System.getProperty("file.separator") - + "http.xml"); + + "httpWithoutTimer.xml"); this.setHttpRequester(new HttpRequester()); } diff --git a/Bench4Q-Agent/src/test/java/org/bench4q/agent/test/plugin/Test_HttpPlugin.java b/Bench4Q-Agent/src/test/java/org/bench4q/agent/test/plugin/Test_HttpPlugin.java index 15c9c8b3..22df2af5 100644 --- a/Bench4Q-Agent/src/test/java/org/bench4q/agent/test/plugin/Test_HttpPlugin.java +++ b/Bench4Q-Agent/src/test/java/org/bench4q/agent/test/plugin/Test_HttpPlugin.java @@ -146,7 +146,8 @@ public class Test_HttpPlugin extends TestBase { public void buildAScenario() throws IOException { RunScenarioModel scenarioMode = (RunScenarioModel) MarshalHelper .tryUnmarshal(RunScenarioModel.class, FileUtils - .readFileToString(new File("Scripts/http.xml"))); + .readFileToString(new File( + "Scripts/httpWithoutTimer.xml"))); VUser vUser = createVUser( Scenario.scenarioBuilderWithCompile(scenarioMode), UUID.randomUUID()); 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 cd1553a4..8c33cc2f 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 @@ -161,6 +161,8 @@ public class TestPlanController extends BaseController { List scriptBriefResultModels = this .getTestPlanScriptResultService().loadScriptBriefWithDuation( testPlanId, scriptId, duationBegin); + System.out.println("Script Result Size : " + + scriptBriefResultModels.size()); TestPlanScriptBriefResultModel ret = new TestPlanScriptBriefResultModel(); ret.setScriptBriefResultModels(scriptBriefResultModels); return ret; @@ -176,8 +178,8 @@ public class TestPlanController extends BaseController { + "when get behaviors's brief", "/getBehaviorsBrief"); } ScriptBehaviorsBriefModel result = this - .getTestPlanScriptResultService().getLatestScriptBehaviorsBrief( - testPlanRunID, scriptId); + .getTestPlanScriptResultService() + .getLatestScriptBehaviorsBrief(testPlanRunID, scriptId); return result; } diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/repository/AgentRepository.java b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/repository/AgentRepository.java index d2a846a3..a62f2e13 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/repository/AgentRepository.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/repository/AgentRepository.java @@ -6,6 +6,7 @@ import java.util.List; import org.bench4q.master.domain.entity.Agent; import org.bench4q.master.exception.ExceptionLog; import org.bench4q.master.exception.ExceptionUtils.EntityUniqueAlReadyExistException; +import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.criterion.Order; @@ -158,7 +159,8 @@ public class AgentRepository extends AbstractRepositoty { Session session = this.getSessionHelper().openSession(); try { return session.createCriteria(Agent.class) - .addOrder(Order.desc("remainLoad")).list(); + .addOrder(Order.desc("remainLoad")) + .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY).list(); } catch (Exception e) { e.printStackTrace(); return null; diff --git a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/repository/ScriptRepositoty.java b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/repository/ScriptRepositoty.java index 11634e08..f1a327ac 100644 --- a/Bench4Q-Master/src/main/java/org/bench4q/master/domain/repository/ScriptRepositoty.java +++ b/Bench4Q-Master/src/main/java/org/bench4q/master/domain/repository/ScriptRepositoty.java @@ -7,6 +7,7 @@ import org.bench4q.master.domain.entity.Script; import org.bench4q.master.domain.entity.User; import org.bench4q.master.exception.ExceptionLog; import org.bench4q.master.exception.ExceptionUtils.EntityUniqueAlReadyExistException; +import org.hibernate.Criteria; import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.criterion.Criterion; @@ -20,9 +21,9 @@ public class ScriptRepositoty extends AbstractRepositoty { Session session = this.getSessionHelper().openSession(); Transaction transaction = session.beginTransaction(); try { - Script script=(Script)session.merge(scriptWithoutId); + Script script = (Script) session.merge(scriptWithoutId); transaction.commit(); - + return script; } catch (Exception e) { transaction.rollback(); @@ -115,7 +116,8 @@ public class ScriptRepositoty extends AbstractRepositoty { Session session = this.getSessionHelper().openSession(); @SuppressWarnings("unchecked") List