Assert.assertNotNull(nonFailMethod);
Assert.assertNotNull(failMethod);
final String scenarioName = "scenarioName";
final TestRootNodeBuilder rootNodeBuilder = new TestRootNodeBuilder();
final TestFeatureNodeBuilder featureBuilder = rootNodeBuilder.addFeature(new Feature("test feature", "file"));
final TestOutlineScenarioNodeBuilder outlineScenarioBuilder = featureBuilder.addOutlineScenario(scenarioName);
final TestOutlineScenarioRowNodeBuilder rowBuilder1 = outlineScenarioBuilder.addRow(1);
final TestOutlineScenarioRowNodeBuilder rowBuilder2 = outlineScenarioBuilder.addRow(2);
final TestBasicScenarioNodeBuilder row1ScenarioBuilder = rowBuilder1.setBasicScenario(scenarioName);
row1ScenarioBuilder.addStepImpl(getClass(), nonFailMethod).addStepImpl(getClass(), failMethod)
.addStepImpl(getClass(), nonFailMethod);
final TestBasicScenarioNodeBuilder row2ScenarioBuilder = rowBuilder2.setBasicScenario(scenarioName);
row2ScenarioBuilder.addStepImpls(3, getClass(), nonFailMethod);
final RootNode rootNode = rootNodeBuilder.build();
final ExecutionNodeRunner runner = new ExecutionNodeRunner();
final INotificationDistributor notificationDistributor = getPrivateField(runner, "notificationDistributor");
final SetupAndTearDown setupAndTearDown = mock(SetupAndTearDown.class);
final RootNodeExecutionContext nodeExecutionContext = new RootNodeExecutionContext(notificationDistributor,
Lists.<SubstepExecutionFailure> newArrayList(), setupAndTearDown, null, new ImplementationCache());
setPrivateField(runner, "rootNode", rootNode);
setPrivateField(runner, "nodeExecutionContext", nodeExecutionContext);
runner.run();
final List<SubstepExecutionFailure> failures = runner.getFailures();
Assert.assertThat(rootNode.getResult().getResult(), is(ExecutionResult.FAILED));
Assert.assertThat(featureBuilder.getBuilt().getResult().getResult(), is(ExecutionResult.FAILED));
Assert.assertThat(row1ScenarioBuilder.getBuilt().getResult().getResult(), is(ExecutionResult.FAILED));
Assert.assertThat(row2ScenarioBuilder.getBuilt().getResult().getResult(), is(ExecutionResult.PASSED));
Assert.assertThat(rowBuilder1.getBuilt().getResult().getResult(), is(ExecutionResult.FAILED));
Assert.assertThat(rowBuilder2.getBuilt().getResult().getResult(), is(ExecutionResult.PASSED));