Skip to content

Commit

Permalink
Only add TestDescriptor for engine if non-empty
Browse files Browse the repository at this point in the history
Empty Engine nodes confuse Eclipse so much, it
never finishes its progress bar.
  • Loading branch information
marcphilipp committed Nov 3, 2015
1 parent 3d94492 commit 0e09764
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -12,6 +12,7 @@

import static org.junit.gen5.launcher.TestEngineRegistry.lookupAllTestEngines;

import java.util.Collection;
import java.util.List;

import org.junit.gen5.engine.EngineDescriptor;
Expand All @@ -38,8 +39,11 @@ public TestPlan discover(TestPlanSpecification specification) {
TestPlan testPlan = new TestPlan();
for (TestEngine testEngine : lookupAllTestEngines()) {
TestDescriptor engineDescriptor = new EngineDescriptor(testEngine);
testPlan.addTestDescriptor(engineDescriptor);
testPlan.addTestDescriptors(testEngine.discoverTests(specification, engineDescriptor));
Collection<TestDescriptor> testDescriptors = testEngine.discoverTests(specification, engineDescriptor);
if (!testDescriptors.isEmpty()) {
testPlan.addTestDescriptor(engineDescriptor);
testPlan.addTestDescriptors(testDescriptors);
}
}
return testPlan;
}
Expand Down

0 comments on commit 0e09764

Please sign in to comment.