From: David S. <ds...@us...> - 2006-06-28 20:55:39
|
Update of /cvsroot/junit/junit/org/junit/internal/runners In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv20424/org/junit/internal/runners Modified Files: MethodValidator.java Log Message: Methods on inaccessible superclasses of test classes are caught during validation Index: MethodValidator.java =================================================================== RCS file: /cvsroot/junit/junit/org/junit/internal/runners/MethodValidator.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- MethodValidator.java 15 Feb 2006 22:55:28 -0000 1.2 +++ MethodValidator.java 28 Jun 2006 20:55:36 -0000 1.3 @@ -35,6 +35,7 @@ validateTestMethods(AfterClass.class, true); } + // TODO Ugly API--one method should do both public List<Throwable> validateAllMethods() { validateNoArgConstructor(); validateStaticMethods(); @@ -64,6 +65,9 @@ fErrors.add(new Exception("Method " + each.getName() + "() " + state + " be static")); } + if (!Modifier.isPublic(each.getDeclaringClass().getModifiers())) + fErrors.add(new Exception("Class " + each.getDeclaringClass().getName() + + " should be public")); if (!Modifier.isPublic(each.getModifiers())) fErrors.add(new Exception("Method " + each.getName() + " should be public")); |