Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testStatisticForRootDecisionWithNullInstanceConstraintEvaluation() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testStatisticForRootDecisionWithNullInstanceConstraintEvaluation()
        {
            //when
            decisionService.evaluateDecisionTableByKey(DISH_DECISION).variables(Variables.createVariables().putValue(TEMPERATURE, 21).putValue(DAY_TYPE, WEEKEND)).evaluate();

            DecisionRequirementsDefinition decisionRequirementsDefinition = repositoryService.createDecisionRequirementsDefinitionQuery().singleResult();
            //when
            HistoricDecisionInstanceStatisticsQuery query = historyService.createHistoricDecisionInstanceStatisticsQuery(decisionRequirementsDefinition.Id).decisionInstanceId(null);

            //then
            try
            {
                query.count();
            }
            catch (NullValueException)
            {
                //expected
            }

            try
            {
                query.list();
            }
            catch (NullValueException)
            {
                //expected
            }
        }
Beispiel #2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryNoAuthenticatedTenants()
        public virtual void testQueryNoAuthenticatedTenants()
        {
            DecisionRequirementsDefinition decisionRequirementsDefinition = repositoryService.createDecisionRequirementsDefinitionQuery().tenantIdIn(TENANT_ONE).singleResult();

            identityService.setAuthentication(USER_ID, null, null);

            HistoricDecisionInstanceStatisticsQuery query = historyService.createHistoricDecisionInstanceStatisticsQuery(decisionRequirementsDefinition.Id);

            assertThat(query.count(), @is(0L));
        }
Beispiel #3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testStatisticForNotEvaluatedDRD() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testStatisticForNotEvaluatedDRD()
        {
            //when
            DecisionRequirementsDefinition decisionRequirementsDefinition = repositoryService.createDecisionRequirementsDefinitionQuery().singleResult();

            HistoricDecisionInstanceStatisticsQuery statisticsQuery = historyService.createHistoricDecisionInstanceStatisticsQuery(decisionRequirementsDefinition.Id);

            //then
            assertThat("available statistics count", statisticsQuery.count(), @is(0L));
            assertThat("available statistics elements", statisticsQuery.list().size(), @is(0));
        }
Beispiel #4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testQueryDisabledTenantCheck()
        public virtual void testQueryDisabledTenantCheck()
        {
            DecisionRequirementsDefinition decisionRequirementsDefinition = repositoryService.createDecisionRequirementsDefinitionQuery().tenantIdIn(TENANT_ONE).singleResult();

            engineRule.ProcessEngineConfiguration.TenantCheckEnabled = false;
            identityService.setAuthentication(USER_ID, null, null);

            HistoricDecisionInstanceStatisticsQuery query = historyService.createHistoricDecisionInstanceStatisticsQuery(decisionRequirementsDefinition.Id);

            assertThat(query.count(), @is(3L));
        }
Beispiel #5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testStatisticForRootDecisionWithFakeInstanceConstraintEvaluation() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testStatisticForRootDecisionWithFakeInstanceConstraintEvaluation()
        {
            //when
            decisionService.evaluateDecisionTableByKey(DISH_DECISION).variables(Variables.createVariables().putValue(TEMPERATURE, 21).putValue(DAY_TYPE, WEEKEND)).evaluate();

            DecisionRequirementsDefinition decisionRequirementsDefinition = repositoryService.createDecisionRequirementsDefinitionQuery().singleResult();

            HistoricDecisionInstanceStatisticsQuery query = historyService.createHistoricDecisionInstanceStatisticsQuery(decisionRequirementsDefinition.Id).decisionInstanceId(NON_EXISTING);

            //then
            assertThat(query.count(), @is(0L));
            assertThat(query.list().size(), @is(0));
        }
Beispiel #6
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testStatisticForChildDecisionEvaluation() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testStatisticForChildDecisionEvaluation()
        {
            //when
            decisionService.evaluateDecisionTableByKey("season").variables(Variables.createVariables().putValue(TEMPERATURE, 21)).evaluate();

            DecisionRequirementsDefinition decisionRequirementsDefinition = repositoryService.createDecisionRequirementsDefinitionQuery().singleResult();

            HistoricDecisionInstanceStatisticsQuery statisticsQuery = historyService.createHistoricDecisionInstanceStatisticsQuery(decisionRequirementsDefinition.Id);

            //then
            assertThat(statisticsQuery.count(), @is(1L));
            assertThat(statisticsQuery.list().size(), @is(1));
            assertThat(statisticsQuery.list().get(0).Evaluations, @is(1));
            assertThat(statisticsQuery.list().get(0).DecisionDefinitionKey, @is(notNullValue()));
        }
Beispiel #7
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testStatisticForRootDecisionEvaluation() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testStatisticForRootDecisionEvaluation()
        {
            //when
            decisionService.evaluateDecisionTableByKey(DISH_DECISION).variables(Variables.createVariables().putValue(TEMPERATURE, 21).putValue(DAY_TYPE, WEEKEND)).evaluate();

            decisionService.evaluateDecisionTableByKey(DISH_DECISION).variables(Variables.createVariables().putValue(TEMPERATURE, 11).putValue(DAY_TYPE, WEEKEND)).evaluate();

            DecisionRequirementsDefinition decisionRequirementsDefinition = repositoryService.createDecisionRequirementsDefinitionQuery().singleResult();

            HistoricDecisionInstanceStatisticsQuery statisticsQuery = historyService.createHistoricDecisionInstanceStatisticsQuery(decisionRequirementsDefinition.Id);

            //then
            assertThat(statisticsQuery.count(), @is(3L));
            assertThat(statisticsQuery.list().size(), @is(3));
            assertThat(statisticsQuery.list().get(0).Evaluations, @is(2));
            assertThat(statisticsQuery.list().get(0).DecisionDefinitionKey, @is(notNullValue()));
        }
Beispiel #8
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void testStatisticConstrainedToOneDRD() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        public virtual void testStatisticConstrainedToOneDRD()
        {
            //given
            testRule.deploy(SCORE_DRG_DMN);

            //when
            decisionService.evaluateDecisionTableByKey("score-decision").variables(Variables.createVariables().putValue("input", "john")).evaluate();

            decisionService.evaluateDecisionTableByKey("season").variables(Variables.createVariables().putValue(TEMPERATURE, 21)).evaluate();

            DecisionRequirementsDefinition decisionRequirementsDefinition = repositoryService.createDecisionRequirementsDefinitionQuery().decisionRequirementsDefinitionName("Score").singleResult();

            HistoricDecisionInstanceStatisticsQuery statisticsQuery = historyService.createHistoricDecisionInstanceStatisticsQuery(decisionRequirementsDefinition.Id);

            //then
            assertThat(statisticsQuery.count(), @is(1L));
            assertThat(statisticsQuery.list().size(), @is(1));
            assertThat(statisticsQuery.list().get(0).Evaluations, @is(1));
            assertThat(statisticsQuery.list().get(0).DecisionDefinitionKey, @is(notNullValue()));
        }