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()); } }
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, "<", "<"); str = StringUtil.replaceAll(str, ">", ">"); return str; }