Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ public Description matchAnnotation(AnnotationTree tree, VisitorState state) {
if (!enclosingClass(isJUnit3TestClass).matches(tree, state)) {
return NO_MATCH;
}
// If we are inside a JUnit3 test class some annotation should not appear.
if (isType("org.junit.Ignore").matches(tree, state)) {
return makeDescription("@Ignore", tree);
}
// If we are inside a JUnit3 test class some annotations should not appear.
if (isType("org.junit.Rule").matches(tree, state)) {
return makeDescription("@Rule", tree);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,46 +197,6 @@ public void testName3() {}
.doTest();
}

@Test
public void positive_ignore_on_test() {
compilationHelper
.addSourceLines(
"Foo.java",
"""
import junit.framework.TestCase;
import org.junit.Ignore;

public class Foo extends TestCase {
public void testName1() {}

// BUG: Diagnostic contains: @Ignore
@Ignore
public void testName2() {}
}
""")
.doTest();
}

@Test
public void positive_ignore_on_class() {
compilationHelper
.addSourceLines(
"Foo.java",
"""
import junit.framework.TestCase;
import org.junit.Ignore;

// BUG: Diagnostic contains: @Ignore
@Ignore
public class Foo extends TestCase {
public void testName1() {}

public void testName2() {}
}
""")
.doTest();
}

@Test
public void positive_rule_in_junit3() {
compilationHelper
Expand Down
Loading