mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
create test action: choose one of dependent modules only when exactly one exists with test root (IDEA-163111)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2015 JetBrains s.r.o.
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -147,9 +147,11 @@ public class CreateTestAction extends PsiElementBaseIntentionAction {
|
||||
final HashSet<Module> modules = new HashSet<>();
|
||||
ModuleUtilCore.collectModulesDependsOn(productionModule, modules);
|
||||
modules.remove(productionModule);
|
||||
for (Module module : modules) {
|
||||
if (!computeSuitableTestRootUrls(module).isEmpty()) return module;
|
||||
}
|
||||
List<Module> modulesWithTestRoot = modules.stream()
|
||||
.filter(module -> !computeSuitableTestRootUrls(module).isEmpty())
|
||||
.limit(2)
|
||||
.collect(Collectors.toList());
|
||||
if (modulesWithTestRoot.size() == 1) return modulesWithTestRoot.get(0);
|
||||
}
|
||||
|
||||
return productionModule;
|
||||
|
||||
Reference in New Issue
Block a user