Exemplo n.º 1
0
 public String getConditionCoverage(int index) {
   Object branchData = getConditionData(index);
   if (branchData == null) {
     return StringUtil.getPercentValue(1.0);
   } else if (branchData instanceof JumpData) {
     JumpData jumpData = (JumpData) branchData;
     return StringUtil.getPercentValue(jumpData.getBranchCoverageRate());
   } else {
     SwitchData switchData = (SwitchData) branchData;
     return StringUtil.getPercentValue(switchData.getBranchCoverageRate());
   }
 }
Exemplo n.º 2
0
 public String getConditionCoverage() {
   StringBuffer ret = new StringBuffer();
   if (getNumberOfValidBranches() == 0) {
     ret.append(StringUtil.getPercentValue(1.0));
   } else {
     ret.append(StringUtil.getPercentValue(getBranchCoverageRate()));
     ret.append(" (")
         .append(getNumberOfCoveredBranches())
         .append("/")
         .append(getNumberOfValidBranches())
         .append(")");
   }
   return ret.toString();
 }
 private static String xmlEscape(String str) {
   str = StringUtil.replaceAll(str, "<", "&lt;");
   str = StringUtil.replaceAll(str, ">", "&gt;");
   return str;
 }