mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
disable pattern configurations if another test framework is selected (IDEA-132654)
This commit is contained in:
@@ -51,7 +51,9 @@ public class PatternConfigurationProducer extends JUnitConfigurationProducer {
|
||||
Ref<PsiElement> sourceElement) {
|
||||
final LinkedHashSet<String> classes = new LinkedHashSet<String>();
|
||||
PsiElement[] elements = collectPatternElements(context, classes);
|
||||
if (classes.size() <= 1) return false;
|
||||
if (elements == null || collectTestMembers(elements, false).size() <= 1) {
|
||||
return false;
|
||||
}
|
||||
sourceElement.set(elements[0]);
|
||||
final JUnitConfiguration.Data data = configuration.getPersistentData();
|
||||
data.setPatterns(classes);
|
||||
|
||||
+4
-2
@@ -53,7 +53,9 @@ public class TestNGPatternConfigurationProducer extends TestNGConfigurationProdu
|
||||
Ref<PsiElement> sourceElement) {
|
||||
final LinkedHashSet<String> classes = new LinkedHashSet<String>();
|
||||
PsiElement[] elements = collectPatternElements(context, classes);
|
||||
if (classes.size() <= 1) return false;
|
||||
if (elements == null || collectTestMembers(elements).size() <= 1) {
|
||||
return false;
|
||||
}
|
||||
final TestData data = configuration.getPersistantData();
|
||||
data.setPatterns(classes);
|
||||
data.TEST_OBJECT = TestType.PATTERN.getType();
|
||||
@@ -69,7 +71,7 @@ public class TestNGPatternConfigurationProducer extends TestNGConfigurationProdu
|
||||
if (psiElement instanceof PsiClassOwner) {
|
||||
final PsiClass[] classes = ((PsiClassOwner)psiElement).getClasses();
|
||||
for (PsiClass aClass : classes) {
|
||||
if (JUnitUtil.isTestClass(aClass)) {
|
||||
if (TestNGUtil.hasTest(aClass)) {
|
||||
foundMembers.add(aClass);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user