From: David S. <ds...@us...> - 2006-11-16 19:17:46
|
Update of /cvsroot/junit/junit/junit/framework In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25645/junit/framework Modified Files: TestSuite.java JUnit4TestAdapter.java Log Message: - Fixed raw types because Eclipse 3.3 told us to. - No longer dynamically check arrays that are statically typed as objects. - Update documentation to 4.2 Index: TestSuite.java =================================================================== RCS file: /cvsroot/junit/junit/junit/framework/TestSuite.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- TestSuite.java 25 Aug 2006 14:43:02 -0000 1.17 +++ TestSuite.java 16 Nov 2006 19:17:41 -0000 1.18 @@ -79,9 +79,8 @@ * its argument or a no arg constructor. */ public static Constructor<? extends TestCase> getTestConstructor(Class<? extends TestCase> theClass) throws NoSuchMethodException { - Class[] args= { String.class }; try { - return theClass.getConstructor(args); + return theClass.getConstructor(String.class); } catch (NoSuchMethodException e) { // fall through } @@ -140,7 +139,7 @@ return; } - Class superClass= theClass; + Class<?> superClass= theClass; List<String> names= new ArrayList<String>(); while (Test.class.isAssignableFrom(superClass)) { for (Method each : superClass.getDeclaredMethods()) @@ -171,9 +170,9 @@ * Constructs a TestSuite from the given array of classes. * @param classes {@link TestCase}s */ - public TestSuite (Class<? extends TestCase>... classes) { - for (Class<? extends TestCase> each : classes) - addTest(new TestSuite(each)); + public TestSuite (Class<?>... classes) { + for (Class<?> each : classes) + addTest(new TestSuite(each.asSubclass(TestCase.class))); } /** @@ -289,9 +288,9 @@ } private boolean isTestMethod(Method m) { - String name= m.getName(); - Class[] parameters= m.getParameterTypes(); - Class returnType= m.getReturnType(); - return parameters.length == 0 && name.startsWith("test") && returnType.equals(Void.TYPE); + return + m.getParameterTypes().length == 0 && + m.getName().startsWith("test") && + m.getReturnType().equals(Void.TYPE); } } \ No newline at end of file Index: JUnit4TestAdapter.java =================================================================== RCS file: /cvsroot/junit/junit/junit/framework/JUnit4TestAdapter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- JUnit4TestAdapter.java 15 Feb 2006 22:55:32 -0000 1.2 +++ JUnit4TestAdapter.java 16 Nov 2006 19:17:41 -0000 1.3 @@ -38,7 +38,7 @@ } // reflective interface for Eclipse - public Class getTestClass() { + public Class<?> getTestClass() { return fNewTestClass; } |