diff --git a/Bench4Q-Web/src/main/java/org/bench4q/web/api/ScriptController.java b/Bench4Q-Web/src/main/java/org/bench4q/web/api/ScriptController.java index c4b1ecc1..1bb91998 100644 --- a/Bench4Q-Web/src/main/java/org/bench4q/web/api/ScriptController.java +++ b/Bench4Q-Web/src/main/java/org/bench4q/web/api/ScriptController.java @@ -1,11 +1,12 @@ package org.bench4q.web.api; + +import java.io.IOException; import java.util.HashMap; import java.util.Map; import org.bench4q.share.helper.MarshalHelper; import org.bench4q.share.models.agent.RunScenarioModel; import org.bench4q.share.models.master.OperateScriptServerResponseModel; -import org.bench4q.share.models.master.RunningScriptModel; import org.bench4q.share.models.master.ScriptModel; import org.bench4q.web.masterMessager.ScriptMessager; import org.springframework.beans.factory.annotation.Autowired; @@ -17,7 +18,6 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.SessionAttributes; import org.springframework.web.multipart.MultipartFile; -import com.github.tomakehurst.wiremock.admin.NewStubMappingTask; import com.google.gson.Gson; @Controller @@ -56,7 +56,8 @@ public class ScriptController extends BaseController { @RequestMapping("deleteScript") @ResponseBody public Map deleteScript( - @ModelAttribute("accessToken") String accessToken, @RequestParam String scriptId) { + @ModelAttribute("accessToken") String accessToken, + @RequestParam String scriptId) { Map map = new HashMap(); return processScriptResponse(map, this.getScriptMessager() .deleteScript(accessToken, scriptId)); @@ -72,14 +73,16 @@ public class ScriptController extends BaseController { OperateScriptServerResponseModel operateScriptServerResponseModel = this .getScriptMessager().queryScriptById(accessToken, scriptId); if (operateScriptServerResponseModel.isSuccess()) { - ScriptModel scriptModel=operateScriptServerResponseModel.getScriptModels().get(0); - RunScenarioModel runScenarioModel= - (RunScenarioModel)MarshalHelper.tryUnmarshal(RunScenarioModel.class, scriptModel.getScriptContent()); - if(runScenarioModel==null){ - return fail(map, "error script"); - } - Gson gson=new Gson(); - map = success(map); + ScriptModel scriptModel = operateScriptServerResponseModel + .getScriptModels().get(0); + RunScenarioModel runScenarioModel = (RunScenarioModel) MarshalHelper + .tryUnmarshal(RunScenarioModel.class, + scriptModel.getScriptContent()); + if (runScenarioModel == null) { + return fail(map, "error script"); + } + Gson gson = new Gson(); + map = success(map); map.put("script", gson.toJson(runScenarioModel)); return map; } else { @@ -89,25 +92,46 @@ public class ScriptController extends BaseController { } } + @RequestMapping("uploadScriptFile") + @ResponseBody + public Map uploadScriptFile( + @ModelAttribute("accessToken") String accessToken, + @RequestParam String scriptName, + @RequestParam MultipartFile scriptFile) throws IOException { + String script = new String(scriptFile.getBytes()); + Map map = new HashMap(); + OperateScriptServerResponseModel operateScriptServerResponseModel = this + .getScriptMessager().uploadScriptFile(accessToken, scriptName, + script); + if (operateScriptServerResponseModel.isSuccess()) { + success(map); + map.put("message", (Object) new String("upload script:" + + scriptName + " success!")); + return map; + } else { + return fail(map, + operateScriptServerResponseModel.getFailCauseString()); + } + } + @RequestMapping("uploadScript") @ResponseBody public Map saveScript( @ModelAttribute("accessToken") String accessToken, @RequestParam String scriptName, @RequestParam String script, @RequestParam(required = false) MultipartFile[] paramFiles) { - Map map=new HashMap(); - OperateScriptServerResponseModel operateScriptServerResponseModel= - this.getScriptMessager().uploadScript(accessToken, scriptName, + Map map = new HashMap(); + OperateScriptServerResponseModel operateScriptServerResponseModel = this + .getScriptMessager().uploadScript(accessToken, scriptName, script, paramFiles); - if(operateScriptServerResponseModel.isSuccess()) - { + if (operateScriptServerResponseModel.isSuccess()) { success(map); - map.put("message", (Object) new String( - "upload script:" + scriptName + " success!")); + map.put("message", (Object) new String("upload script:" + + scriptName + " success!")); return map; - } - else { - return fail(map, operateScriptServerResponseModel.getFailCauseString()); + } else { + return fail(map, + operateScriptServerResponseModel.getFailCauseString()); } } @@ -131,7 +155,7 @@ public class ScriptController extends BaseController { .getScriptMessager().startScriptRecordServer(accessToken); if (operateScriptServerResponseModel.isSuccess()) { map = success(map); - map.put("server", operateScriptServerResponseModel); + map.put("server", operateScriptServerResponseModel); return map; } else { map = fail(map, @@ -165,7 +189,7 @@ public class ScriptController extends BaseController { scriptName, port, scriptRecordUUID)); } - + private Map processScriptResponse(Map map, OperateScriptServerResponseModel operateScriptServerResponseModel) { if (operateScriptServerResponseModel.isSuccess()) { diff --git a/Bench4Q-Web/src/main/java/org/bench4q/web/api/UserController.java b/Bench4Q-Web/src/main/java/org/bench4q/web/api/UserController.java index b524c470..5f73c500 100644 --- a/Bench4Q-Web/src/main/java/org/bench4q/web/api/UserController.java +++ b/Bench4Q-Web/src/main/java/org/bench4q/web/api/UserController.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.master.AuthorizeResponseModel; import org.bench4q.share.models.master.RegisterResponseModel; import org.bench4q.share.models.master.UserModel; @@ -16,7 +15,6 @@ import org.bench4q.web.validation.ValidateResponseModel; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; diff --git a/Bench4Q-Web/src/main/java/org/bench4q/web/masterMessager/ScriptMessager.java b/Bench4Q-Web/src/main/java/org/bench4q/web/masterMessager/ScriptMessager.java index e3bc5867..2e96c1b3 100644 --- a/Bench4Q-Web/src/main/java/org/bench4q/web/masterMessager/ScriptMessager.java +++ b/Bench4Q-Web/src/main/java/org/bench4q/web/masterMessager/ScriptMessager.java @@ -52,6 +52,32 @@ public class ScriptMessager extends MasterMessager { } + public OperateScriptServerResponseModel uploadScriptFile( + String accessToken, String scriptName, String scenarioModel) { + String url = this.getBaseUrl() + "/uploadScript" + "/" + scriptName; + Map params = new HashMap(); + params.put("scenarioModel", scenarioModel); + HttpResponse httpResponse = null; + List stringPartsList = new LinkedList(); + stringPartsList.add(scenarioModel); + try { + httpResponse = this.getHttpRequester().postFilesMulti( + makeAccessTockenMap(accessToken), url, "paramFiles[]", + null, "scenarioModel", stringPartsList); + System.out.println(httpResponse.getContent()); + if (!validateHttpResponse(httpResponse)) + return null; + return (OperateScriptServerResponseModel) MarshalHelper.unmarshal( + OperateScriptServerResponseModel.class, + httpResponse.getContent()); + + } catch (JAXBException | IOException e) { + this.handleException(httpResponse, e); + return createFailOperateScriptServerResponseModel(); + } + + } + public OperateScriptServerResponseModel uploadScript(String accessToken, String scriptName, String scenarioModel, MultipartFile[] paramFiles) { String url = this.getBaseUrl() + "/uploadScript" + "/" + scriptName; @@ -110,7 +136,7 @@ public class ScriptMessager extends MasterMessager { .getOperateScriptServerResponseModelByPost(url, params, accessToken); if (!operateScriptServerResponseModel.isSuccess() - || operateScriptServerResponseModel.getScriptModels().size() !=1) { + || operateScriptServerResponseModel.getScriptModels().size() != 1) { operateScriptServerResponseModel.setSuccess(false); operateScriptServerResponseModel .setFailCauseString("error get script by id:" + scriptId); diff --git a/Bench4Q-Web/src/main/java/org/bench4q/web/newapi/TestPlanController.java b/Bench4Q-Web/src/main/java/org/bench4q/web/newapi/TestPlanController.java index c01cf76f..81da3a38 100644 --- a/Bench4Q-Web/src/main/java/org/bench4q/web/newapi/TestPlanController.java +++ b/Bench4Q-Web/src/main/java/org/bench4q/web/newapi/TestPlanController.java @@ -63,7 +63,6 @@ public class TestPlanController extends BaseController { this.testPlanService = testPlanService; } - // not add to testPlan taskList=====not need @RequestMapping(value = "runTestPlan", method = RequestMethod.POST) @ResponseBody public Map runTestPlan( diff --git a/Bench4Q-Web/src/main/resources/ipConfig.properties b/Bench4Q-Web/src/main/resources/ipConfig.properties index 93407696..63e5d3c0 100644 --- a/Bench4Q-Web/src/main/resources/ipConfig.properties +++ b/Bench4Q-Web/src/main/resources/ipConfig.properties @@ -1 +1 @@ -masterAddress=133.133.12.1:7979/ \ No newline at end of file +masterAddress=127.0.0.1:7979/ \ No newline at end of file diff --git a/Bench4Q-Web/src/main/webapp/script/script.js b/Bench4Q-Web/src/main/webapp/script/script.js index 2b8c347f..04046d8a 100644 --- a/Bench4Q-Web/src/main/webapp/script/script.js +++ b/Bench4Q-Web/src/main/webapp/script/script.js @@ -38,9 +38,9 @@ function startServer() { $('#uploadScript').click(function(){ var myModalContent=$('#myModal').html(); $(".modal-footer").html(""); - var uploadForm='
'+ + var uploadForm=''+ '

script name:

'+ - '

script to upload:

'+ + '

script to upload:

'+ '

'; var status="

"; $('#scriptInfo').html(""); diff --git a/Bench4Q-Web/src/test/java/org/benc4q/test/newapi/ControllerTestBase.java b/Bench4Q-Web/src/test/java/org/benc4q/test/newapi/ControllerTestBase.java deleted file mode 100644 index 44d870c9..00000000 --- a/Bench4Q-Web/src/test/java/org/benc4q/test/newapi/ControllerTestBase.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.benc4q.test.newapi; - -import org.bench4q.web.tool.test.LoginHelper; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpRequest; - -public abstract class ControllerTestBase { - - protected String baseUrl = "http://127.0.0.1:8080"; - private LoginHelper loginHelper; - - private HttpRequest httpRequest; - - public LoginHelper getLoginHelper() { - return loginHelper; - } - - @Autowired - private void setLoginHelper(LoginHelper loginHelper) { - this.loginHelper = loginHelper; - } - - public HttpRequest getHttpRequest() { - return httpRequest; - } - - @Autowired - public void setHttpRequest(HttpRequest httpRequest) { - this.httpRequest = httpRequest; - } - -} diff --git a/Bench4Q-Web/src/test/java/org/benc4q/test/newapi/PluginControllerTest.java b/Bench4Q-Web/src/test/java/org/benc4q/test/newapi/PluginControllerTest.java deleted file mode 100644 index ee42a41e..00000000 --- a/Bench4Q-Web/src/test/java/org/benc4q/test/newapi/PluginControllerTest.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.benc4q.test.newapi; - -import org.junit.Before; -import org.junit.Test; - -public class PluginControllerTest extends ControllerTestBase { - - private String accessToken; - - @Before - public void setUp() { - this.accessToken = this.getLoginHelper().login(); - } - - @Test - public void testAddPlugin() { - - } - - @Test - public void testDeletePlugin() { - - } - - @Test - public void loadPluginNameList() { - - } - - @Test - public void loadPluginUIList() { - - } - - @Test - public void loadBehaviorList() { - - } - -} diff --git a/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/GsonHelper.java b/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/GsonHelper.java deleted file mode 100644 index 10f906b6..00000000 --- a/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/GsonHelper.java +++ /dev/null @@ -1,10 +0,0 @@ -package org.bench4q.web.tool.test; - -import com.google.gson.Gson; - -public class GsonHelper { - - public static Gson getGson() { - return new Gson(); - } -} diff --git a/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/LoginHelper.java b/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/LoginHelper.java deleted file mode 100644 index 3e2d7a32..00000000 --- a/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/LoginHelper.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.bench4q.web.tool.test; - -import org.apache.log4j.Logger; -import org.bench4q.share.helper.ExceptionLog; -import org.bench4q.share.models.master.UserModel; -import org.bench4q.web.api.AuthorizeActionController; -import org.bench4q.web.exception.CustomGenericException; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.ui.ModelMap; - -@Component -public class LoginHelper { - private final String userName = "admin"; - private final String password = "admin"; - private AuthorizeActionController authorizeActionController; - - private Logger logger = Logger.getLogger(LoginHelper.class); - - public AuthorizeActionController getAuthorizeActionController() { - return authorizeActionController; - } - - @Autowired - public void setAuthorizeActionController( - AuthorizeActionController authorizeActionController) { - this.authorizeActionController = authorizeActionController; - } - - public String login() { - - UserModel userModel = new UserModel(); - userModel.setUserName(userName); - userModel.setPassword(password); - try { - if (this.authorizeActionController == null) { - System.out.println(" null"); - } - ModelMap modelMap = new ModelMap(); - authorizeActionController.adminLogin(userModel, modelMap); - String accessToken = (String) modelMap.get("accessToken"); - return accessToken; - } catch (CustomGenericException e) { - logger.info(ExceptionLog.getStackTrace(e)); - return null; - } - } -} diff --git a/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/ScriptHelper.java b/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/ScriptHelper.java deleted file mode 100644 index e15167e7..00000000 --- a/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/ScriptHelper.java +++ /dev/null @@ -1,90 +0,0 @@ -package org.bench4q.web.tool.test; - -import java.io.File; -import java.io.IOException; -import java.util.UUID; - -import javax.xml.bind.JAXBException; - -import junit.framework.Assert; - -import org.apache.commons.io.FileUtils; -import org.apache.log4j.Logger; -import org.bench4q.share.helper.MarshalHelper; -import org.bench4q.share.models.agent.RunScenarioModel; -import org.bench4q.share.models.master.OperateScriptServerResponseModel; -import org.bench4q.share.models.master.ScriptModel; -import org.bench4q.web.api.ScriptActionController; -import org.bench4q.web.exception.CustomGenericException; -import org.bench4q.web.extractObjectFromXml.ObjectXmlExchange; -import org.bench4q.web.model.BaseResponseModel; -import org.bench4q.web.service.ScriptService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -import com.google.gson.Gson; - -@Component -public class ScriptHelper { - private String filePath = "src/test/resources/script.xml"; - - private ScriptService scriptService; - private ScriptModel scriptModel; - - private ScriptActionController scriptActionController; - - public ScriptService getScriptService() { - return scriptService; - } - - @Autowired - public void setScriptService(ScriptService scriptService) { - this.scriptService = scriptService; - } - - public ScriptActionController getScriptActionController() { - return scriptActionController; - } - - @Autowired - public void setScriptActionController( - ScriptActionController scriptActionController) { - this.scriptActionController = scriptActionController; - } - - public RunScenarioModel getRunScenarioModelFormFile() throws JAXBException, - IOException { - String scriptContent = FileUtils.readFileToString(new File(filePath)); - return (RunScenarioModel) ObjectXmlExchange.fromXml( - RunScenarioModel.class, scriptContent); - } - - public void deleteScript(String accessToken) throws CustomGenericException { - - BaseResponseModel baseResponseModel = this.getScriptActionController() - .deletescript(accessToken, - (new Integer(this.scriptModel.getId())).toString()); - Gson goGson = new Gson(); - Logger.getLogger(ScriptHelper.class).info( - goGson.toJson(baseResponseModel)); - if (baseResponseModel.isSuccess()) - Logger.getLogger(ScriptHelper.class).info("delete script"); - } - - public ScriptModel upLoadScriptAndGetId(String accessToken) - throws JAXBException, IOException, CustomGenericException { - - String scriptName = "testScript" + UUID.randomUUID(); - String scriptContent = MarshalHelper.marshal(RunScenarioModel.class, - getRunScenarioModelFormFile()); - OperateScriptServerResponseModel operateScriptServerResponseModel = this - .getScriptService().uploadScript(accessToken, scriptContent, - scriptName); - Assert.assertTrue(operateScriptServerResponseModel.isSuccess()); - ScriptModel scriptModel = this.getScriptService().queryScriptByName( - scriptName, accessToken); - this.scriptModel = scriptModel; - return scriptModel; - - } -} diff --git a/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/TestLoginHelper.java b/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/TestLoginHelper.java deleted file mode 100644 index b86efe2c..00000000 --- a/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/TestLoginHelper.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.bench4q.web.tool.test; - -import static org.junit.Assert.*; - -import java.util.List; - -import org.bench4q.share.models.master.ScriptModel; -import org.bench4q.web.api.ScriptActionController; -import org.bench4q.web.exception.CustomGenericException; -import org.bench4q.web.model.BaseResponseModel; -import org.bench4q.web.tool.test.LoginHelper; -import org.bench4q.web.tool.test.TestPlanHelper; -import org.junit.After; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(locations = { "file:src/test/resources/bench4qweb-servlet.xml" }) -public class TestLoginHelper { - private LoginHelper loginHelper; - - private ScriptActionController scriptActionController; - private TestPlanHelper startTestPlan; - - public LoginHelper getLoginHelper() { - return loginHelper; - } - - @Autowired - public void setLoginHelper(LoginHelper loginHelper) { - this.loginHelper = loginHelper; - } - - public TestPlanHelper getStartTestPlan() { - return startTestPlan; - } - - @Autowired - public void setStartTestPlan(TestPlanHelper startTestPlan) { - this.startTestPlan = startTestPlan; - } - - public ScriptActionController getScriptActionController() { - return scriptActionController; - } - - @Autowired - public void setScriptActionController( - ScriptActionController scriptActionController) { - this.scriptActionController = scriptActionController; - } - - @Test - public void testLoginHelper() { - String accessToken = this.getLoginHelper().login(); - - assertNotNull(accessToken); - } - - @SuppressWarnings("unchecked") - @Test - public void testLoginHelperRight() throws CustomGenericException { - String accessToken = this.getLoginHelper().login(); - BaseResponseModel baseResponseModel = this - .getScriptActionController().loadScript(accessToken); - List scriptModels=(List) - baseResponseModel.getData(); - assertTrue(baseResponseModel.isSuccess()); - assertTrue(scriptModels.size()>0); - - } - @Test - public void testLoginInStartTest() throws CustomGenericException{ - String accessToken = this.getLoginHelper().login(); - this.getStartTestPlan().startTest(accessToken); - assertNotNull(this.getStartTestPlan().getTestPlanRunId()); - - } - @After - public void clean() throws CustomGenericException{ - String accessToken = this.getLoginHelper().login(); - this.getStartTestPlan().cleanUpTest(accessToken); - } -} diff --git a/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/TestPlanHelper.java b/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/TestPlanHelper.java deleted file mode 100644 index faa21a81..00000000 --- a/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/TestPlanHelper.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.bench4q.web.tool.test; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import javax.xml.bind.JAXBException; - -import org.apache.log4j.Logger; -import org.bench4q.share.helper.ExceptionLog; -import org.bench4q.share.models.master.TestPlanResultModel; -import org.bench4q.web.api.TestPlanActionController; -import org.bench4q.web.exception.CustomGenericException; -import org.bench4q.web.model.TestPlanRequestModel; -import org.bench4q.web.model.WebScriptModel; -import org.bench4q.web.model.WebTestPlanResultModel; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import org.springframework.ui.ModelMap; - -@Component -public class TestPlanHelper { - public static final String MONITOR_IP = "133.133.12.3"; - private ScriptHelper scriptHelper; - private TestPlanActionController testPlanActionController; - private String testPlanRunId; - - public TestPlanActionController getTestPlanActionController() { - return testPlanActionController; - } - - @Autowired - public void setTestPlanActionController( - TestPlanActionController testPlanActionController) { - this.testPlanActionController = testPlanActionController; - } - - public ScriptHelper getScriptHelper() { - return scriptHelper; - } - - @Autowired - public void setScriptHelper(ScriptHelper scriptHelper) { - this.scriptHelper = scriptHelper; - } - - public String getTestPlanRunId() { - return testPlanRunId; - } - - private void setTestPlanRunId(String testPlanRunId) { - this.testPlanRunId = testPlanRunId; - } - - public void startTest(String accessToken) { - try { - TestPlanResultModel testPlanResultModel = (TestPlanResultModel) this - .getTestPlanActionController() - .runTestPlan(accessToken, new ModelMap(), - createTestPlanWithMonitor(accessToken)).getData(); - - this.setTestPlanRunId(testPlanResultModel.getTestPlanId() - .toString()); - } catch (Exception e) { - Logger.getLogger(TestPlanHelper.class).info( - ExceptionLog.getStackTrace(e)); - } - } - - public TestPlanRequestModel createTestPlanWithMonitor(String accessToken) - throws JAXBException, IOException, CustomGenericException { - List ipList = new ArrayList<>(); - ipList.add(MONITOR_IP); - TestPlanRequestModel testPlanRequestModel = new TestPlanRequestModel(); - testPlanRequestModel.setIpList(ipList); - testPlanRequestModel.setTestPlanName("forTest"); - testPlanRequestModel - .setScriptList(generateWebScriptModels(accessToken)); - return testPlanRequestModel; - } - - private List generateWebScriptModels(String accessToken) - throws JAXBException, IOException, CustomGenericException { - List scriptList = new ArrayList(); - WebScriptModel webScriptModel = new WebScriptModel(); - webScriptModel.setCooldown(1); - webScriptModel.setExecuteRange(50); - webScriptModel.setId(this.getScriptHelper() - .upLoadScriptAndGetId(accessToken).getId()); - webScriptModel.setLoad(30); - webScriptModel.setWarmup(1); - scriptList.add(webScriptModel); - return scriptList; - - } - - public void cleanUpTest(String accessToken) throws CustomGenericException { - /*this.getScriptHelper().deleteScript(accessToken);*/ - } - - public WebTestPlanResultModel queryTestPlanResultModel( - String testPlanRunId, String accessToken) - throws CustomGenericException, JAXBException { - WebTestPlanResultModel webTestPlanResultModel = (WebTestPlanResultModel) this - .getTestPlanActionController() - .queryTestPlan(accessToken, testPlanRunId).getData(); - return webTestPlanResultModel; - } -} diff --git a/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/Test_CommunicateWithMaster.java b/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/Test_CommunicateWithMaster.java deleted file mode 100644 index 69011723..00000000 --- a/Bench4Q-Web/src/test/java/org/bench4q/web/tool/test/Test_CommunicateWithMaster.java +++ /dev/null @@ -1,49 +0,0 @@ -package org.bench4q.web.tool.test; - - -import java.io.File; -import java.util.ArrayList; -import java.util.List; - -import org.bench4q.share.helper.TestHelper; -import org.bench4q.web.service.CommunicateWithMaster; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; -@RunWith(SpringJUnit4ClassRunner.class) -@ContextConfiguration(locations = { "file:src/test/resources/bench4qweb-servlet.xml" }) -public class Test_CommunicateWithMaster { - private CommunicateWithMaster communicateWithMaster; - private LoginHelper loginHelper; - - public CommunicateWithMaster getCommunicateWithMaster() { - return communicateWithMaster; - } - - @Autowired - public void setCommunicateWithMaster( - CommunicateWithMaster communicateWithMaster) { - this.communicateWithMaster = communicateWithMaster; - } - - public LoginHelper getLoginHelper() { - return loginHelper; - } - - @Autowired - public void setLoginHelper(LoginHelper loginHelper) { - this.loginHelper = loginHelper; - } - - @Test - public void test_uploadScriptWithParamFiles() { - List paramFiles = new ArrayList(); - String filePath = "ScriptParameters" - + System.getProperty("file.separator") + "param1.txt"; - TestHelper.createFileIfNotExist(new File(filePath)); - paramFiles.add(new File(filePath)); - - } -}