You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2010/10/15 19:12:40 UTC
svn commit: r1023022 -
/lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java
Author: rmuir
Date: Fri Oct 15 17:12:39 2010
New Revision: 1023022
URL: http://svn.apache.org/viewvc?rev=1023022&view=rev
Log:
LUCENE-2709: if a test has methods with @ignore, we should print out a notice
Modified:
lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java
Modified: lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java?rev=1023022&r1=1023021&r2=1023022&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java (original)
+++ lucene/dev/trunk/lucene/src/test/org/apache/lucene/util/LuceneTestCase.java Fri Oct 15 17:12:39 2010
@@ -47,6 +47,7 @@ import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
+import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TestWatchman;
@@ -779,6 +780,14 @@ public abstract class LuceneTestCase ext
protected List<FrameworkMethod> computeTestMethods() {
if (testMethods != null)
return testMethods;
+ // check if the current test's class has methods annotated with @Ignore
+ final Class<?> clazz = getTestClass().getJavaClass();
+ for (Method m : clazz.getMethods()) {
+ Ignore ignored = m.getAnnotation(Ignore.class);
+ if (ignored != null) {
+ System.err.println("NOTE: Ignoring test method '" + m.getName() + "' " + ignored.value());
+ }
+ }
testMethods = getTestClass().getAnnotatedMethods(Test.class);
for (Method m : getTestClass().getJavaClass().getMethods()) {
final int mod = m.getModifiers();