@Override public int compareTo(final Location o) { int comp = this.clazz.compareTo(o.getClassName()); if (comp != 0) { return comp; } comp = this.method.name().compareTo(o.getMethodName().name()); if (comp != 0) { return comp; } return this.methodDesc.compareTo(o.getMethodDesc()); }
private Predicate<MutationDetails> inEqualsMethod() { return a -> { final Location loc = a.getId().getLocation(); return loc.getMethodDesc().equals("(Ljava/lang/Object;)Z") && loc.getMethodName().equals(MethodName.fromString("equals")); }; }
private void writeLineCoverage(final BlockCoverage each, final Writer out) { final Location l = each.getBlock().getLocation(); write( out, "<block classname='" + l.getClassName().asJavaName() + "'" + " method='" + StringUtil.escapeBasicHtmlChars(l.getMethodName().name()) + StringUtil.escapeBasicHtmlChars(l.getMethodDesc()) + "' number='" + each.getBlock().getBlock() + "'>"); write(out, "<tests>\n"); final List<String> ts = new ArrayList<>(each.getTests()); Collections.sort(ts); for (final String test : ts) { write(out, "<test name='" + StringUtil.escapeBasicHtmlChars(test) + "'/>\n"); } write(out, "</tests>\n"); write(out, "</block>\n"); }
public String desc() { return location.getMethodDesc(); }
@Override public int compareTo(final Location o) { int comp = this.clazz.compareTo(o.getClassName()); if (comp != 0) { return comp; } comp = this.method.name().compareTo(o.getMethodName().name()); if (comp != 0) { return comp; } return this.methodDesc.compareTo(o.getMethodDesc()); }
private String makeMutationNode(final MutationResult mutation) { final MutationDetails details = mutation.getDetails(); return makeNode(clean(details.getFilename()), sourceFile) + makeNode(clean(details.getClassName().asJavaName()), mutatedClass) + makeNode(clean(details.getMethod().name()), mutatedMethod) + makeNode(clean(details.getId().getLocation().getMethodDesc()), methodDescription) + makeNode("" + details.getLineNumber(), lineNumber) + makeNode(clean(details.getMutator()), mutator) + makeNode("" + details.getFirstIndex(), index) + makeNode("" + details.getBlock(), block) + makeNodeWhenConditionSatisfied(!fullMutationMatrix, createKillingTestDesc(mutation.getKillingTest()), killingTest) + makeNodeWhenConditionSatisfied(fullMutationMatrix, createTestDesc(mutation.getKillingTests()), killingTests) + makeNodeWhenConditionSatisfied(fullMutationMatrix, createTestDesc(mutation.getSucceedingTests()), succeedingTests) + makeNode(clean(details.getDescription()), description); }
@Override public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { MethodVisitor methodVisitor = cv.visitMethod(access, name, desc, signature, exceptions); Location location = mID.getLocation(); if(location.getMethodDesc().equals(desc) && location.getMethodName().name().equals(name)) { return new MutationMethodAdapter( MutationOperator.fromID(mID.getMutator()), new Method(location.getMethodName().name(), location.getMethodDesc()), methodVisitor); } return methodVisitor; } }
public static String methodKey(MutationResult mutation) { String className = mutation.getDetails().getClassName().asJavaName(); String methodName = mutation.getDetails().getMethod().name(); String methodDescription = mutation.getDetails().getId().getLocation().getMethodDesc(); return className + "." + methodName + methodDescription; }
private String makeMutationNode(MutationResult mutation) { MutationDetails details = mutation.getDetails(); return makeNode(clean(details.getFilename()), Tag.sourceFile) + makeNode(clean(details.getClassName().asJavaName()), Tag.mutatedClass) + makeNode(clean(details.getMethod().name()), Tag.mutatedMethod) + makeNode(clean(details.getId().getLocation().getMethodDesc()), Tag.methodDescription) + makeNode("" + details.getLineNumber(), Tag.lineNumber) + makeNode(clean(details.getMutator()), Tag.mutator) + makeNode("" + details.getFirstIndex(), Tag.index) + makeNode(createKillingTestDesc(mutation.getKillingTest()), Tag.killingTest) + makeTestInfoNode(details) + makeNode(clean(details.getDescription()), Tag.description); }
MutationStatusTestPair pair = result.getStatusTestPair(); String method = details.getMethod().name(); String methodDescription = details.getId().getLocation().getMethodDesc();