mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
test runner: cache scopes in console properties
This commit is contained in:
@@ -97,30 +97,20 @@ public abstract class SourceScope {
|
||||
public static SourceScope modulesWithDependencies(final Module[] modules) {
|
||||
if (modules == null || modules.length == 0) return null;
|
||||
return new ModuleSourceScope(modules[0].getProject()) {
|
||||
|
||||
private GlobalSearchScope myGlobalSearchScope;
|
||||
private GlobalSearchScope myLibScope;
|
||||
|
||||
public GlobalSearchScope getGlobalSearchScope() {
|
||||
if (myGlobalSearchScope == null) {
|
||||
myGlobalSearchScope = evaluateScopesAndUnite(modules, new ScopeForModuleEvaluator() {
|
||||
public GlobalSearchScope evaluate(final Module module) {
|
||||
return GlobalSearchScope.moduleWithDependenciesScope(module);
|
||||
}
|
||||
});
|
||||
}
|
||||
return myGlobalSearchScope;
|
||||
return evaluateScopesAndUnite(modules, new ScopeForModuleEvaluator() {
|
||||
public GlobalSearchScope evaluate(final Module module) {
|
||||
return GlobalSearchScope.moduleWithDependenciesScope(module);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public GlobalSearchScope getLibrariesScope() {
|
||||
if (myLibScope == null) {
|
||||
myLibScope = evaluateScopesAndUnite(modules, new ScopeForModuleEvaluator() {
|
||||
public GlobalSearchScope evaluate(final Module module) {
|
||||
return new ModuleWithDependenciesAndLibsDependencies(module);
|
||||
}
|
||||
});
|
||||
}
|
||||
return myLibScope;
|
||||
return evaluateScopesAndUnite(modules, new ScopeForModuleEvaluator() {
|
||||
public GlobalSearchScope evaluate(final Module module) {
|
||||
return new ModuleWithDependenciesAndLibsDependencies(module);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public Module[] getModulesToCompile() {
|
||||
@@ -145,30 +135,20 @@ public abstract class SourceScope {
|
||||
public static SourceScope modules(final Module[] modules) {
|
||||
if (modules == null || modules.length == 0) return null;
|
||||
return new ModuleSourceScope(modules[0].getProject()) {
|
||||
|
||||
private GlobalSearchScope myLibScope;
|
||||
private GlobalSearchScope myGlobalSearchScope;
|
||||
|
||||
public GlobalSearchScope getGlobalSearchScope() {
|
||||
if (myGlobalSearchScope == null) {
|
||||
myGlobalSearchScope = evaluateScopesAndUnite(modules, new ScopeForModuleEvaluator() {
|
||||
public GlobalSearchScope evaluate(final Module module) {
|
||||
return GlobalSearchScope.moduleScope(module);
|
||||
}
|
||||
});
|
||||
}
|
||||
return myGlobalSearchScope;
|
||||
return evaluateScopesAndUnite(modules, new ScopeForModuleEvaluator() {
|
||||
public GlobalSearchScope evaluate(final Module module) {
|
||||
return GlobalSearchScope.moduleScope(module);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public GlobalSearchScope getLibrariesScope() {
|
||||
if (myLibScope == null) {
|
||||
myLibScope = evaluateScopesAndUnite(modules, new ScopeForModuleEvaluator() {
|
||||
public GlobalSearchScope evaluate(final Module module) {
|
||||
return GlobalSearchScope.moduleWithLibrariesScope(module);
|
||||
}
|
||||
});
|
||||
}
|
||||
return myLibScope;
|
||||
return evaluateScopesAndUnite(modules, new ScopeForModuleEvaluator() {
|
||||
public GlobalSearchScope evaluate(final Module module) {
|
||||
return GlobalSearchScope.moduleWithLibrariesScope(module);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public Module[] getModulesToCompile() {
|
||||
|
||||
+8
@@ -55,6 +55,7 @@ public abstract class TestConsoleProperties extends StoringPropertyContainer imp
|
||||
private final Executor myExecutor;
|
||||
private ConsoleView myConsole;
|
||||
private boolean myUsePredefinedMessageFilter = true;
|
||||
private GlobalSearchScope myScope;
|
||||
|
||||
protected final HashMap<AbstractProperty, ArrayList<TestFrameworkPropertyListener>> myListeners =
|
||||
new HashMap<AbstractProperty, ArrayList<TestFrameworkPropertyListener>>();
|
||||
@@ -70,6 +71,13 @@ public abstract class TestConsoleProperties extends StoringPropertyContainer imp
|
||||
}
|
||||
|
||||
public GlobalSearchScope getScope() {
|
||||
if (myScope == null) {
|
||||
myScope = initScope();
|
||||
}
|
||||
return myScope;
|
||||
}
|
||||
|
||||
protected GlobalSearchScope initScope() {
|
||||
Module[] modules = getConfiguration().getModules();
|
||||
if (modules.length == 0) return GlobalSearchScope.allScope(myProject);
|
||||
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ public class JUnitConsoleProperties extends JavaAwareTestConsoleProperties {
|
||||
public JUnitConfiguration getConfiguration() { return myConfiguration; }
|
||||
|
||||
@Override
|
||||
public GlobalSearchScope getScope() {
|
||||
protected GlobalSearchScope initScope() {
|
||||
final SourceScope sourceScope = myConfiguration.getPersistentData().getScope().getSourceScope(myConfiguration);
|
||||
return sourceScope != null ? sourceScope.getLibrariesScope() : GlobalSearchScope.allScope(getProject());
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class TestNGConsoleProperties extends JavaAwareTestConsoleProperties {
|
||||
}
|
||||
|
||||
@Override
|
||||
public GlobalSearchScope getScope() {
|
||||
protected GlobalSearchScope initScope() {
|
||||
return myConfiguration.getPersistantData().getScope().getSourceScope(myConfiguration).getLibrariesScope();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user