CVS: junit/src/org/junit/internal/runners JUnit4ClassRunner.java, 1.1, 1.2
David Saff <[email protected]> Thu, 26 Apr 2007 12:56:34 -0700
| Newsgroups | gmane.comp.java.junit.devel |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/junit/junit/src/org/junit/internal/runners
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1805/src/org/junit/internal/runners
Modified Files:
JUnit4ClassRunner.java
Log Message:
[Junit-trackers] [ junit-Bugs-1684562 ] assertEquals throws NPE while comparing null elements
Descriptions now have Annotations
Index: JUnit4ClassRunner.java
===================================================================
RCS file: /cvsroot/junit/junit/src/org/junit/internal/runners/JUnit4ClassRunner.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- JUnit4ClassRunner.java 20 Mar 2007 14:43:50 -0000 1.1
+++ JUnit4ClassRunner.java 26 Apr 2007 19:56:31 -0000 1.2
@@ -1,5 +1,6 @@
package org.junit.internal.runners;
+import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Collections;
@@ -48,13 +49,17 @@
@Override
public Description getDescription() {
- Description spec= Description.createSuiteDescription(getName());
+ Description spec= Description.createSuiteDescription(getName(), classAnnotations());
List<Method> testMethods= fTestMethods;
for (Method method : testMethods)
- spec.addChild(methodDescription(method));
+ spec.addChild(methodDescription(method));
return spec;
}
+ protected Annotation[] classAnnotations() {
+ return fTestClass.getJavaClass().getAnnotations();
+ }
+
protected String getName() {
return getTestClass().getName();
}
@@ -86,7 +91,12 @@
}
protected Description methodDescription(Method method) {
- return Description.createTestDescription(getTestClass().getJavaClass(), testName(method));
+ Description result= Description.createTestDescription(getTestClass().getJavaClass(), testName(method), testAnnotations(method));
+ return result;
+ }
+
+ protected Annotation[] testAnnotations(Method method) {
+ return method.getAnnotations();
}
public void filter(Filter filter) throws NoTestsRemainException {
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/