复制代码
public static final String INSTRUCTION="INSTRUCTION";
public static final String BRANCH="BRANCH";
public static final String LINE="LINE";
public static final String COMPLEXITY="COMPLEXITY";
public static final String METHOD="METHOD";
public static final String[] COVERES={INSTRUCTION};
复制代码
复制代码
// 获取当前节点的所有属性节点
List<Attribute> list = node.attributes();
// 遍历属性节点
for (Attribute attr : list) {
if (node.getName().equals("counter")) { // 节点等于 counter
if (needCollect(attr.getText()) || is) { // 当属性等于INSTRUCTION拿出covered // INSTRUCTION // 拿出该covered
is = true;
}
if (attr.getName().equals("covered") && is) {
String p=getFristAttributeText(node.getParent());
data += node.getParent().getName() + " - "
+ p + " --- "
+ currentCovered+"-"+attr.getName() + " ----- " + attr.getText()
+ " ";
is = false;
break;
}