use of cucumber.api.PendingException in project cucumber-jvm by cucumber.
the class RuntimeTest method should_add_pending_result_to_the_summary_counter.
@Test
public void should_add_pending_result_to_the_summary_counter() throws Throwable {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Reporter reporter = mock(Reporter.class);
StepDefinitionMatch match = createExceptionThrowingMatch(new PendingException());
Runtime runtime = createRuntimeWithMockedGlue(match, "--monochrome");
runScenario(reporter, runtime, stepCount(1));
runtime.printStats(new PrintStream(baos));
assertThat(baos.toString(), containsString(String.format("" + "1 Scenarios (1 pending)%n" + "1 Steps (1 pending)%n")));
}
use of cucumber.api.PendingException in project cucumber-jvm by cucumber.
the class RuntimeTest method non_strict_with_pending_steps.
@Test
public void non_strict_with_pending_steps() {
Runtime runtime = createNonStrictRuntime();
runtime.addError(new PendingException());
assertEquals(0x0, runtime.exitStatus());
}
use of cucumber.api.PendingException in project alien4cloud by alien4cloud.
the class TopologyStepDefinitions method I_create_a_in_an_archive_name_version.
@Given("^I create a \"([^\"]*)\" \"([^\"]*)\" in an archive name \"([^\"]*)\" version \"([^\"]*)\"$")
public void I_create_a_in_an_archive_name_version(String componentType, String elementId, String archiveName, String archiveVersion) throws Throwable {
AbstractInheritableToscaType element = new AbstractInheritableToscaType();
element.setAbstract(false);
element.setElementId(elementId);
element.setArchiveName(archiveName);
element.setArchiveVersion(archiveVersion);
element.setWorkspace(AlienConstants.GLOBAL_WORKSPACE_ID);
Class<?> clazz = null;
if (componentType.equals("capability") || componentType.equals("capabilities")) {
clazz = CapabilityType.class;
} else {
throw new PendingException("creation of Type " + componentType + "not supported!");
}
esClient.prepareIndex(ElasticSearchDAO.TOSCA_ELEMENT_INDEX, MappingBuilder.indexTypeFromClass(clazz)).setSource(JsonUtil.toString(element)).setRefresh(true).execute().actionGet();
}
use of cucumber.api.PendingException in project cucumber-jvm by cucumber.
the class RuntimeTest method strict_with_pending_steps_and_no_errors.
@Test
public void strict_with_pending_steps_and_no_errors() {
Runtime runtime = createStrictRuntime();
runtime.addError(new PendingException());
assertEquals(0x1, runtime.exitStatus());
}
use of cucumber.api.PendingException in project cucumber-jvm by cucumber.
the class JUnitReporterTest method after_with_pending_exception_non_strict.
@Test
public void after_with_pending_exception_non_strict() {
createNonStrictReporter();
createDefaultRunNotifier();
Result result = mock(Result.class);
Match match = mock(Match.class);
when(result.getStatus()).thenReturn("Pending");
when(result.getError()).thenReturn(new PendingException());
EachTestNotifier executionUnitNotifier = mock(EachTestNotifier.class);
jUnitReporter.executionUnitNotifier = executionUnitNotifier;
jUnitReporter.after(match, result);
jUnitReporter.finishExecutionUnit();
verify(executionUnitNotifier).fireTestIgnored();
}
Aggregations