Ejemplo n.º 1
0
        public virtual IList <HistoricJobLogDto> queryHistoricJobLogs(HistoricJobLogQueryDto queryDto, int?firstResult, int?maxResults)
        {
            queryDto.ObjectMapper = objectMapper;
            HistoricJobLogQuery query = queryDto.toQuery(processEngine);

            IList <HistoricJobLog> matchingHistoricJobLogs;

            if (firstResult != null || maxResults != null)
            {
                matchingHistoricJobLogs = executePaginatedQuery(query, firstResult, maxResults);
            }
            else
            {
                matchingHistoricJobLogs = query.list();
            }

            IList <HistoricJobLogDto> results = new List <HistoricJobLogDto>();

            foreach (HistoricJobLog historicJobLog in matchingHistoricJobLogs)
            {
                HistoricJobLogDto result = HistoricJobLogDto.fromHistoricJobLog(historicJobLog);
                results.Add(result);
            }

            return(results);
        }
Ejemplo n.º 2
0
        private void createHistoricJobLogMock()
        {
            HistoricJobLogQuery    mockHistoricJobLogQuery = mock(typeof(HistoricJobLogQuery));
            IList <HistoricJobLog> historicJobLogs         = MockProvider.createMockHistoricJobLogs();

            when(mockHistoricJobLogQuery.list()).thenReturn(historicJobLogs);
            when(mockHistoryService.createHistoricJobLogQuery()).thenReturn(mockHistoricJobLogQuery);
        }
Ejemplo n.º 3
0
        protected internal virtual HistoricJobLogQuery setUpMockHistoricJobLogQuery(IList <HistoricJobLog> mockedHistoricJogLogs)
        {
            HistoricJobLogQuery mockedhistoricJobLogQuery = mock(typeof(HistoricJobLogQuery));

            when(mockedhistoricJobLogQuery.list()).thenReturn(mockedHistoricJogLogs);
            when(mockedhistoricJobLogQuery.count()).thenReturn((long)mockedHistoricJogLogs.Count);

            when(processEngine.HistoryService.createHistoricJobLogQuery()).thenReturn(mockedhistoricJobLogQuery);

            return(mockedhistoricJobLogQuery);
        }
Ejemplo n.º 4
0
        protected internal virtual void verifyQueryResults(HistoricJobLogQuery query, int countExpected)
        {
            assertEquals(countExpected, query.list().size());
            assertEquals(countExpected, query.count());

            if (countExpected == 1)
            {
                assertNotNull(query.singleResult());
            }
            else if (countExpected > 1)
            {
                verifySingleResultFails(query);
            }
            else if (countExpected == 0)
            {
                assertNull(query.singleResult());
            }
        }
Ejemplo n.º 5
0
 protected internal virtual void verifyQueryWithOrdering(HistoricJobLogQuery query, int countExpected, TestOrderingUtil.NullTolerantComparator <HistoricJobLog> expectedOrdering)
 {
     verifyQueryResults(query, countExpected);
     TestOrderingUtil.verifySorting(query.list(), expectedOrdering);
 }