Skip to content

Commit

Permalink
Identified and marked buggy tree building in JUnit5
Browse files Browse the repository at this point in the history
  • Loading branch information
jlink committed Nov 7, 2015
1 parent cecc46d commit a881ff7
Showing 1 changed file with 9 additions and 4 deletions.
Expand Up @@ -190,14 +190,19 @@ private Description generateDescription() {
Description suiteDescription = Description.createSuiteDescription(testClass.getName());
if (specification != null) {
TestPlan plan = launcher.discover(specification);
for (TestDescriptor descriptor : plan.getTestDescriptors()) {
Description description = createJUnit4Description(descriptor, suiteDescription);
id2Description.put(descriptor.getUniqueId(), description);
}
buildDescriptionTree(suiteDescription, plan);
}
return suiteDescription;
}

private void buildDescriptionTree(Description suiteDescription, TestPlan plan) {
//Todo: If children come before their parent the tree is not correctly built up
for (TestDescriptor descriptor : plan.getTestDescriptors()) {
Description description = createJUnit4Description(descriptor, suiteDescription);
id2Description.put(descriptor.getUniqueId(), description);
}
}

private Description createJUnit4Description(TestDescriptor testDescriptor, Description rootDescription) {
Description newDescription = null;
if (testDescriptor.isTest()) {
Expand Down

0 comments on commit a881ff7

Please sign in to comment.