junit 5 inspection to warn about @RunWith(JUnitPlatform.class) without test methods (IDEA-160253)

This commit is contained in:
Anna Kozlova
2017-03-29 20:24:33 +02:00
parent ca122bda9e
commit 62bf50b8d1
6 changed files with 173 additions and 1 deletions
@@ -91,6 +91,10 @@ public abstract class LightInspectionTestCase extends LightCodeInsightFixtureTes
}
protected final void doTest(@Language("JAVA") @NotNull String classText) {
doTest(classText, "X.java");
}
protected final void doTest(@Language("JAVA") @NotNull String classText, String fileName) {
final StringBuilder newText = new StringBuilder();
int start = 0;
int end = classText.indexOf("/*");
@@ -121,7 +125,7 @@ public abstract class LightInspectionTestCase extends LightCodeInsightFixtureTes
end = classText.indexOf("/*", end + 1);
}
newText.append(classText, start, classText.length());
myFixture.configureByText("X.java", newText.toString());
myFixture.configureByText(fileName, newText.toString());
myFixture.testHighlighting(true, false, false);
}