use of io.cucumber.messages.types.TestStepResult in project cucumber-jvm by cucumber.
the class TestStep method emitTestStepFinished.
private void emitTestStepFinished(TestCase testCase, EventBus bus, UUID textExecutionId, Instant stopTime, Duration duration, Result result) {
bus.send(new TestStepFinished(stopTime, testCase, this, result));
TestStepResult testStepResult = new TestStepResult();
if (result.getError() != null) {
testStepResult.setMessage(extractStackTrace(result.getError()));
}
testStepResult.setStatus(from(result.getStatus()));
testStepResult.setDuration(javaDurationToDuration(duration));
Envelope envelope = new Envelope();
envelope.setTestStepFinished(new io.cucumber.messages.types.TestStepFinished(textExecutionId.toString(), id.toString(), testStepResult, javaInstantToTimestamp(stopTime)));
bus.send(envelope);
}
use of io.cucumber.messages.types.TestStepResult in project cucumber-jvm by cucumber.
the class TestCase method emitTestCaseFinished.
private void emitTestCaseFinished(EventBus bus, UUID executionId, Instant stop, Duration duration, Status status, Result result) {
bus.send(new TestCaseFinished(stop, this, result));
TestStepResult testStepResult = new TestStepResult();
testStepResult.setStatus(from(status));
testStepResult.setDuration(javaDurationToDuration(duration));
if (result.getError() != null) {
testStepResult.setMessage(toString(result.getError()));
}
Envelope envelope = new Envelope();
envelope.setTestCaseFinished(new io.cucumber.messages.types.TestCaseFinished(executionId.toString(), javaInstantToTimestamp(stop), false));
bus.send(envelope);
}
Aggregations