use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogTest method testErrorMessageTruncation.
@Test
public void testErrorMessageTruncation() {
// given
String exceptionMessage = createStringOfLength(1000);
ExternalTask task = startExternalTaskProcess();
reportExternalTaskFailure(task.getId(), exceptionMessage, ERROR_DETAILS);
// when
HistoricExternalTaskLog failedLog = historyService.createHistoricExternalTaskLogQuery().failureLog().singleResult();
String errorMessage = failedLog.getErrorMessage();
String expectedErrorMessage = exceptionMessage.substring(0, ExternalTaskEntity.MAX_EXCEPTION_MESSAGE_LENGTH);
// then
assertNotNull(failedLog);
assertEquals(ExternalTaskEntity.MAX_EXCEPTION_MESSAGE_LENGTH, errorMessage.length());
assertEquals(expectedErrorMessage, errorMessage);
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogTest method testErrorDetailsWithTwoDifferentErrorsThrown.
@Test
public void testErrorDetailsWithTwoDifferentErrorsThrown() {
// given
ExternalTask task = startExternalTaskProcess();
String firstErrorDetails = "Dummy error details!";
String secondErrorDetails = ERROR_DETAILS;
reportExternalTaskFailure(task.getId(), ERROR_MESSAGE, firstErrorDetails);
ensureEnoughTimePassedByForTimestampOrdering();
reportExternalTaskFailure(task.getId(), ERROR_MESSAGE, secondErrorDetails);
// when
List<HistoricExternalTaskLog> list = historyService.createHistoricExternalTaskLogQuery().failureLog().orderByTimestamp().asc().list();
String firstFailedLogId = list.get(0).getId();
String secondFailedLogId = list.get(1).getId();
// then
String stacktrace1 = historyService.getHistoricExternalTaskLogErrorDetails(firstFailedLogId);
String stacktrace2 = historyService.getHistoricExternalTaskLogErrorDetails(secondFailedLogId);
assertNotNull(stacktrace1);
assertNotNull(stacktrace2);
assertEquals(firstErrorDetails, stacktrace1);
assertEquals(secondErrorDetails, stacktrace2);
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogQueryTest method testQueryByNonExistingTopicName.
@Test
public void testQueryByNonExistingTopicName() {
// given
startExternalTaskProcess();
// when
HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().topicName("foo bar").singleResult();
// then
assertNull(log);
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogQueryTest method testQueryByNonExistingExecutionIds.
@Test
public void testQueryByNonExistingExecutionIds() {
// given
startExternalTaskProcess();
// when
HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().executionIdIn("foo").singleResult();
// then
assertNull(log);
}
use of org.camunda.bpm.engine.history.HistoricExternalTaskLog in project camunda-bpm-platform by camunda.
the class HistoricExternalTaskLogQueryTest method testQueryByNonExistingActivityInstanceIds.
@Test
public void testQueryByNonExistingActivityInstanceIds() {
// given
startExternalTaskProcess();
// when
HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().activityInstanceIdIn("foo").singleResult();
// then
assertNull(log);
}
Aggregations