예제 #1
0
        public virtual void testQuerySorting()
        {
            for (int i = 0; i < 10; i++)
            {
                runtimeService.startProcessInstanceByKey("process");
            }

            HistoricJobLogQuery query = historyService.createHistoricJobLogQuery();

            // asc
            query.orderByTimestamp().asc();
            verifyQueryWithOrdering(query, 10, historicJobLogByTimestamp());

            query = historyService.createHistoricJobLogQuery();

            query.orderByJobId().asc();
            verifyQueryWithOrdering(query, 10, historicJobLogByJobId());

            query = historyService.createHistoricJobLogQuery();

            query.orderByJobDefinitionId().asc();
            verifyQueryWithOrdering(query, 10, historicJobLogByJobDefinitionId());

            query = historyService.createHistoricJobLogQuery();

            query.orderByJobDueDate().asc();
            verifyQueryWithOrdering(query, 10, historicJobLogByJobDueDate());

            query = historyService.createHistoricJobLogQuery();

            query.orderByJobRetries().asc();
            verifyQueryWithOrdering(query, 10, historicJobLogByJobRetries());

            query = historyService.createHistoricJobLogQuery();

            query.orderByActivityId().asc();
            verifyQueryWithOrdering(query, 10, historicJobLogByActivityId());

            query = historyService.createHistoricJobLogQuery();

            query.orderByExecutionId().asc();
            verifyQueryWithOrdering(query, 10, historicJobLogByExecutionId());

            query = historyService.createHistoricJobLogQuery();

            query.orderByProcessInstanceId().asc();
            verifyQueryWithOrdering(query, 10, historicJobLogByProcessInstanceId());

            query = historyService.createHistoricJobLogQuery();

            query.orderByProcessDefinitionId().asc();
            verifyQueryWithOrdering(query, 10, historicJobLogByProcessDefinitionId());

            query = historyService.createHistoricJobLogQuery();

            query.orderByProcessDefinitionKey().asc();
            verifyQueryWithOrdering(query, 10, historicJobLogByProcessDefinitionKey(processEngine));

            query = historyService.createHistoricJobLogQuery();

            query.orderByDeploymentId().asc();
            verifyQueryWithOrdering(query, 10, historicJobLogByDeploymentId());

            query = historyService.createHistoricJobLogQuery();

            query.orderByJobPriority().asc();

            verifyQueryWithOrdering(query, 10, historicJobLogByJobPriority());

            // desc
            query.orderByTimestamp().desc();
            verifyQueryWithOrdering(query, 10, inverted(historicJobLogByTimestamp()));

            query = historyService.createHistoricJobLogQuery();

            query.orderByJobId().desc();
            verifyQueryWithOrdering(query, 10, inverted(historicJobLogByJobId()));

            query = historyService.createHistoricJobLogQuery();

            query.orderByJobDefinitionId().asc();
            verifyQueryWithOrdering(query, 10, inverted(historicJobLogByJobDefinitionId()));

            query = historyService.createHistoricJobLogQuery();

            query.orderByJobDueDate().desc();
            verifyQueryWithOrdering(query, 10, inverted(historicJobLogByJobDueDate()));

            query = historyService.createHistoricJobLogQuery();

            query.orderByJobRetries().desc();
            verifyQueryWithOrdering(query, 10, inverted(historicJobLogByJobRetries()));

            query = historyService.createHistoricJobLogQuery();

            query.orderByActivityId().desc();
            verifyQueryWithOrdering(query, 10, inverted(historicJobLogByActivityId()));

            query = historyService.createHistoricJobLogQuery();

            query.orderByExecutionId().desc();
            verifyQueryWithOrdering(query, 10, inverted(historicJobLogByExecutionId()));

            query = historyService.createHistoricJobLogQuery();

            query.orderByProcessInstanceId().desc();
            verifyQueryWithOrdering(query, 10, inverted(historicJobLogByProcessInstanceId()));

            query = historyService.createHistoricJobLogQuery();

            query.orderByProcessDefinitionId().desc();
            verifyQueryWithOrdering(query, 10, inverted(historicJobLogByProcessDefinitionId()));

            query = historyService.createHistoricJobLogQuery();

            query.orderByProcessDefinitionKey().desc();
            verifyQueryWithOrdering(query, 10, inverted(historicJobLogByProcessDefinitionKey(processEngine)));

            query = historyService.createHistoricJobLogQuery();

            query.orderByDeploymentId().desc();
            verifyQueryWithOrdering(query, 10, inverted(historicJobLogByDeploymentId()));

            query = historyService.createHistoricJobLogQuery();

            query.orderByJobPriority().desc();

            verifyQueryWithOrdering(query, 10, inverted(historicJobLogByJobPriority()));
        }