How to use processRequest method of org.cerberus.servlet.zzpublic.AddToExecutionQueueV002 class

Best Cerberus-source code snippet using org.cerberus.servlet.zzpublic.AddToExecutionQueueV002.processRequest

Source:AddToExecutionQueueV002.java Github

copy

Full Screen

...137 * @param response138 * @throws ServletException139 * @throws IOException140 */141 private void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {142 PrintWriter out = response.getWriter();143 final String charset = request.getCharacterEncoding();144 Date requestDate = new Date();145 // Loading Services.146 ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());147 inQueueService = appContext.getBean(ITestCaseExecutionQueueService.class);148 inQueueFactoryService = appContext.getBean(IFactoryTestCaseExecutionQueue.class);149 executionThreadService = appContext.getBean(IExecutionThreadPoolService.class);150 testCaseService = appContext.getBean(ITestCaseService.class);151 invariantService = appContext.getBean(IInvariantService.class);152 applicationService = appContext.getBean(IApplicationService.class);153 testCaseCountryService = appContext.getBean(ITestCaseCountryService.class);154 campaignParameterService = appContext.getBean(ICampaignParameterService.class);155 countryEnvParamService = appContext.getBean(ICountryEnvParamService.class);156 // Calling Servlet Transversal Util.157 ServletUtil.servletStart(request);158 // Default message to unexpected error.159 MessageEvent msg = new MessageEvent(MessageEventEnum.DATA_OPERATION_ERROR_UNEXPECTED);160 msg.setDescription(msg.getDescription().replace("%DESCRIPTION%", ""));161 AnswerItem<List<TestCase>> testcases = null;162 /**163 * Adding Log entry.164 */165 ILogEventService logEventService = appContext.getBean(ILogEventService.class);166 logEventService.createForPublicCalls("/AddToExecutionQueueV002", "CALL", "AddToExecutionQueueV002 called : " + request.getRequestURL(), request);167 // Parsing all parameters.168 // Execution scope parameters : Campaign, TestCases, Countries, Environment, Browser.169 String campaign = ParameterParserUtil.parseStringParamAndDecodeAndSanitize(request.getParameter(PARAMETER_CAMPAIGN), null, charset);170 List<String> selectTest;171 selectTest = ParameterParserUtil.parseListParamAndDecode(request.getParameterValues(PARAMETER_TEST), null, charset);172 List<String> selectTestCase;173 selectTestCase = ParameterParserUtil.parseListParamAndDecode(request.getParameterValues(PARAMETER_TESTCASE), null, charset);174 List<String> countries;175 countries = ParameterParserUtil.parseListParamAndDecode(request.getParameterValues(PARAMETER_COUNTRY), null, charset);176 List<String> environments;177 environments = ParameterParserUtil.parseListParamAndDecodeAndDeleteEmptyValue(request.getParameterValues(PARAMETER_ENVIRONMENT), null, charset);178 List<String> browsers = new ArrayList<>();;179 browsers = ParameterParserUtil.parseListParamAndDecode(request.getParameterValues(PARAMETER_BROWSER), browsers, charset);180 // Execution parameters.181 String tag = ParameterParserUtil.parseStringParam(request.getParameter(PARAMETER_TAG), "");182 String robot = ParameterParserUtil.parseStringParamAndDecodeAndSanitize(request.getParameter(PARAMETER_ROBOT), null, charset);183 String robotIP = ParameterParserUtil.parseStringParamAndDecodeAndSanitize(request.getParameter(PARAMETER_ROBOT_IP), null, charset);184 String robotPort = ParameterParserUtil.parseStringParamAndDecodeAndSanitize(request.getParameter(PARAMETER_ROBOT_PORT), null, charset);185 String browserVersion = ParameterParserUtil.parseStringParamAndDecodeAndSanitize(request.getParameter(PARAMETER_BROWSER_VERSION), null, charset);186 String platform = ParameterParserUtil.parseStringParamAndDecodeAndSanitize(request.getParameter(PARAMETER_PLATFORM), null, charset);187 String screenSize = ParameterParserUtil.parseStringParamAndDecodeAndSanitize(request.getParameter(PARAMETER_SCREENSIZE), null, charset);188 int manualURL = ParameterParserUtil.parseIntegerParamAndDecode(request.getParameter(PARAMETER_MANUAL_URL), DEFAULT_VALUE_MANUAL_URL, charset);189 String manualHost = ParameterParserUtil.parseStringParamAndDecodeAndSanitize(request.getParameter(PARAMETER_MANUAL_HOST), null, charset);190 String manualContextRoot = ParameterParserUtil.parseStringParamAndDecodeAndSanitize(request.getParameter(PARAMETER_MANUAL_CONTEXT_ROOT), null, charset);191 String manualLoginRelativeURL = ParameterParserUtil.parseStringParamAndDecodeAndSanitize(request.getParameter(PARAMETER_MANUAL_LOGIN_RELATIVE_URL), null, charset);192 String manualEnvData = ParameterParserUtil.parseStringParamAndDecodeAndSanitize(request.getParameter(PARAMETER_MANUAL_ENV_DATA), null, charset);193 int screenshot = ParameterParserUtil.parseIntegerParamAndDecode(request.getParameter(PARAMETER_SCREENSHOT), DEFAULT_VALUE_SCREENSHOT, charset);194 int verbose = ParameterParserUtil.parseIntegerParamAndDecode(request.getParameter(PARAMETER_VERBOSE), DEFAULT_VALUE_VERBOSE, charset);195 String timeout = request.getParameter(PARAMETER_TIMEOUT);196 int pageSource = ParameterParserUtil.parseIntegerParamAndDecode(request.getParameter(PARAMETER_PAGE_SOURCE), DEFAULT_VALUE_PAGE_SOURCE, charset);197 int seleniumLog = ParameterParserUtil.parseIntegerParamAndDecode(request.getParameter(PARAMETER_SELENIUM_LOG), DEFAULT_VALUE_SELENIUM_LOG, charset);198 int retries = ParameterParserUtil.parseIntegerParamAndDecode(request.getParameter(PARAMETER_RETRIES), DEFAULT_VALUE_RETRIES, charset);199 String manualExecution = ParameterParserUtil.parseStringParamAndDecode(request.getParameter(PARAMETER_MANUAL_EXECUTION), DEFAULT_VALUE_MANUAL_EXECUTION, charset);200 int priority = ParameterParserUtil.parseIntegerParamAndDecode(request.getParameter(PARAMETER_EXEPRIORITY), DEFAULT_VALUE_PRIORITY, charset);201 if (manualExecution.equals("")) {202 manualExecution = DEFAULT_VALUE_MANUAL_EXECUTION;203 }204 String outputFormat = ParameterParserUtil.parseStringParamAndDecode(request.getParameter(PARAMETER_OUTPUTFORMAT), DEFAULT_VALUE_OUTPUTFORMAT, charset);205 // Defining help message.206 String helpMessage = "This servlet is used to add to Cerberus execution queue a list of execution. Execution list will be calculated from cartesian product of "207 + "testcase, country, environment and browser list. Those list can be defined from the associated servlet parameter but can also be defined from campaign directy inside Cerberus.\n"208 + "List defined from servlet overwrite the list defined from the campaign. All other execution parameters will be taken to each execution.\n"209 + "Available parameters:\n"210 + "- " + PARAMETER_CAMPAIGN + " : Campaign name from which testcase, countries, environment and browser can be defined from Cerberus. [" + campaign + "]\n"211 + "- " + PARAMETER_TEST + " : List of test to trigger. That list overwrite the list coming from the Campaign (if defined).. [" + selectTest + "]\n"212 + "- " + PARAMETER_TESTCASE + " : List of testCase to trigger. That list overwrite the list coming from the Campaign (if defined).. [" + selectTestCase + "]\n"213 + "- " + PARAMETER_COUNTRY + " : List of countries to trigger. That list overwrite the list coming from the Campaign (if defined).. [" + countries + "]\n"214 + "- " + PARAMETER_ENVIRONMENT + " : List of environment to trigger. That list overwrite the list coming from the Campaign (if defined).. [" + environments + "]\n"215 + "- " + PARAMETER_BROWSER + " : List of browser to trigger. That list overwrite the list coming from the Campaign (if defined).. [" + browsers + "]\n"216 + "- " + PARAMETER_ROBOT + " : Robot Name that will be used for every execution triggered. [" + robot + "]\n"217 + "- " + PARAMETER_ROBOT_IP + " : Robot IP that will be used for every execution triggered. [" + robotIP + "]\n"218 + "- " + PARAMETER_ROBOT_PORT + " : Robot Port that will be used for every execution triggered. [" + robotPort + "]\n"219 + "- " + PARAMETER_BROWSER_VERSION + " : Browser Version that will be used for every execution triggered. [" + browserVersion + "]\n"220 + "- " + PARAMETER_PLATFORM + " : Platform that will be used for every execution triggered. [" + platform + "]\n"221 + "- " + PARAMETER_SCREENSIZE + " : Size of the screen that will be used for every execution triggered. [" + screenSize + "]\n"222 + "- " + PARAMETER_MANUAL_URL + " : Activate (1) or not (0) the Manual URL of the application to execute. If activated the 4 parameters after are necessary. [" + manualURL + "]\n"223 + "- " + PARAMETER_MANUAL_HOST + " : Host of the application to test (only used when " + PARAMETER_MANUAL_URL + " is activated). [" + manualHost + "]\n"224 + "- " + PARAMETER_MANUAL_CONTEXT_ROOT + " : Context root of the application to test (only used when " + PARAMETER_MANUAL_URL + " is activated). [" + manualContextRoot + "]\n"225 + "- " + PARAMETER_MANUAL_LOGIN_RELATIVE_URL + " : Relative login URL of the application (only used when " + PARAMETER_MANUAL_URL + " is activated). [" + manualLoginRelativeURL + "]\n"226 + "- " + PARAMETER_MANUAL_ENV_DATA + " : Environment where to get the test data when a " + PARAMETER_MANUAL_URL + " is defined. (only used when manualURL is active). [" + manualEnvData + "]\n"227 + "- " + PARAMETER_TAG + " : Tag that will be used for every execution triggered. [" + tag + "]\n"228 + "- " + PARAMETER_SCREENSHOT + " : Activate or not the screenshots for every execution triggered. [" + screenshot + "]\n"229 + "- " + PARAMETER_VERBOSE + " : Verbose level for every execution triggered. [" + verbose + "]\n"230 + "- " + PARAMETER_TIMEOUT + " : Timeout used for the action that will be used for every execution triggered. [" + timeout + "]\n"231 + "- " + PARAMETER_PAGE_SOURCE + " : Record Page Source during for every execution triggered. [" + pageSource + "]\n"232 + "- " + PARAMETER_SELENIUM_LOG + " : Get the SeleniumLog at the end of the execution for every execution triggered. [" + seleniumLog + "]\n"233 + "- " + PARAMETER_MANUAL_EXECUTION + " : Execute testcase in manual mode for every execution triggered. [" + manualExecution + "]\n"234 + "- " + PARAMETER_RETRIES + " : Number of tries if the result is not OK for every execution triggered. [" + retries + "]\n"235 + "- " + PARAMETER_EXEPRIORITY + " : Priority that will be used in the queue for every execution triggered. [" + priority + "]\n"236 + "- " + PARAMETER_OUTPUTFORMAT + " : Format of the servlet output. can be compact, json [" + outputFormat + "]\n";237// try {238 // Checking the parameter validity.239 StringBuilder errorMessage = new StringBuilder();240 boolean error = false;241 if (tag == null || tag.isEmpty()) {242 if (request.getRemoteUser() != null) {243 tag = request.getRemoteUser();244 }245 if (tag.length() > 0) {246 tag += ".";247 }248 if (campaign != null) {249 tag += campaign;250 }251 if (tag.length() > 0) {252 tag += ".";253 }254 Timestamp timestamp = new Timestamp(System.currentTimeMillis());255 String mytimestamp = sdf.format(timestamp);256 tag += mytimestamp;257 } else if (tag.length() > 255) {258 errorMessage.append("Error - Parameter ").append(PARAMETER_TAG).append(" is too big. Maximum size if 255. Current size is : ").append(tag.length()).append("\n");259 error = true;260 }261 if (campaign != null && !campaign.isEmpty()) {262 final AnswerItem<Map<String, List<String>>> parsedCampaignParameters = campaignParameterService.parseParametersByCampaign(campaign);263 if (parsedCampaignParameters.isCodeEquals(MessageEventEnum.DATA_OPERATION_OK.getCode())) {264 // Parameters from campaign could be retreived. we can now replace the parameters comming from the calls in case they are still not defined.265 // If parameters are already defined from request, we ignore the campaign values.266 if (countries == null || countries.isEmpty()) {267 countries = parsedCampaignParameters.getItem().get(CampaignParameter.COUNTRY_PARAMETER);268 }269 if (environments == null || environments.isEmpty()) {270 environments = parsedCampaignParameters.getItem().get(CampaignParameter.ENVIRONMENT_PARAMETER);271 }272 if (browsers == null || browsers.isEmpty()) {273 browsers = parsedCampaignParameters.getItem().get(CampaignParameter.BROWSER_PARAMETER);274 }275 }276 if ((countries != null) && (selectTest == null || selectTest.isEmpty())) {277 // If no countries are found, there is no need to get the testcase list. None will be returned.278 selectTest = new ArrayList<>();279 selectTestCase = new ArrayList<>();280 testcases = testCaseService.findTestCaseByCampaignNameAndCountries(campaign, countries.toArray(new String[countries.size()]));281 for (TestCase campaignTestCase : testcases.getItem()) {282 selectTest.add(campaignTestCase.getTest());283 selectTestCase.add(campaignTestCase.getTestCase());284 }285 }286 }287 if (countries == null || countries.isEmpty()) {288 errorMessage.append("Error - No Country defined. You can either feed it with parameter '" + PARAMETER_COUNTRY + "' or add it into the campaign definition.\n");289 error = true;290 }291 if ((StringUtil.isNullOrEmpty(robot)) && (browsers == null || browsers.isEmpty())) {292 errorMessage.append("Error - No Browser defined. You can either feed it with parameter '" + PARAMETER_BROWSER + "' or add it into the campaign definition.\n");293 error = true;294 }295 if (selectTest == null || selectTest.isEmpty() || selectTestCase == null || selectTestCase.isEmpty()) {296 errorMessage.append("Error - No TestCases defined. You can either feed it with parameters '" + PARAMETER_TEST + "' and '" + PARAMETER_TESTCASE + "' or add it into the campaign definition.\n");297 error = true;298 }299 if ((selectTest != null) && (selectTestCase != null) && (selectTest.size() != selectTestCase.size())) {300 errorMessage.append("Error - Test list size (").append(selectTest.size()).append(") is not the same as testcase list size (").append(selectTestCase.size()).append("). Please check that both list are consistent.\n");301 error = true;302 }303 if (manualURL >= 1) {304 if (manualHost == null || manualEnvData == null) {305 errorMessage.append("Error - ManualURL has been activated but no ManualHost or Manual Environment defined.\n");306 error = true;307 }308 } else if (environments == null || environments.isEmpty()) {309 errorMessage.append("Error - No Environment defined (and " + PARAMETER_MANUAL_URL + " not activated). You can either feed it with parameter '" + PARAMETER_ENVIRONMENT + "' or add it into the campaign definition.\n");310 error = true;311 }312 int nbExe = 0;313 JSONArray jsonArray = new JSONArray();314 String user = request.getRemoteUser() == null ? "" : request.getRemoteUser();315 int nbtestcasenotactive = 0;316 int nbtestcaseenvgroupnotallowed = 0;317 int nbenvnotexist = 0;318 boolean tagAlreadyAdded = false;319 int nbbrowser = 0;320 if (browsers.isEmpty()) {321 nbbrowser = 1;322 } else {323 nbbrowser = browsers.size();324 }325 int nbtescase = selectTest.size();326 int nbenv = environments.size();327 int nbcountries = countries.size();328 // Starting the request only if previous parameters exist.329 if (!error) {330 // Part 1: Getting all possible Execution from test cases + countries + environments + browsers which have been sent to this servlet.331 Map<String, String> invariantEnv = invariantService.readToHashMapGp1StringByIdname("ENVIRONMENT", "");332 List<TestCaseExecutionQueue> toInserts = new ArrayList<TestCaseExecutionQueue>();333 try {334 HashMap<String, CountryEnvParam> envMap = new HashMap<>();335 LOG.debug("Loading all environments.");336 for (CountryEnvParam envParam : countryEnvParamService.convert(countryEnvParamService.readActiveBySystem(null))) {337 envMap.put(envParam.getSystem() + LOCAL_SEPARATOR + envParam.getCountry() + LOCAL_SEPARATOR + envParam.getEnvironment(), envParam);338 }339 LOG.debug("Nb of TestCase : " + selectTest.size());340 for (int i = 0; i < selectTest.size(); i++) {341// for (String localTest : selectTest) {342 String test = selectTest.get(i);343 String testCase = selectTestCase.get(i);344 TestCase tc = testCaseService.convert(testCaseService.readByKey(test, testCase));345 // TestCases that are not active are not inserted into queue.346 if (tc.getTcActive().equals("Y")) {347 // We only insert testcase that exist for the given country.348 for (TestCaseCountry country : testCaseCountryService.convert(testCaseCountryService.readByTestTestCase(null, test, testCase))) {349 if (countries.contains(country.getCountry())) {350 // for each environment we test that correspondng gp1 is compatible with testcase environment flag activation.351 for (String environment : environments) {352 String envGp1 = invariantEnv.get(environment);353 if (((envGp1.equals("PROD")) && (tc.getActivePROD().equalsIgnoreCase("Y")))354 || ((envGp1.equals("UAT")) && (tc.getActiveUAT().equalsIgnoreCase("Y")))355 || ((envGp1.equals("QA")) && (tc.getActiveQA().equalsIgnoreCase("Y")))356 || (envGp1.equals("DEV"))) {357 // Getting Application in order to check application type against browser.358 Application app = applicationService.convert(applicationService.readByKey(tc.getApplication()));359 if (envMap.containsKey(app.getSystem() + LOCAL_SEPARATOR + country.getCountry() + LOCAL_SEPARATOR + environment)) {360 // Create Tag only if not already done and defined.361 if (!StringUtil.isNullOrEmpty(tag) && !tagAlreadyAdded) {362 // We create or update it.363 ITagService tagService = appContext.getBean(ITagService.class);364 tagService.createAuto(tag, campaign, user);365 tagAlreadyAdded = true;366 }367 if ((app != null) && (app.getType() != null) && app.getType().equalsIgnoreCase(Application.TYPE_GUI)) {368 if (browsers == null || browsers.isEmpty()) {369 browsers.add("");370 }371 for (String browser : browsers) {372 try {373 LOG.debug("Insert Queue Entry.");374 toInserts.add(inQueueFactoryService.create(test, testCase, country.getCountry(), environment, robot, robotIP, robotPort, browser, browserVersion,375 platform, screenSize, manualURL, manualHost, manualContextRoot, manualLoginRelativeURL, manualEnvData, tag, screenshot, verbose,376 timeout, pageSource, seleniumLog, 0, retries, manualExecution, priority, user, null, null, null));377 } catch (FactoryCreationException e) {378 LOG.error("Unable to insert record due to: " + e, e);379 LOG.error("test: " + test + "-" + testCase + "-" + country.getCountry() + "-" + environment + "-" + robot);380 }381 }382 } else {383 // Application does not support browser so we force an empty value.384 LOG.debug("Forcing Browser to empty value. Application type=" + app.getType());385 try {386 LOG.debug("Insert Queue Entry.");387 toInserts.add(inQueueFactoryService.create(test, testCase, country.getCountry(), environment, robot, robotIP, robotPort, "", browserVersion,388 platform, screenSize, manualURL, manualHost, manualContextRoot, manualLoginRelativeURL, manualEnvData, tag, screenshot, verbose,389 timeout, pageSource, seleniumLog, 0, retries, manualExecution, priority, user, null, null, null));390 } catch (FactoryCreationException e) {391 LOG.error("Unable to insert record due to: " + e, e);392 LOG.error("test: " + test + "-" + testCase + "-" + country.getCountry() + "-" + environment + "-" + robot);393 }394 }395 } else {396 LOG.debug("Env does not exist or is not active.");397 nbenvnotexist = nbenvnotexist + nbbrowser;398 }399 } else {400 LOG.debug("Env group not active for testcase : " + environment);401 nbtestcaseenvgroupnotallowed = nbtestcaseenvgroupnotallowed + nbbrowser;402 }403 }404 } else {405 LOG.debug("Country does not match. " + countries + " " + country.getCountry());406 }407 }408 } else {409 LOG.debug("TestCase not Active.");410 nbtestcasenotactive = nbtestcasenotactive + (nbcountries * nbenv * nbbrowser);411 }412 }413 } catch (CerberusException ex) {414 LOG.warn(ex);415 }416 // Part 2: Try to insert all these test cases to the execution queue.417 List<String> errorMessages = new ArrayList<String>();418 for (TestCaseExecutionQueue toInsert : toInserts) {419 try {420 inQueueService.convert(inQueueService.create(toInsert));421 nbExe++;422 JSONObject value = new JSONObject();423 value.put("queueId", toInsert.getId());424 value.put("test", toInsert.getTest());425 value.put("testcase", toInsert.getTestCase());426 value.put("country", toInsert.getCountry());427 value.put("environment", toInsert.getEnvironment());428 jsonArray.put(value);429 } catch (CerberusException e) {430 String errorMessageTmp = "Unable to insert " + toInsert.toString() + " due to " + e.getMessage();431 LOG.warn(errorMessageTmp);432 errorMessages.add(errorMessageTmp);433 continue;434 } catch (JSONException ex) {435 LOG.error(ex);436 }437 }438 // Part 3 : Trigger JobQueue439 try {440 executionThreadService.executeNextInQueueAsynchroneously(false);441 } catch (CerberusException ex) {442 String errorMessageTmp = "Unable to feed the execution queue due to " + ex.getMessage();443 LOG.warn(errorMessageTmp);444 errorMessages.add(errorMessageTmp);445 }446 if (!errorMessages.isEmpty()) {447 StringBuilder errorMessageTmp = new StringBuilder();448 for (String item : errorMessages) {449 errorMessageTmp.append(item);450 errorMessageTmp.append(LINE_SEPARATOR);451 }452 errorMessage.append(errorMessageTmp.toString());453 }454 errorMessage.append(nbExe);455 errorMessage.append(" execution(s) succesfully inserted to queue. ");456 if (testcases != null && testcases.getResultMessage().getSource() == MessageEventEnum.DATA_OPERATION_WARNING_PARTIAL_RESULT) {457 errorMessage.append(testcases.getResultMessage().getDescription());458 }459 // Message that everything went fine.460 msg = new MessageEvent(MessageEventEnum.GENERIC_OK);461 } else {462 // In case of errors, we display the help message.463// errorMessage.append(helpMessage);464 }465 // Init Answer with potencial error from Parsing parameter.466 AnswerItem answer = new AnswerItem(msg);467 switch (outputFormat) {468 case "json":469 try {470 JSONObject jsonResponse = new JSONObject();471 jsonResponse.put("messageType", answer.getResultMessage().getMessage().getCodeString());472 jsonResponse.put("message", errorMessage.toString());473 jsonResponse.put("helpMessage", helpMessage);474 jsonResponse.put("tag", tag);475 jsonResponse.put("nbExe", nbExe);476 jsonResponse.put("nbErrorTCNotActive", nbtestcasenotactive);477 jsonResponse.put("nbErrorTCNotAllowedOnEnv", nbtestcaseenvgroupnotallowed);478 jsonResponse.put("nbErrorEnvNotExistOrNotActive", nbenvnotexist);479 jsonResponse.put("queueList", jsonArray);480 response.setContentType("application/json");481 response.setCharacterEncoding("utf8");482 response.getWriter().print(jsonResponse.toString());483 } catch (JSONException e) {484 LOG.warn(e);485 //returns a default error message with the json format that is able to be parsed by the client-side486 response.setContentType("application/json");487 response.setCharacterEncoding("utf8");488 response.getWriter().print(AnswerUtil.createGenericErrorAnswer());489 }490 break;491 default:492 response.setContentType("text");493 response.setCharacterEncoding("utf8");494 if (error) {495 errorMessage.append("\n");496 errorMessage.append(helpMessage);497 }498 response.getWriter().print(errorMessage.toString());499 }500// } catch (Exception e) {501// LOG.error(e);502// out.println(helpMessage);503// out.println(e.toString());504// }505 }506 // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">507 /**508 * Handles the HTTP <code>GET</code> method.509 *510 * @param request servlet request511 * @param response servlet response512 * @throws ServletException if a servlet-specific error occurs513 * @throws IOException if an I/O error occurs514 */515 @Override516 protected void doGet(HttpServletRequest request, HttpServletResponse response)517 throws ServletException, IOException {518 processRequest(request, response);519 }520 /**521 * Handles the HTTP <code>POST</code> method.522 *523 * @param request servlet request524 * @param response servlet response525 * @throws ServletException if a servlet-specific error occurs526 * @throws IOException if an I/O error occurs527 */528 @Override529 protected void doPost(HttpServletRequest request, HttpServletResponse response)530 throws ServletException, IOException {531 processRequest(request, response);532 }533 /**534 * Returns a short description of the servlet.535 *536 * @return a String containing servlet description537 */538 @Override539 public String getServletInfo() {540 return "Short description";541 }// </editor-fold>542}...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Cerberus-source automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Most used method in AddToExecutionQueueV002

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful