Search in sources :

Example 31 with RawMVELEvaluator

use of org.kie.soup.project.datamodel.commons.util.RawMVELEvaluator in project drools-wb by kiegroup.

the class RuleModellerConditionSelectorPopupTest method testLoadDslConditionsDslEnabledButNotPresent.

@Test
public void testLoadDslConditionsDslEnabledButNotPresent() throws Exception {
    // DSL sentences enabled
    doReturn(true).when(ruleModeller).isDSLEnabled();
    // DSL Conditions not present
    dataModel = PackageDataModelOracleBuilder.newPackageOracleBuilder(new RawMVELEvaluator()).build();
    dataModelPayload = new PackageDataModelOracleBaselinePayload();
    dataModelPayload.setAllPackageElements(dataModel.getAllExtensions());
    asyncPackageDataModelOracleFactory.makeAsyncPackageDataModelOracle(resourcePath, dataModelPayload);
    new RuleModellerConditionSelectorPopup(model, ruleModeller, 0, oracle);
    verify(choices, atLeastOnce()).addItem(keyCaptor.capture(), valueCaptor.capture());
    Assertions.assertThat(keyCaptor.getAllValues()).doesNotContain(DSL_SENTENCE_CHOICE_KEY);
    Assertions.assertThat(valueCaptor.getAllValues()).doesNotContain(DSL_SENTENCE_CHOICE_VALUE);
}
Also used : PackageDataModelOracleBaselinePayload(org.kie.workbench.common.services.datamodel.model.PackageDataModelOracleBaselinePayload) RawMVELEvaluator(org.kie.soup.project.datamodel.commons.util.RawMVELEvaluator) Test(org.junit.Test)

Example 32 with RawMVELEvaluator

use of org.kie.soup.project.datamodel.commons.util.RawMVELEvaluator in project drools-wb by kiegroup.

the class RuleModellerConditionSelectorPopupTest method testLoadDslConditionsDslEnabledAndPresent.

@Test
public void testLoadDslConditionsDslEnabledAndPresent() throws Exception {
    // DSL sentences enabled
    doReturn(true).when(ruleModeller).isDSLEnabled();
    // DSL Conditions present
    dataModel = PackageDataModelOracleBuilder.newPackageOracleBuilder(new RawMVELEvaluator()).addExtension(DSLConditionSentence.INSTANCE, Collections.singletonList(dslSentence)).build();
    dataModelPayload = new PackageDataModelOracleBaselinePayload();
    dataModelPayload.setAllPackageElements(dataModel.getAllExtensions());
    asyncPackageDataModelOracleFactory.makeAsyncPackageDataModelOracle(resourcePath, dataModelPayload);
    new RuleModellerConditionSelectorPopup(model, ruleModeller, 0, oracle);
    verify(choices, atLeastOnce()).addItem(keyCaptor.capture(), valueCaptor.capture());
    verify(choices).setMultipleSelect(true);
    Assertions.assertThat(keyCaptor.getAllValues()).contains(DSL_SENTENCE_CHOICE_KEY);
    Assertions.assertThat(valueCaptor.getAllValues()).contains(DSL_SENTENCE_CHOICE_VALUE);
}
Also used : PackageDataModelOracleBaselinePayload(org.kie.workbench.common.services.datamodel.model.PackageDataModelOracleBaselinePayload) RawMVELEvaluator(org.kie.soup.project.datamodel.commons.util.RawMVELEvaluator) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)32 RawMVELEvaluator (org.kie.soup.project.datamodel.commons.util.RawMVELEvaluator)32 PackageDataModelOracleBaselinePayload (org.kie.workbench.common.services.datamodel.model.PackageDataModelOracleBaselinePayload)29 Path (org.uberfire.backend.vfs.Path)29 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)26 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)26 AsyncPackageDataModelOracle (org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle)26 ConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52)25 ModuleDataModelOracle (org.kie.soup.project.datamodel.oracle.ModuleDataModelOracle)25 ModelField (org.kie.soup.project.datamodel.oracle.ModelField)24 LimitedEntryConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryConditionCol52)19 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)14 ActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)12 ActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)12 PackageDataModelOracle (org.kie.soup.project.datamodel.oracle.PackageDataModelOracle)12 ArrayList (java.util.ArrayList)9 List (java.util.List)9 LimitedEntryActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionInsertFactCol52)9 LimitedEntryActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryActionSetFieldCol52)9 ColumnUtilities (org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities)7