Beispiel #1
0
 protected internal virtual void assertLogIsInDeletedState(HistoricExternalTaskLog log)
 {
     assertFalse(log.CreationLog);
     assertFalse(log.FailureLog);
     assertFalse(log.SuccessLog);
     assertTrue(log.DeletionLog);
 }
Beispiel #2
0
        public static HistoricExternalTaskLogDto fromHistoricExternalTaskLog(HistoricExternalTaskLog historicExternalTaskLog)
        {
            HistoricExternalTaskLogDto result = new HistoricExternalTaskLogDto();

            result.id          = historicExternalTaskLog.Id;
            result.timestamp   = historicExternalTaskLog.Timestamp;
            result.removalTime = historicExternalTaskLog.RemovalTime;

            result.externalTaskId = historicExternalTaskLog.ExternalTaskId;
            result.topicName      = historicExternalTaskLog.TopicName;
            result.workerId       = historicExternalTaskLog.WorkerId;
            result.priority       = historicExternalTaskLog.Priority;
            result.retries        = historicExternalTaskLog.Retries;
            result.errorMessage   = historicExternalTaskLog.ErrorMessage;

            result.activityId         = historicExternalTaskLog.ActivityId;
            result.activityInstanceId = historicExternalTaskLog.ActivityInstanceId;
            result.executionId        = historicExternalTaskLog.ExecutionId;

            result.processInstanceId     = historicExternalTaskLog.ProcessInstanceId;
            result.processDefinitionId   = historicExternalTaskLog.ProcessDefinitionId;
            result.processDefinitionKey  = historicExternalTaskLog.ProcessDefinitionKey;
            result.tenantId              = historicExternalTaskLog.TenantId;
            result.rootProcessInstanceId = historicExternalTaskLog.RootProcessInstanceId;

            result.creationLog = historicExternalTaskLog.CreationLog;
            result.failureLog  = historicExternalTaskLog.FailureLog;
            result.successLog  = historicExternalTaskLog.SuccessLog;
            result.deletionLog = historicExternalTaskLog.DeletionLog;

            return(result);
        }
Beispiel #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByNonExistingTopicName()
        public virtual void testQueryByNonExistingTopicName()
        {
            // given
            startExternalTaskProcess();

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().topicName("foo bar").singleResult();

            // then
            assertNull(log);
        }
Beispiel #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByNonExistingProcessDefinitionKey()
        public virtual void testQueryByNonExistingProcessDefinitionKey()
        {
            // given
            startExternalTaskProcess();

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().processDefinitionKey("foo").singleResult();

            // then
            assertNull(log);
        }
Beispiel #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByNonExistingActivityInstanceIds()
        public virtual void testQueryByNonExistingActivityInstanceIds()
        {
            // given
            startExternalTaskProcess();

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().activityInstanceIdIn("foo").singleResult();

            // then
            assertNull(log);
        }
Beispiel #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByNonExistingErrorMessage()
        public virtual void testQueryByNonExistingErrorMessage()
        {
            // given
            startExternalTaskProcess();

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().errorMessage("asdfasdf").singleResult();

            // then
            assertNull(log);
        }
Beispiel #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQuery()
        public virtual void testQuery()
        {
            // given
            ExternalTask task = startExternalTaskProcess();

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().singleResult();

            // then
            assertNotNull(log);
            assertThat(log.ExternalTaskId, @is(task.Id));
        }
Beispiel #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByProcessDefinitionKey()
        public virtual void testQueryByProcessDefinitionKey()
        {
            // given
            startExternalTaskProcessGivenProcessDefinitionKey("dummyProcess");
            ExternalTask task = startExternalTaskProcessGivenProcessDefinitionKey("Process");

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().processDefinitionKey(task.ProcessDefinitionKey).singleResult();

            // then
            assertNotNull(log);
            assertThat(log.ExternalTaskId, @is(task.Id));
        }
Beispiel #9
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByProcessDefinitionId()
        public virtual void testQueryByProcessDefinitionId()
        {
            // given
            startExternalTaskProcesses(2);
            string definitionId = retrieveFirstHistoricExternalTaskLog().ProcessDefinitionId;

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().processDefinitionId(definitionId).singleResult();

            // then
            assertNotNull(log);
            assertThat(log.ProcessDefinitionId, @is(definitionId));
        }
Beispiel #10
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByExecutionIds()
        public virtual void testQueryByExecutionIds()
        {
            // given
            startExternalTaskProcesses(2);
            HistoricExternalTaskLog taskLog = retrieveFirstHistoricExternalTaskLog();

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().executionIdIn(taskLog.ExecutionId).singleResult();

            // then
            assertNotNull(log);
            assertThat(log.Id, @is(taskLog.Id));
        }
Beispiel #11
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByActivityId()
        public virtual void testQueryByActivityId()
        {
            // given
            startExternalTaskProcessGivenActivityId("dummyName");
            ExternalTask task = startExternalTaskProcess();

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().activityIdIn(DEFAULT_EXTERNAL_TASK_NAME).singleResult();

            // then
            assertNotNull(log);
            assertThat(log.ExternalTaskId, @is(task.Id));
        }
Beispiel #12
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testHistoricExternalTaskLogCreateProperties()
        public virtual void testHistoricExternalTaskLogCreateProperties()
        {
            // given
            ExternalTask task = startExternalTaskProcess();

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().creationLog().singleResult();

            // then
            assertHistoricLogPropertiesAreProperlySet(task, log);
            assertEquals(null, log.WorkerId);
            assertLogIsInCreatedState(log);
        }
Beispiel #13
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByNonExistingWorkerId()
        public virtual void testQueryByNonExistingWorkerId()
        {
            // given
            ExternalTask task = startExternalTaskProcess();

            completeExternalTask(task.Id);

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().workerId("foo").singleResult();

            // then
            assertNull(log);
        }
Beispiel #14
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByDeletionLog()
        public virtual void testQueryByDeletionLog()
        {
            // given
            ExternalTask task = startExternalTaskProcess();

            runtimeService.deleteProcessInstance(task.ProcessInstanceId, null);

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().deletionLog().singleResult();

            // then
            assertNotNull(log);
            assertThat(log.ExternalTaskId, @is(task.Id));
        }
Beispiel #15
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByFailureLog()
        public virtual void testQueryByFailureLog()
        {
            // given
            ExternalTask task = startExternalTaskProcess();

            reportExternalTaskFailure(task.Id, "Dummy error message!");

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().failureLog().singleResult();

            // then
            assertNotNull(log);
            assertThat(log.ExternalTaskId, @is(task.Id));
        }
Beispiel #16
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByTopicName()
        public virtual void testQueryByTopicName()
        {
            // given
            string dummyTopic = "dummy";

            startExternalTaskProcessGivenTopicName(dummyTopic);
            ExternalTask task = startExternalTaskProcess();

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().topicName(DEFAULT_TOPIC).singleResult();

            // then
            assertNotNull(log);
            assertThat(log.ExternalTaskId, @is(task.Id));
        }
Beispiel #17
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testHistoricExternalTaskLogDeletedProperties()
        public virtual void testHistoricExternalTaskLogDeletedProperties()
        {
            // given
            ExternalTask task = startExternalTaskProcess();

            runtimeService.deleteProcessInstance(task.ProcessInstanceId, "Dummy reason for deletion!");

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().deletionLog().singleResult();

            // then
            assertHistoricLogPropertiesAreProperlySet(task, log);
            assertEquals(null, log.WorkerId);
            assertLogIsInDeletedState(log);
        }
Beispiel #18
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testHistoricExternalTaskLogSuccessfulProperties()
        public virtual void testHistoricExternalTaskLogSuccessfulProperties()
        {
            // given
            ExternalTask task = startExternalTaskProcess();

            completeExternalTask(task.Id);

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().successLog().singleResult();

            // then
            assertHistoricLogPropertiesAreProperlySet(task, log);
            assertEquals(WORKER_ID, log.WorkerId);
            assertLogIsInSuccessfulState(log);
        }
Beispiel #19
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByWorkerId()
        public virtual void testQueryByWorkerId()
        {
            // given
            IList <ExternalTask> taskList    = startExternalTaskProcesses(2);
            ExternalTask         taskToCheck = taskList[1];

            completeExternalTaskWithWorker(taskList[0].Id, "dummyWorker");
            completeExternalTaskWithWorker(taskToCheck.Id, WORKER_ID);

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().workerId(WORKER_ID).singleResult();

            // then
            assertNotNull(log);
            assertThat(log.ExternalTaskId, @is(taskToCheck.Id));
        }
Beispiel #20
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testRetriesAndWorkerIdWhenFirstFailureAndThenComplete()
        public virtual void testRetriesAndWorkerIdWhenFirstFailureAndThenComplete()
        {
            // given
            ExternalTask task = startExternalTaskProcess();

            reportExternalTaskFailure(task.Id);
            completeExternalTask(task.Id);

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().successLog().singleResult();

            // then
            assertEquals(WORKER_ID, log.WorkerId);
            assertEquals(Convert.ToInt32(1), log.Retries);
            assertLogIsInSuccessfulState(log);
        }
Beispiel #21
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testHistoricExternalTaskLogFailedProperties()
        public virtual void testHistoricExternalTaskLogFailedProperties()
        {
            // given
            ExternalTask task = startExternalTaskProcess();

            reportExternalTaskFailure(task.Id);
            task = externalTaskService.createExternalTaskQuery().singleResult();

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().failureLog().singleResult();

            // then
            assertHistoricLogPropertiesAreProperlySet(task, log);
            assertEquals(WORKER_ID, log.WorkerId);
            assertLogIsInFailedState(log);
        }
Beispiel #22
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryByErrorMessage()
        public virtual void testQueryByErrorMessage()
        {
            // given
            IList <ExternalTask> taskList = startExternalTaskProcesses(2);
            string errorMessage           = "This is an important error!";

            reportExternalTaskFailure(taskList[0].Id, "Dummy error message");
            reportExternalTaskFailure(taskList[1].Id, errorMessage);

            // when
            HistoricExternalTaskLog log = historyService.createHistoricExternalTaskLogQuery().errorMessage(errorMessage).singleResult();

            // then
            assertNotNull(log);
            assertThat(log.ExternalTaskId, @is(taskList[1].Id));
        }
Beispiel #23
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testErrorMessageTruncation()
        public virtual void testErrorMessageTruncation()
        {
            // given
            string       exceptionMessage = createStringOfLength(1000);
            ExternalTask task             = startExternalTaskProcess();

            reportExternalTaskFailure(task.Id, exceptionMessage, ERROR_DETAILS);

            // when
            HistoricExternalTaskLog failedLog = historyService.createHistoricExternalTaskLogQuery().failureLog().singleResult();

            string errorMessage         = failedLog.ErrorMessage;
            string expectedErrorMessage = exceptionMessage.Substring(0, ExternalTaskEntity.MAX_EXCEPTION_MESSAGE_LENGTH);

            // then
            assertNotNull(failedLog);
            assertEquals(ExternalTaskEntity.MAX_EXCEPTION_MESSAGE_LENGTH, errorMessage.Length);
            assertEquals(expectedErrorMessage, errorMessage);
        }
Beispiel #24
0
        protected internal virtual void assertHistoricLogPropertiesAreProperlySet(ExternalTask task, HistoricExternalTaskLog log)
        {
            assertNotNull(log);
            assertNotNull(log.Id);
            assertNotNull(log.Timestamp);

            assertEquals(task.Id, log.ExternalTaskId);
            assertEquals(task.ActivityId, log.ActivityId);
            assertEquals(task.ActivityInstanceId, log.ActivityInstanceId);
            assertEquals(task.TopicName, log.TopicName);
            assertEquals(task.Retries, log.Retries);
            assertEquals(task.ExecutionId, log.ExecutionId);
            assertEquals(task.ProcessInstanceId, log.ProcessInstanceId);
            assertEquals(task.ProcessDefinitionId, log.ProcessDefinitionId);
            assertEquals(task.ProcessDefinitionKey, log.ProcessDefinitionKey);
            assertEquals(task.Priority, log.Priority);
        }