remove redundant fields in *TestConsoleProperties

This commit is contained in:
Anna Kozlova
2015-07-06 15:56:24 +03:00
parent af348d757a
commit a4486fa84f
2 changed files with 5 additions and 8 deletions
@@ -34,23 +34,21 @@ import javax.swing.*;
public class JUnitConsoleProperties extends JavaAwareTestConsoleProperties<JUnitConfiguration> {
private final JUnitConfiguration myConfiguration;
public JUnitConsoleProperties(@NotNull JUnitConfiguration configuration, Executor executor) {
super("JUnit", configuration, executor);
myConfiguration = configuration;
}
@NotNull
@Override
protected GlobalSearchScope initScope() {
final JUnitConfiguration.Data persistentData = myConfiguration.getPersistentData();
final JUnitConfiguration.Data persistentData = getConfiguration().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);
final SourceScope sourceScope = persistentData.getScope().getSourceScope(getConfiguration());
return sourceScope != null ? sourceScope.getGlobalSearchScope() : GlobalSearchScope.allScope(getProject());
}
else {
@@ -34,23 +34,22 @@ import org.jetbrains.annotations.Nullable;
import javax.swing.*;
public class TestNGConsoleProperties extends JavaAwareTestConsoleProperties<TestNGConfiguration> {
private final TestNGConfiguration myConfiguration;
public TestNGConsoleProperties(TestNGConfiguration config, Executor executor) {
super("TestNG", config, executor);
myConfiguration = config;
}
@NotNull
@Override
protected GlobalSearchScope initScope() {
final String testObject = myConfiguration.getPersistantData().TEST_OBJECT;
final TestNGConfiguration configuration = getConfiguration();
final String testObject = configuration.getPersistantData().TEST_OBJECT;
if (TestType.CLASS.getType().equals(testObject) ||
TestType.METHOD.getType().equals(testObject)) {
return super.initScope();
}
else {
final SourceScope sourceScope = myConfiguration.getPersistantData().getScope().getSourceScope(myConfiguration);
final SourceScope sourceScope = configuration.getPersistantData().getScope().getSourceScope(configuration);
return sourceScope != null ? sourceScope.getGlobalSearchScope() : GlobalSearchScope.allScope(getProject());
}
}