Skip to content

Commit

Permalink
Be a bit more forthcoming with debug messages: report also the parame…
Browse files Browse the repository at this point in the history
…ter types of the method

Signed-off-by: Rajarshi Guha <rajarshi.guha@gmail.com>
  • Loading branch information
egonw authored and rajarshi committed Apr 20, 2010
1 parent c98a7af commit 0f85f52
Showing 1 changed file with 13 additions and 1 deletion.
Expand Up @@ -105,7 +105,7 @@ private int checkClass(String className) {
// skip this test
} else if (testMethodAnnotation == null) {
// if a method does not have the annotation, it's missing a test
System.out.println(className + "#" + method.getName() + " does not have a test method");
System.out.println(className + "#" + toString(method) + " does not have a test method");
missingTestCount++;
} else methodAnnotations.put(method.getName(), testMethodAnnotation);
}
Expand Down Expand Up @@ -172,6 +172,18 @@ private int checkClass(String className) {
return missingTestCount;
}

private String toString(Method method) {
StringBuffer methodString = new StringBuffer();
methodString.append(method.getName()).append('(');
Class[] classes = method.getParameterTypes();
for (int i=0;i<classes.length; i++) {
Class clazz = classes[i];
methodString.append(clazz.getName().substring(clazz.getName().lastIndexOf('.')+1));
if ((i+1)<classes.length) methodString.append(',');
}
methodString.append(')');
return methodString.toString();
}

private Class loadClass(String className) {
Class loadedClass = null;
Expand Down

0 comments on commit 0f85f52

Please sign in to comment.