don't check scope for class/method configurations as it is invisible in settings

This commit is contained in:
Anna Kozlova
2015-05-07 11:46:18 +02:00
parent 428bd97e98
commit 778faf960b
2 changed files with 20 additions and 3 deletions
@@ -40,8 +40,18 @@ public class JUnitConsoleProperties extends JavaAwareTestConsoleProperties<JUnit
@NotNull
@Override
protected GlobalSearchScope initScope() {
final SourceScope sourceScope = myConfiguration.getPersistentData().getScope().getSourceScope(myConfiguration);
return sourceScope != null ? sourceScope.getGlobalSearchScope() : GlobalSearchScope.allScope(getProject());
final JUnitConfiguration.Data persistentData = myConfiguration.getPersistentData();
final String testObject = persistentData.TEST_OBJECT;
//ignore invisible setting
if (JUnitConfiguration.TEST_CATEGORY.equals(testObject) ||
JUnitConfiguration.TEST_PATTERN.equals(testObject) ||
JUnitConfiguration.TEST_PACKAGE.equals(testObject)) {
final SourceScope sourceScope = persistentData.getScope().getSourceScope(myConfiguration);
return sourceScope != null ? sourceScope.getGlobalSearchScope() : GlobalSearchScope.allScope(getProject());
}
else {
return super.initScope();
}
}
@Override
@@ -39,7 +39,14 @@ public class TestNGConsoleProperties extends JavaAwareTestConsoleProperties<Test
@NotNull
@Override
protected GlobalSearchScope initScope() {
return myConfiguration.getPersistantData().getScope().getSourceScope(myConfiguration).getGlobalSearchScope();
final String testObject = myConfiguration.getPersistantData().TEST_OBJECT;
if (TestType.CLASS.getType().equals(testObject) ||
TestType.METHOD.getType().equals(testObject)) {
return super.initScope();
}
else {
return myConfiguration.getPersistantData().getScope().getSourceScope(myConfiguration).getGlobalSearchScope();
}
}
@Override