Search in sources :

Example 41 with PortableWorkDefinition

use of org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition in project drools-wb by kiegroup.

the class ActionWorkItemInsertFactColumnSynchronizerTest method setupWorkItemExecution.

@Before
public void setupWorkItemExecution() throws VetoException {
    final ActionWorkItemCol52 column = new ActionWorkItemCol52();
    final PortableWorkDefinition pwd = new PortableWorkDefinition();
    pwd.setName(WORK_ITEM_NAME);
    column.setWorkItemDefinition(pwd);
    column.setHeader("wid");
    modelSynchronizer.appendColumn(column);
}
Also used : ActionWorkItemCol52(org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52) PortableWorkDefinition(org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition) Before(org.junit.Before)

Example 42 with PortableWorkDefinition

use of org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition in project drools-wb by kiegroup.

the class WorkItemPageTest method newPortableWorkDefinition.

private PortableWorkDefinition newPortableWorkDefinition(final String displayName, final String name) {
    final PortableWorkDefinition mock = mock(PortableWorkDefinition.class);
    doReturn(displayName).when(mock).getDisplayName();
    doReturn(name).when(mock).getName();
    return mock;
}
Also used : PortableWorkDefinition(org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition)

Example 43 with PortableWorkDefinition

use of org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition in project drools-wb by kiegroup.

the class WorkItemPageTest method testShowParametersWhenParametersAreNotEnabled.

@Test
public void testShowParametersWhenParametersAreNotEnabled() {
    final PortableWorkDefinition workDefinition = mock(PortableWorkDefinition.class);
    when(plugin.getWorkItemDefinition()).thenReturn(workDefinition);
    page.showParameters();
    verify(view).hideParameters();
}
Also used : PortableWorkDefinition(org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition) Test(org.junit.Test)

Example 44 with PortableWorkDefinition

use of org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition in project drools-wb by kiegroup.

the class ActionWorkItemPluginTest method getMock.

private PortableWorkDefinition getMock(final String name) {
    final PortableWorkDefinition mock = mock(PortableWorkDefinition.class);
    when(mock.getDisplayName()).thenReturn(name);
    when(mock.getName()).thenReturn(name);
    return mock;
}
Also used : PortableWorkDefinition(org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition)

Example 45 with PortableWorkDefinition

use of org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition in project drools-wb by kiegroup.

the class ActionWorkItemPluginTest method testIsWorkItemSetWhenWorkItemDefinitionIsNotNull.

@Test
public void testIsWorkItemSetWhenWorkItemDefinitionIsNotNull() throws Exception {
    final PortableWorkDefinition workDefinition = mock(PortableWorkDefinition.class);
    when(editingCol.getWorkItemDefinition()).thenReturn(workDefinition);
    final Boolean isWorkItemSet = plugin.isWorkItemSet();
    assertTrue(isWorkItemSet);
}
Also used : PortableWorkDefinition(org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition) Test(org.junit.Test)

Aggregations

PortableWorkDefinition (org.drools.workbench.models.datamodel.workitems.PortableWorkDefinition)48 Test (org.junit.Test)30 ActionWorkItemCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionWorkItemCol52)17 PortableStringParameterDefinition (org.drools.workbench.models.datamodel.workitems.PortableStringParameterDefinition)16 ActionExecuteWorkItem (org.drools.workbench.models.datamodel.rule.ActionExecuteWorkItem)14 PortableFloatParameterDefinition (org.drools.workbench.models.datamodel.workitems.PortableFloatParameterDefinition)14 RuleModel (org.drools.workbench.models.datamodel.rule.RuleModel)13 PortableBooleanParameterDefinition (org.drools.workbench.models.datamodel.workitems.PortableBooleanParameterDefinition)13 ArrayList (java.util.ArrayList)11 PortableIntegerParameterDefinition (org.drools.workbench.models.datamodel.workitems.PortableIntegerParameterDefinition)11 HashSet (java.util.HashSet)7 HashMap (java.util.HashMap)6 BaseSingleFieldConstraint (org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint)6 CompositeFactPattern (org.drools.workbench.models.datamodel.rule.CompositeFactPattern)6 FactPattern (org.drools.workbench.models.datamodel.rule.FactPattern)6 FromAccumulateCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromAccumulateCompositeFactPattern)6 FromCollectCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromCollectCompositeFactPattern)6 FromCompositeFactPattern (org.drools.workbench.models.datamodel.rule.FromCompositeFactPattern)6 FromEntryPointFactPattern (org.drools.workbench.models.datamodel.rule.FromEntryPointFactPattern)6 SingleFieldConstraint (org.drools.workbench.models.datamodel.rule.SingleFieldConstraint)6