Search in sources :

Example 1 with TemplateModellerWidgetFactory

use of org.drools.workbench.screens.guided.template.client.editor.TemplateModellerWidgetFactory in project drools-wb by kiegroup.

the class RuleModellerPageTest method testRuleModeller.

@Test
public void testRuleModeller() throws Exception {
    when(brlActionPlugin.getRuleModel()).thenReturn(new RuleModel());
    when(brlActionPlugin.tableFormat()).thenReturn(GuidedDecisionTable52.TableFormat.EXTENDED_ENTRY);
    when(brlActionPlugin.getRuleModellerActionPlugins()).thenReturn(Collections.singletonList(ruleModellerActionPlugin));
    when(brlActionPlugin.getRuleModellerConfiguration()).thenReturn(mock(RuleModellerConfiguration.class));
    when(presenter.getDataModelOracle()).thenReturn(mock(AsyncPackageDataModelOracle.class));
    final RuleModeller ruleModeller = brlActionPage.ruleModeller();
    assertNotNull(ruleModeller);
    assertEquals(brlActionPlugin.getRuleModel(), ruleModeller.getModel());
    assertEquals(Collections.singletonList(ruleModellerActionPlugin), ruleModeller.getActionPlugins());
    assertEquals(presenter.getDataModelOracle(), ruleModeller.getDataModelOracle());
    assertTrue(ruleModeller.getWidgetFactory() instanceof TemplateModellerWidgetFactory);
    assertFalse(ruleModeller.isReadOnly());
}
Also used : AsyncPackageDataModelOracle(org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle) RuleModeller(org.drools.workbench.screens.guided.rule.client.editor.RuleModeller) TemplateModellerWidgetFactory(org.drools.workbench.screens.guided.template.client.editor.TemplateModellerWidgetFactory) RuleModellerConfiguration(org.drools.workbench.screens.guided.rule.client.editor.RuleModellerConfiguration) RuleModel(org.drools.workbench.models.datamodel.rule.RuleModel) Test(org.junit.Test)

Aggregations

RuleModel (org.drools.workbench.models.datamodel.rule.RuleModel)1 RuleModeller (org.drools.workbench.screens.guided.rule.client.editor.RuleModeller)1 RuleModellerConfiguration (org.drools.workbench.screens.guided.rule.client.editor.RuleModellerConfiguration)1 TemplateModellerWidgetFactory (org.drools.workbench.screens.guided.template.client.editor.TemplateModellerWidgetFactory)1 Test (org.junit.Test)1 AsyncPackageDataModelOracle (org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle)1