use of org.junit.runner.Description in project serenity-jbehave by serenity-bdd.
the class JUnitDescriptionGenerator method addCompositeSteps.
private void addCompositeSteps(Description description, String stringStep, StepCandidate step) {
Description testDescription = Description.createSuiteDescription(getJunitSafeString(stringStep));
addSteps(testDescription, Arrays.asList(step.composedSteps()));
description.addChild(testDescription);
}
use of org.junit.runner.Description in project serenity-jbehave by serenity-bdd.
the class JUnitDescriptionGenerator method insertDescriptionForExamples.
private void insertDescriptionForExamples(PerformableScenario performableScenario, Description scenarioDescription) {
Scenario scenario = performableScenario.getScenario();
for (ExamplePerformableScenario examplePerformableScenario : performableScenario.getExamples()) {
Description exampleRowDescription = Description.createSuiteDescription(configuration.keywords().examplesTableRow() + " " + examplePerformableScenario.getParameters());
scenarioDescription.addChild(exampleRowDescription);
if (hasGivenStories(scenario)) {
insertGivenStories(scenario, exampleRowDescription);
}
addScenarioSteps(ScenarioType.EXAMPLE, scenario, exampleRowDescription);
}
}
use of org.junit.runner.Description in project junit5 by junit-team.
the class JUnitPlatformRunnerListener method executionFinished.
@Override
public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult) {
Description description = findJUnit4Description(testIdentifier);
Status status = testExecutionResult.getStatus();
if (status == ABORTED) {
this.notifier.fireTestAssumptionFailed(toFailure(testExecutionResult, description));
} else if (status == FAILED) {
this.notifier.fireTestFailure(toFailure(testExecutionResult, description));
}
if (description.isTest()) {
this.notifier.fireTestFinished(description);
}
}
use of org.junit.runner.Description in project junit5 by junit-team.
the class JUnitPlatformTestTree method generateSuiteDescription.
private Description generateSuiteDescription(TestPlan testPlan, Class<?> testClass) {
String displayName = useTechnicalNames(testClass) ? testClass.getName() : getSuiteDisplayName(testClass);
Description suiteDescription = Description.createSuiteDescription(displayName);
buildDescriptionTree(suiteDescription, testPlan);
return suiteDescription;
}
use of org.junit.runner.Description in project junit5 by junit-team.
the class JUnitPlatformTestTree method buildDescription.
private void buildDescription(TestIdentifier identifier, Description parent, TestPlan testPlan) {
Description newDescription = createJUnit4Description(identifier, testPlan);
parent.addChild(newDescription);
this.descriptions.put(identifier, newDescription);
testPlan.getChildren(identifier).forEach(testIdentifier -> buildDescription(testIdentifier, newDescription, testPlan));
}
Aggregations