How to use getId method of org.cerberus.engine.queuemanagement.entity.TestCaseExecutionQueueToTreat class

Best Cerberus-source code snippet using org.cerberus.engine.queuemanagement.entity.TestCaseExecutionQueueToTreat.getId

Source:ExecutionThreadPoolService.java Github

copy

Full Screen

...285 List<RobotExecutor> tmpExelist = new ArrayList<>();286 List<RobotExecutor> newTmpExelist = new ArrayList<>();287 // Analysing each execution in the database queue.288 for (TestCaseExecutionQueueToTreat exe : executionsInQueue) {289 LOG.debug("Starting analysing : " + exe.getId());290 String notTriggeredExeMessage = "";291 boolean triggerExe = false;292 robot = exe.getQueueRobot();293 // Getting here the list of possible executor sorted by prio.294 List<RobotExecutor> exelist = new ArrayList<>();295 appType = exe.getAppType();296 if ((appType.equals(Application.TYPE_APK)) || (appType.equals(Application.TYPE_GUI)) || (appType.equals(Application.TYPE_FAT)) || (appType.equals(Application.TYPE_IPA))) {297 // Application require a robot so we can get the list of executors.298 if (StringUtil.isNullOrEmpty(robot)) {299 exelist = new ArrayList<>();300 exelist.add(factoryRobotExecutor.create(0, "", "", "Y", 1, exe.getQueueRobotHost(), exe.getQueueRobotPort(), "", "", "", "", null, "", 0, "", 0, "", "", "", null, "", null));301 } else {302 exelist = robot_executor.get(robot);303 if (exelist == null || exelist.size() < 1) {304 exelist = new ArrayList<>();305 exelist.add(factoryRobotExecutor.create(0, "", "", "Y", 1, "", "", "", "", "", "", null, "", 0, "", 0, "", "", "", null, "", null));306 }307 }308 } else {309 // Application does not require a robot so we create a fake one with empty data.310 exelist = new ArrayList<>();311 exelist.add(factoryRobotExecutor.create(0, "", "", "Y", 1, "", "", "", "", "", "", null, "", 0, "", 0, "", "", "", null, "", null));312 }313 // Looping other every potential executor on the corresponding robot.314 for (RobotExecutor robotExecutor1 : exelist) {315 robotHost = robotExecutor1.getHost();316 robotPort = robotExecutor1.getPort();317 robotExecutor = robotExecutor1.getExecutor();318 LOG.debug("Trying with : " + robotHost + " Port : " + robotPort + " From Robot/Executor : " + robotExecutor1.getRobot() + "/" + robotExecutor1.getExecutor());319 // RobotHost PoolSize if retreived from invariant hashmap.320 int robothost_poolsize_final = 0;321 if (!StringUtil.isNullOrEmpty(robotHost)) {322 if (robothost_poolsize.containsKey(robotHost)) {323 robothost_poolsize_final = ParameterParserUtil.parseIntegerParam(robothost_poolsize.get(robotHost), poolSizeRobot);324 } else {325 robothost_poolsize_final = poolSizeRobot;326 }327 }328 LOG.debug("Pool Values : poolGen " + poolSizeGeneral + " poolApp " + exe.getPoolSizeAppEnvironment() + " poolRobotHost " + robothost_poolsize_final);329 String const01_key = TestCaseExecutionQueueToTreat.CONSTRAIN1_GLOBAL;330 String const02_key = TestCaseExecutionQueueToTreat.CONSTRAIN2_APPLIENV + CONST_SEPARATOR + exe.getSystem() + CONST_SEPARATOR + exe.getEnvironment() + CONST_SEPARATOR + exe.getCountry() + CONST_SEPARATOR + exe.getApplication();331 String const03_key = TestCaseExecutionQueueToTreat.CONSTRAIN3_APPLICATION + CONST_SEPARATOR + exe.getApplication();332 String const04_key = TestCaseExecutionQueueToTreat.CONSTRAIN4_ROBOT + CONST_SEPARATOR + robotHost;333 // Eval Constrain 1334 if (constrains_current.containsKey(const01_key)) {335 const01_current = constrains_current.get(const01_key);336 } else {337 const01_current = 0;338 }339 // Eval Constrain 1340 boolean constMatch01;341 if (poolSizeGeneral == 0) {342 // if poolsize == 0, this means no constrain specified.343 constMatch01 = false;344 } else {345 constMatch01 = (const01_current >= poolSizeGeneral);346 }347 // Eval Constrain 2348 if (constrains_current.containsKey(const02_key)) {349 const02_current = constrains_current.get(const02_key);350 } else {351 const02_current = 0;352 }353 // Eval Constrain 2354 boolean constMatch02;355 if (exe.getPoolSizeAppEnvironment() == 0) {356 // if poolsize == 0, this means no constrain specified.357 constMatch02 = false;358 } else {359 constMatch02 = (const02_current >= exe.getPoolSizeAppEnvironment());360 }361 // Eval Constrain 3362 if (constrains_current.containsKey(const03_key)) {363 const03_current = constrains_current.get(const03_key);364 } else {365 const03_current = 0;366 }367 // Eval Constrain 3368 boolean constMatch03;369 if (exe.getPoolSizeApplication() == 0) {370 // if poolsize == 0, this means no constrain specified.371 constMatch03 = false;372 } else {373 constMatch03 = (const03_current >= exe.getPoolSizeApplication());374 }375 // Eval Constrain 4376 if (constrains_current.containsKey(const04_key)) {377 const04_current = constrains_current.get(const04_key);378 } else {379 const04_current = 0;380 }381 // Eval Constrain 4382 boolean constMatch04;383 if (robothost_poolsize_final == 0) {384 // if poolsize == 0, this means no constrain specified.385 constMatch04 = false;386 } else {387 constMatch04 = (const04_current >= robothost_poolsize_final);388 }389 if ((!constMatch01 && !constMatch02 && !constMatch03 && !constMatch04)390 || (!constMatch01 && exe.getManualExecution().equals("Y"))) {391 // None of the constrains match or exe is manual so we can trigger the execution.392 // Execution could already been triggered on a different executor.393 if (triggerExe == false) {394 // Adding execution to queue.395 if (queueService.updateToWaiting(exe.getId())) {396 try {397 ExecutionQueueWorkerThread task = new ExecutionQueueWorkerThread();398 // Flag on database that execution has been selected.399 robotExecutorService.updateLastExe(robot, robotExecutor);400 // Update robot_executor HasMap for next queued executions in the current batch. If Algo is based on Ranking, nothing needs to be changed.401 if ((robot_header.get(robot) != null)402 && (Robot.LOADBALANCINGEXECUTORMETHOD_ROUNDROBIN.equals(robot_header.get(robot).getLbexemethod()))403 && (exelist.size() > 1)) {404 tmpExelist = robot_executor.get(robot);405 newTmpExelist = new ArrayList<>();406 RobotExecutor lastRobotExecutor = null;407 for (RobotExecutor robotExecutor2 : tmpExelist) {408 // Update new List with RobotExecutor.LOADBALANCINGMETHOD_ROUNDROBIN Algo puting the Executor that has just been inserted at the end.409 if (robotExecutor2.getExecutor().equals(robotExecutor)) {410 lastRobotExecutor = robotExecutor2;411 } else {412 newTmpExelist.add(robotExecutor2);413 }414 }415 newTmpExelist.add(lastRobotExecutor);416 robot_executor.put(robot, newTmpExelist);417 }418 task.setCerberusExecutionUrl(parameterService.getParameterStringByKey("cerberus_url", exe.getSystem(), ""));419 task.setQueueId(exe.getId());420 task.setRobotExecutor(robotExecutor);421 task.setSelectedRobotHost(robotHost);422 task.setToExecuteTimeout(queueTimeout);423 task.setQueueService(queueService);424 task.setQueueDepService(queueDepService);425 task.setRetriesService(retriesService);426 task.setExecThreadPool(threadQueuePool);427 Future<?> future = threadQueuePool.getExecutor().submit(task);428 task.setFuture(future);429 triggerExe = true;430 nbqueuedexe++;431 // Debug messages.432 LOG.debug("RESULT : Execution triggered. Const1 " + constMatch01 + " Const2 " + constMatch02 + " Const3 " + constMatch03 + " Const4 " + constMatch04 + " Manual " + exe.getManualExecution());433 LOG.debug(" CurConst1 " + const01_current + " CurConst2 " + const02_current + " CurConst3 " + const03_current + " CurConst4 " + const04_current);434 // Constrains Counter increase435 constrains_current.put(const01_key, const01_current + 1);436 if (!exe.getManualExecution().equals("Y")) {437 // Specific increment only if automatic execution.438 constrains_current.put(const02_key, const02_current + 1);439 constrains_current.put(const03_key, const03_current + 1);440 constrains_current.put(const04_key, const04_current + 1);441 }442 } catch (Exception e) {443 LOG.error("Failed to add Queueid : " + exe.getId() + " into the queue : " + e.getMessage(), e);444 }445 }446 } else {447 LOG.debug("RESULT : Execution Not triggered. Queueid : " + exe.getId() + " already inserted (on a previous Executor).");448 }449 } else {450 if (constMatch04) {451 notTriggeredExeMessage += "Robot Host contrain on '" + const04_key + "' reached. " + robothost_poolsize_final + " Execution(s) already in pool. ";452 }453 if (constMatch03) {454 notTriggeredExeMessage += "Application contrain on '" + const03_key + "' reached . " + exe.getPoolSizeApplication() + " Execution(s) already in pool. ";455 }456 if (constMatch02) {457 notTriggeredExeMessage += "Application Environment contrain on '" + const02_key + "' reached . " + exe.getPoolSizeAppEnvironment() + " Execution(s) already in pool. ";458 }459 if (constMatch01) {460 notTriggeredExeMessage += "Global contrain reached. " + poolSizeGeneral + " Execution(s) already in pool. ";461 }462 LOG.debug("RESULT : Execution not triggered. Const1 " + constMatch01 + " Const2 " + constMatch02 + " Const3 " + constMatch03 + " Const4 " + constMatch04 + " Manual " + exe.getManualExecution());463 LOG.debug(" CurConst1 " + const01_current + " CurConst2 " + const02_current + " CurConst3 " + const03_current + " CurConst4 " + const04_current);464 }465 }466// End of Queue entry analysis accross all Executors.467 if ((exe.getDebugFlag() != null) && (exe.getDebugFlag().equalsIgnoreCase("Y"))) {468 if (triggerExe == false) {469 queueService.updateComment(exe.getId(), notTriggeredExeMessage);470 }471 LOG.debug("Debug Message : " + notTriggeredExeMessage);472 }473 }474 LOG.debug("Stopping Queue_Processing_Job - TOTAL Released execution(s) : " + nbqueuedexe);475 } while (nbqueuedexe > 0);476 } else {477 LOG.debug("Queue_Processing_Job not triggered (already running when updating.)");478 }479 // Flag in database that job is finished.480 myVersionService.updateMyVersionString("queueprocessingjobrunning", "N");481 } else {482 LOG.debug("Queue_Processing_Job not triggered (already running.)");483 }...

Full Screen

Full Screen

getId

Using AI Code Generation

copy

Full Screen

1testCaseExecutionQueueToTreat = org.cerberus.engine.queuemanagement.entity.TestCaseExecutionQueueToTreat;2testCaseExecutionQueueToTreat = testCaseExecutionQueueToTreat.readById(getId());3testCaseExecutionId = testCaseExecutionQueueToTreat.getTestCaseExecutionId();4testCaseExecution = org.cerberus.engine.entity.ExecutionUUID;5testCaseExecution = testCaseExecution.readById(testCaseExecutionId);6test = testCaseExecution.getTest();7testCase = testCaseExecution.getTestCase();8country = testCaseExecution.getCountry();9 testCaseExecutionQueueToTreat = org.cerberus.engine.queuemanagement.entity.TestCaseExecutionQueueToTreat;10 testCaseExecutionQueueToTreat = testCaseExecutionQueueToTreat.readById(getId());11 test = testCaseExecutionQueueToTreat.getTest();12 testCase = testCaseExecutionQueueToTreat.getTestCase();13 country = testCaseExecutionQueueToTreat.getCountry();

Full Screen

Full Screen

getId

Using AI Code Generation

copy

Full Screen

1${queueId} = ${queueToTreat.getId()}2${queueId}3${queueId} = ${queueToTreat.getId()}4${queueId}5${queueId} = ${queueToTreat.getId()}6${queueId}7${queueId} = ${queueToTreat.getId()}8${queueId}9${queueId} = ${queueToTreat.getId()}10${queueId}11${queueId} = ${queueToTreat.getId()}12${queueId}

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.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful