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

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

Source:ExecutionThreadPoolService.java Github

copy

Full Screen

...119 String const01_key = TestCaseExecutionQueueToTreat.CONSTRAIN1_GLOBAL;120 String const02_key = TestCaseExecutionQueueToTreat.CONSTRAIN2_APPLIENV + CONST_SEPARATOR + exe.getSystem() + CONST_SEPARATOR + exe.getEnvironment() + CONST_SEPARATOR + exe.getCountry() + CONST_SEPARATOR + exe.getApplication();121 String const03_key = TestCaseExecutionQueueToTreat.CONSTRAIN3_APPLICATION + CONST_SEPARATOR + exe.getApplication();122 String const04_key = TestCaseExecutionQueueToTreat.CONSTRAIN4_ROBOT + CONST_SEPARATOR + exe.getSelectedRobotHost();123 String const05_key = TestCaseExecutionQueueToTreat.CONSTRAIN5_EXECUTOREXTENSION + CONST_SEPARATOR + exe.getSelectedRobotExtensionHost();124 if (constrains_current.containsKey(const01_key)) {125 constrains_current.put(const01_key, constrains_current.get(const01_key) + 1);126 } else {127 constrains_current.put(const01_key, 1);128 }129 if (constrains_current.containsKey(const02_key)) {130 constrains_current.put(const02_key, constrains_current.get(const02_key) + 1);131 } else {132 constrains_current.put(const02_key, 1);133 }134 if (constrains_current.containsKey(const03_key)) {135 constrains_current.put(const03_key, constrains_current.get(const03_key) + 1);136 } else {137 constrains_current.put(const03_key, 1);138 }139 if (constrains_current.containsKey(const04_key)) {140 constrains_current.put(const04_key, constrains_current.get(const04_key) + 1);141 } else {142 constrains_current.put(const04_key, 1);143 }144 if (constrains_current.containsKey(const05_key)) {145 constrains_current.put(const05_key, constrains_current.get(const05_key) + 1);146 } else {147 constrains_current.put(const05_key, 1);148 }149 }150 return constrains_current;151 }152 @Override153 public HashMap<String, Integer> getCurrentlyPoolSizes() throws CerberusException {154 AnswerList<TestCaseExecutionQueueToTreat> answer = new AnswerList<>();155 HashMap<String, Integer> constrains_current = new HashMap<>();156 String const01_key = TestCaseExecutionQueueToTreat.CONSTRAIN1_GLOBAL;157 int poolSizeGeneral = parameterService.getParameterIntegerByKey("cerberus_queueexecution_global_threadpoolsize", "", 12);158 int poolSizeRobot = parameterService.getParameterIntegerByKey("cerberus_queueexecution_defaultrobothost_threadpoolsize", "", 10);159 int poolSizeExecutorExt = parameterService.getParameterIntegerByKey("cerberus_queueexecution_defaultexecutorexthost_threadpoolsize", "", 2);160 constrains_current.put(const01_key, poolSizeGeneral);161 // Getting RobotHost PoolSize162 HashMap<String, Integer> robot_poolsize = new HashMap<String, Integer>();163 robot_poolsize = invariantService.readToHashMapGp1IntegerByIdname("ROBOTHOST", poolSizeRobot);164 HashMap<String, Integer> robotext_poolsize = new HashMap<String, Integer>();165 robotext_poolsize = invariantService.readToHashMapGp1IntegerByIdname("EXECUTOREXTENSIONHOST", poolSizeExecutorExt);166 // Getting all executions to be treated.167 answer = tceiqService.readQueueToTreatOrRunning();168 List<TestCaseExecutionQueueToTreat> executionsToTreat = answer.getDataList();169 // Calculate constrain values.170 for (TestCaseExecutionQueueToTreat exe : executionsToTreat) {171 String const02_key = TestCaseExecutionQueueToTreat.CONSTRAIN2_APPLIENV + CONST_SEPARATOR + exe.getSystem() + CONST_SEPARATOR + exe.getEnvironment() + CONST_SEPARATOR + exe.getCountry() + CONST_SEPARATOR + exe.getApplication();172 String const03_key = TestCaseExecutionQueueToTreat.CONSTRAIN3_APPLICATION + CONST_SEPARATOR + exe.getApplication();173 String const04_key = TestCaseExecutionQueueToTreat.CONSTRAIN4_ROBOT + CONST_SEPARATOR + exe.getSelectedRobotHost();174 String const05_key = TestCaseExecutionQueueToTreat.CONSTRAIN5_EXECUTOREXTENSION + CONST_SEPARATOR + exe.getSelectedRobotExtensionHost();175 constrains_current.put(const02_key, exe.getPoolSizeAppEnvironment());176 constrains_current.put(const03_key, exe.getPoolSizeApplication());177 // Getting Robot Host PoolSize from invariant hashmap.178 int robot_poolsize_final = 0;179 if (!StringUtil.isNullOrEmpty(exe.getSelectedRobotHost())) {180 if (robot_poolsize.containsKey(exe.getSelectedRobotHost())) {181 robot_poolsize_final = ParameterParserUtil.parseIntegerParam(robot_poolsize.get(exe.getSelectedRobotHost()), poolSizeRobot);182 } else {183 robot_poolsize_final = poolSizeRobot;184 }185 }186 constrains_current.put(const04_key, robot_poolsize_final);187 // Getting Robot Host PoolSize from invariant hashmap.188 int robotext_poolsize_final = 0;189 if (!StringUtil.isNullOrEmpty(exe.getSelectedRobotExtensionHost())) {190 if (robotext_poolsize.containsKey(exe.getSelectedRobotExtensionHost())) {191 robotext_poolsize_final = ParameterParserUtil.parseIntegerParam(robotext_poolsize.get(exe.getSelectedRobotExtensionHost()), poolSizeExecutorExt);192 } else {193 robotext_poolsize_final = poolSizeExecutorExt;194 }195 }196 constrains_current.put(const05_key, robotext_poolsize_final);197 }198 return constrains_current;199 }200 @Override201 public HashMap<String, Integer> getCurrentlyToTreat() throws CerberusException {202 AnswerList<TestCaseExecutionQueueToTreat> answer = new AnswerList<>();203 HashMap<String, Integer> constrains_current = new HashMap<String, Integer>();204 // Getting all executions to be treated.205 answer = tceiqService.readQueueToTreat();...

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