How to use setCounter1 method of org.cerberus.dto.TreeNode class

Best Cerberus-source code snippet using org.cerberus.dto.TreeNode.setCounter1

Source:ReadTestCaseExecutionByTag.java Github

copy

Full Screen

...835 }836 }837 // Create Node.838 node = new TreeNode(label.getId() + "-" + label.getSystem() + "-" + label.getLabel(), label.getSystem(), label.getLabel(), label.getId(), label.getParentLabelID(), text, null, null, false);839 node.setCounter1(0);840 node.setCounter1WithChild(0);841 node.setTags(attributList);842 node.setType(label.getType());843 node.setCounter1Text("<span style='background-color:#000000' class='cnt1 badge badge-pill badge-secondary'>%COUNTER1%</span>");844 node.setCounter1WithChildText("<span class='cnt1WC badge badge-pill badge-secondary'>%COUNTER1WITHCHILD%</span>");845 node.setNbNodesText("<span style='background-color:#337ab7' class='nbNodes badge badge-pill badge-primary'>%NBNODESWITHCHILD%</span>");846 node.setLabelObj(label);847 inputList.put(node.getId(), node);848// LOG.debug("Label : " + node.getId() + " T : " + node);849 }850 HashMap<String, List<Integer>> testCaseWithLabel1 = new HashMap<>();851 for (TestCaseLabel label : (List<TestCaseLabel>) testCaseLabelList) {852// LOG.debug("TCLabel : " + label.getLabel() + " T : " + label.getTest() + " C : " + label.getTestcase() + " Type : " + label.getLabel().getType());853 if ((Label.TYPE_STICKER.equals(label.getLabel().getType()))854 || (Label.TYPE_REQUIREMENT.equals(label.getLabel().getType()))) {855 String key = label.getTest() + "_" + label.getTestcase();856 List<Integer> curLabelIdList = new ArrayList<>();857 if (testCaseWithLabel1.get(key) != null) {858 curLabelIdList = testCaseWithLabel1.get(key);859 curLabelIdList.add(label.getLabelId());860 testCaseWithLabel1.put(key, curLabelIdList);861// LOG.debug(" ADDED");862 } else {863 curLabelIdList.add(label.getLabelId());864 testCaseWithLabel1.put(key, curLabelIdList);865// LOG.debug(" ADDED");866 }867 }868 }869 /**870 * For All execution, get all labels from the test case and add if871 * those labels were in the list add the stats of executions into872 * the counters.873 */874 for (TestCaseExecution testCaseExecution : testCaseExecutions) {875// LOG.debug("Exe : " + testCaseExecution.getId() + " T : " + testCaseExecution.getTest() + " C : " + testCaseExecution.getTestCase());876 String controlStatus = testCaseExecution.getControlStatus();877 if (statusFilter.get(controlStatus).equals("on") && countryFilter.get(testCaseExecution.getCountry()).equals("on")) {878 //Get label for current test_testcase879 List<Integer> labelsForTestCase = testCaseWithLabel1.get(testCaseExecution.getTest() + "_" + testCaseExecution.getTestCase());880 if (labelsForTestCase != null) {881 for (Integer integer : labelsForTestCase) {882// LOG.debug(" T : " + testCaseExecution.getTest() + " C : " + testCaseExecution.getTestCase() + " T : " + integer);883 TreeNode curTreenode = inputList.get(integer);884 if (curTreenode != null) {885// LOG.debug(" K : " + titi.getKey() + " C : " + titi.getCounter1());886 curTreenode.setCounter1(curTreenode.getCounter1() + 1);887 curTreenode.setCounter1WithChild(curTreenode.getCounter1WithChild() + 1);888 switch (testCaseExecution.getControlStatus()) {889 case TestCaseExecution.CONTROLSTATUS_OK:890 curTreenode.setNbOK(curTreenode.getNbOK() + 1);891 break;892 case TestCaseExecution.CONTROLSTATUS_KO:893 curTreenode.setNbKO(curTreenode.getNbKO() + 1);894 break;895 case TestCaseExecution.CONTROLSTATUS_FA:896 curTreenode.setNbFA(curTreenode.getNbFA() + 1);897 break;898 case TestCaseExecution.CONTROLSTATUS_NA:899 curTreenode.setNbNA(curTreenode.getNbNA() + 1);900 break;901 case TestCaseExecution.CONTROLSTATUS_NE:...

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