mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
junit 5: rerun failed by method with signature
This commit is contained in:
@@ -89,9 +89,9 @@ public class TestMethods extends TestMethod {
|
||||
: ((PsiMethod)element).getContainingClass();
|
||||
if (containingClass != null) {
|
||||
final String proxyName = testInfo.getName();
|
||||
final String methodName = ((PsiMethod)element).getName();
|
||||
final String methodWithSignaturePresentation = JUnitConfiguration.Data.getMethodPresentation(((PsiMethod)element));
|
||||
return JavaExecutionUtil.getRuntimeQualifiedName(containingClass) + "," +
|
||||
(proxyName.contains(methodName) ? proxyName.substring(proxyName.indexOf(methodName)) : methodName);
|
||||
(proxyName.contains(methodWithSignaturePresentation) ? proxyName.substring(proxyName.indexOf(methodWithSignaturePresentation)) : methodWithSignaturePresentation);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -174,6 +174,18 @@ public class JUnitRerunFailedTestsTest extends LightCodeInsightFixtureTestCase
|
||||
assertEquals(aClass, element);
|
||||
}
|
||||
|
||||
public void testPresentationForJunit5MethodsWithParameters() throws Exception {
|
||||
myFixture.addClass("class A {}" +
|
||||
"public class TestClass {\n" +
|
||||
" @org.junit.platform.commons.annotation.Testable" +
|
||||
" public void testFoo(A a) throws Exception {}\n" +
|
||||
"}");
|
||||
final SMTestProxy testProxy = new SMTestProxy("testFoo", false, "java:test://TestClass.testFoo");
|
||||
testProxy.setLocator(JavaTestLocator.INSTANCE);
|
||||
final String presentation = TestMethods.getTestPresentation(testProxy, myFixture.getProject(), GlobalSearchScope.projectScope(myFixture.getProject()));
|
||||
assertEquals("TestClass,testFoo(A)", presentation);
|
||||
}
|
||||
|
||||
public void testMultipleClassesInOneFile() throws Exception {
|
||||
myFixture.configureByText("a.java", "public class Test1 {<caret>} public class Test2 {}");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user