CVS: junit/src/org/junit/internal/requests IgnoredClassRunner.java, NONE, 1.1 ClassRequest.java, 1.2, 1.3
David Saff <[email protected]>
| Newsgroups | gmane.comp.java.junit.devel |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/junit/junit/src/org/junit/internal/requests
In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv11688/src/org/junit/internal/requests
Modified Files:
ClassRequest.java
Added Files:
IgnoredClassRunner.java
Log Message:
Can @Ignore classes
assertArrayEquals added
--- NEW FILE: IgnoredClassRunner.java ---
/**
*
*/
package org.junit.internal.requests;
import org.junit.runner.Description;
import org.junit.runner.Runner;
import org.junit.runner.notification.RunNotifier;
public class IgnoredClassRunner extends Runner {
private final Class<?> fTestClass;
public IgnoredClassRunner(Class<?> testClass) {
fTestClass= testClass;
}
@Override
public void run(RunNotifier notifier) {
notifier.fireTestIgnored(getDescription());
}
@Override
public Description getDescription() {
return Description.createSuiteDescription(fTestClass);
}
}
Index: ClassRequest.java
===================================================================
RCS file: /cvsroot/junit/junit/src/org/junit/internal/requests/ClassRequest.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ClassRequest.java 13 Dec 2006 02:10:51 -0000 1.2
+++ ClassRequest.java 24 Jan 2007 16:32:59 -0000 1.3
@@ -2,6 +2,7 @@
import java.lang.reflect.Constructor;
+import org.junit.Ignore;
import org.junit.internal.runners.OldTestClassRunner;
import org.junit.internal.runners.TestClassRunner;
import org.junit.runner.Request;
@@ -35,7 +36,9 @@
}
}
- Class<? extends Runner> getRunnerClass(Class<?> testClass) {
+ Class<? extends Runner> getRunnerClass(final Class<?> testClass) {
+ if (testClass.getAnnotation(Ignore.class) != null)
+ return new IgnoredClassRunner(testClass).getClass();
RunWith annotation= testClass.getAnnotation(RunWith.class);
if (annotation != null) {
return annotation.value();
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV