Search in sources :

Example 21 with DropDownData

use of org.kie.soup.project.datamodel.oracle.DropDownData in project drools-wb by kiegroup.

the class ConstraintValueEditorHelperTest method isEnumEquivalentFirstNull.

@Test
public void isEnumEquivalentFirstNull() throws Exception {
    final DropDownData dropDownData = mock(DropDownData.class);
    doReturn(new String[0]).when(dropDownData).getFixedList();
    Assertions.assertThat(ConstraintValueEditorHelper.isEnumEquivalent(null, dropDownData)).isFalse();
}
Also used : DropDownData(org.kie.soup.project.datamodel.oracle.DropDownData) Test(org.junit.Test)

Example 22 with DropDownData

use of org.kie.soup.project.datamodel.oracle.DropDownData in project drools-wb by kiegroup.

the class ConstraintValueEditorHelperTest method isEnumEquivalentBothNull.

@Test
public void isEnumEquivalentBothNull() throws Exception {
    final DropDownData dropDownData = mock(DropDownData.class);
    doReturn(null).when(dropDownData).getFixedList();
    Assertions.assertThat(ConstraintValueEditorHelper.isEnumEquivalent(null, dropDownData)).isTrue();
}
Also used : DropDownData(org.kie.soup.project.datamodel.oracle.DropDownData) Test(org.junit.Test)

Example 23 with DropDownData

use of org.kie.soup.project.datamodel.oracle.DropDownData in project drools-wb by kiegroup.

the class CallMethodWidget method valueEditor.

private Widget valueEditor(final CallFieldValue val) {
    String type = "";
    if (oracle.isGlobalVariable(this.mCall.getVariable())) {
        type = oracle.getGlobalVariable(this.mCall.getVariable());
    } else {
        Map<String, String> mFactTypes = scenario.getVariableTypes();
        type = mFactTypes.get(this.mCall.getVariable());
    }
    DropDownData enums = oracle.getEnums(type, val.field, this.mCall.getCallFieldValuesMap());
    return new MethodParameterCallValueEditor(val, enums, executionTrace, scenario, val.type, oracle);
}
Also used : DropDownData(org.kie.soup.project.datamodel.oracle.DropDownData)

Aggregations

DropDownData (org.kie.soup.project.datamodel.oracle.DropDownData)23 Test (org.junit.Test)18 Map (java.util.Map)7 FactPattern (org.drools.workbench.models.datamodel.rule.FactPattern)5 SingleFieldConstraint (org.drools.workbench.models.datamodel.rule.SingleFieldConstraint)5 ConstraintValueEditorHelper (org.drools.workbench.screens.guided.rule.client.editor.util.ConstraintValueEditorHelper)5 AsyncPackageDataModelOracle (org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle)5 Path (org.uberfire.backend.vfs.Path)5 GuidedDecisionTablePresenter (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTablePresenter)3 GuidedDecisionTableView (org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView)3 DependentEnumsUtilities (org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.DependentEnumsUtilities)3 Caller (org.jboss.errai.common.client.api.Caller)3 Assert.assertEquals (org.junit.Assert.assertEquals)3 Assert.assertFalse (org.junit.Assert.assertFalse)3 Assert.assertTrue (org.junit.Assert.assertTrue)3 Before (org.junit.Before)3 RunWith (org.junit.runner.RunWith)3 EnumDropdownService (org.kie.workbench.common.services.shared.enums.EnumDropdownService)3 Mock (org.mockito.Mock)3 Mockito.any (org.mockito.Mockito.any)3