Пример #1
0
 /**
  * This computation is based on the priority of the results : - priority 1 : Failed - priority 2 :
  * NMI - priority 3 : Not Tested - priority 4 : Passed - priority 5 : NA
  *
  * <p>If at least one of the result type is found regarding the priority definition, the criterion
  * result is the result type
  *
  * @param crs
  * @param criterionTestListSize
  */
 private void computeCriterionResult(CriterionStatistics crs) {
   if (crs.getNbOfFailed() > 0) { // at least one test is failed, the criterion is failed
     crs.setCriterionResult(TestSolution.FAILED);
   } else if (crs.getNbOfNmi()
       > 0) { // at least one test is nmi and no failed test encountered, the criterion is nmi
     crs.setCriterionResult(TestSolution.NEED_MORE_INFO);
   } else if (crs.getNbOfNotTested() > 0) {
     crs.setCriterionResult(TestSolution.NOT_TESTED);
   } else if (crs.getNbOfPassed() > 0) {
     crs.setCriterionResult(TestSolution.PASSED);
   } else if (crs.getNbOfNa() > 0) {
     crs.setCriterionResult(TestSolution.NOT_APPLICABLE);
   } else {
     crs.setCriterionResult(TestSolution.NEED_MORE_INFO);
   }
 }
Пример #2
0
 /**
  * @param cs
  * @param testSolution
  */
 private void incrementCriterionCounterFromTestSolution(
     CriterionStatistics cs, TestSolution testSolution) {
   switch (testSolution) {
     case PASSED:
       cs.setNbOfPassed(cs.getNbOfPassed() + 1);
       break;
     case FAILED:
       cs.setNbOfFailed(cs.getNbOfFailed() + 1);
       break;
     case NOT_APPLICABLE:
       cs.setNbOfNa(cs.getNbOfNa() + 1);
       break;
     case NEED_MORE_INFO:
     case DETECTED:
     case SUSPECTED_FAILED:
     case SUSPECTED_PASSED:
       cs.setNbOfNmi(cs.getNbOfNmi() + 1);
       break;
     case NOT_TESTED:
       cs.setNbOfNotTested(cs.getNbOfNotTested() + 1);
       break;
   }
 }