use of com.intellij.testIntegration.TestRunLineMarkerProvider in project intellij-community by JetBrains.
the class RunLineMarkerTest method testNestedTestClass.
public void testNestedTestClass() throws Exception {
TestStateStorage stateStorage = TestStateStorage.getInstance(getProject());
String testUrl = "java:suite://Main$MainTest";
try {
stateStorage.writeState(testUrl, new TestStateStorage.Record(TestStateInfo.Magnitude.FAILED_INDEX.getValue(), new Date(), 0));
myFixture.addClass("package junit.framework; public class TestCase {}");
PsiFile file = myFixture.configureByText("MainTest.java", "public class Main {\n" + " public class Main<caret>Test extends junit.framework.TestCase {\n" + " public void testFoo() {\n" + " }\n" + " }" + "}");
RunLineMarkerContributor.Info info = new TestRunLineMarkerProvider().getInfo(file.findElementAt(myFixture.getCaretOffset()));
assertNotNull(info);
assertEquals(AllIcons.RunConfigurations.TestState.Red2, info.icon);
} finally {
stateStorage.removeState(testUrl);
}
}
Aggregations