Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void querySorting()
        public virtual void querySorting()
        {
            DecisionDefinitionQuery query = repositoryService.createDecisionDefinitionQuery();

            // asc
            query.orderByDecisionDefinitionId().asc();
            verifyQueryResults(query, 4);

            query = repositoryService.createDecisionDefinitionQuery();

            query.orderByDeploymentId().asc();
            verifyQueryResults(query, 4);

            query = repositoryService.createDecisionDefinitionQuery();

            query.orderByDecisionDefinitionKey().asc();
            verifyQueryResults(query, 4);

            query = repositoryService.createDecisionDefinitionQuery();

            query.orderByDecisionDefinitionVersion().asc();
            verifyQueryResults(query, 4);

            // desc

            query = repositoryService.createDecisionDefinitionQuery();

            query.orderByDecisionDefinitionId().desc();
            verifyQueryResults(query, 4);

            query = repositoryService.createDecisionDefinitionQuery();

            query.orderByDeploymentId().desc();
            verifyQueryResults(query, 4);

            query = repositoryService.createDecisionDefinitionQuery();

            query.orderByDecisionDefinitionKey().desc();
            verifyQueryResults(query, 4);

            query = repositoryService.createDecisionDefinitionQuery();

            query.orderByDecisionDefinitionVersion().desc();
            verifyQueryResults(query, 4);

            query = repositoryService.createDecisionDefinitionQuery();

            // Typical use decision
            query.orderByDecisionDefinitionKey().asc().orderByDecisionDefinitionVersion().desc();

            IList <DecisionDefinition> decisionDefinitions = query.list();

            assertEquals(4, decisionDefinitions.Count);

            assertEquals("one", decisionDefinitions[0].Key);
            assertEquals(2, decisionDefinitions[0].Version);
            assertEquals("one", decisionDefinitions[1].Key);
            assertEquals(1, decisionDefinitions[1].Version);
            assertEquals("two", decisionDefinitions[2].Key);
            assertEquals(1, decisionDefinitions[2].Version);
        }