Search in sources :

Example 51 with ConditionCol52

use of org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52 in project drools-wb by kiegroup.

the class DecisionTableAnalyzerTest method testInsertNonExistingColumn.

@Test(expected = IllegalArgumentException.class)
public void testInsertNonExistingColumn() throws Exception {
    ConditionCol52 a = new ConditionCol52();
    ConditionCol52 b = new ConditionCol52();
    pattern.setChildColumns(Arrays.asList(a));
    BRLConditionColumn brlCondition = new BRLConditionColumn();
    BRLConditionVariableColumn c = new BRLConditionVariableColumn();
    BRLConditionVariableColumn d = new BRLConditionVariableColumn();
    brlCondition.setChildColumns(Arrays.asList(c, d));
    model.getConditions().addAll(Arrays.asList(pattern, brlCondition));
    decisionTableAnalyzer.insertColumn(b);
}
Also used : BRLConditionColumn(org.drools.workbench.models.guided.dtable.shared.model.BRLConditionColumn) ConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52) BRLConditionVariableColumn(org.drools.workbench.models.guided.dtable.shared.model.BRLConditionVariableColumn) Test(org.junit.Test)

Example 52 with ConditionCol52

use of org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52 in project drools-wb by kiegroup.

the class DecisionTableAnalyzerTest method testInsertBRLVariableColumn.

@Test
public void testInsertBRLVariableColumn() throws Exception {
    ConditionCol52 a = new ConditionCol52();
    ConditionCol52 b = new ConditionCol52();
    pattern.setChildColumns(Arrays.asList(a, b));
    BRLConditionColumn brlCondition = new BRLConditionColumn();
    BRLConditionVariableColumn c = new BRLConditionVariableColumn();
    BRLConditionVariableColumn d = new BRLConditionVariableColumn();
    brlCondition.setChildColumns(Arrays.asList(c, d));
    model.getConditions().addAll(Arrays.asList(pattern, brlCondition));
    decisionTableAnalyzer.insertColumn(d);
    verify(updateManager).newColumn(model, 5);
}
Also used : BRLConditionColumn(org.drools.workbench.models.guided.dtable.shared.model.BRLConditionColumn) ConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52) BRLConditionVariableColumn(org.drools.workbench.models.guided.dtable.shared.model.BRLConditionVariableColumn) Test(org.junit.Test)

Example 53 with ConditionCol52

use of org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52 in project drools-wb by kiegroup.

the class ValidatorTest method testIsConditionValidWhenHeaderIsNotUnique.

@Test
public void testIsConditionValidWhenHeaderIsNotUnique() throws Exception {
    final ConditionCol52 conditionCol1 = fakeConditionCol52("header");
    final ConditionCol52 conditionCol2 = fakeConditionCol52("header");
    final Validator validator = new Validator(fakeCompositeColumn(conditionCol1, conditionCol2));
    assertFalse(validator.isConditionValid(conditionCol2));
}
Also used : ConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52) Test(org.junit.Test)

Example 54 with ConditionCol52

use of org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52 in project drools-wb by kiegroup.

the class ValidatorTest method testIsConditionValidWhenHeaderIsValid.

@Test
public void testIsConditionValidWhenHeaderIsValid() throws Exception {
    final ConditionCol52 conditionCol1 = fakeConditionCol52("header1");
    final ConditionCol52 conditionCol2 = fakeConditionCol52("header2");
    final Validator validator = new Validator(fakeCompositeColumn(conditionCol1, conditionCol2));
    assertTrue(validator.isConditionValid(conditionCol2));
}
Also used : ConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52) Test(org.junit.Test)

Example 55 with ConditionCol52

use of org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52 in project drools-wb by kiegroup.

the class ValidatorTest method testIsConditionHeaderNotBlankWhenHeaderIsValid.

@Test
public void testIsConditionHeaderNotBlankWhenHeaderIsValid() throws Exception {
    final Validator validator = new Validator();
    final ConditionCol52 col52 = fakeConditionCol52("my header");
    assertTrue(validator.isConditionHeaderNotBlank(col52));
}
Also used : ConditionCol52(org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52) Test(org.junit.Test)

Aggregations

ConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52)229 Pattern52 (org.drools.workbench.models.guided.dtable.shared.model.Pattern52)184 Test (org.junit.Test)170 GuidedDecisionTable52 (org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52)74 LimitedEntryConditionCol52 (org.drools.workbench.models.guided.dtable.shared.model.LimitedEntryConditionCol52)59 ActionSetFieldCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52)38 DTCellValue52 (org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52)38 BaseColumn (org.drools.workbench.models.guided.dtable.shared.model.BaseColumn)34 ActionInsertFactCol52 (org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52)31 ArrayList (java.util.ArrayList)27 Path (org.uberfire.backend.vfs.Path)27 StringUiColumn (org.drools.workbench.screens.guided.dtable.client.widget.table.columns.StringUiColumn)25 RawMVELEvaluator (org.kie.soup.project.datamodel.commons.util.RawMVELEvaluator)25 PackageDataModelOracleBaselinePayload (org.kie.workbench.common.services.datamodel.model.PackageDataModelOracleBaselinePayload)25 AsyncPackageDataModelOracle (org.kie.workbench.common.widgets.client.datamodel.AsyncPackageDataModelOracle)25 BaseSingleFieldConstraint (org.drools.workbench.models.datamodel.rule.BaseSingleFieldConstraint)24 IntegerUiColumn (org.drools.workbench.screens.guided.dtable.client.widget.table.columns.IntegerUiColumn)24 DescriptionCol52 (org.drools.workbench.models.guided.dtable.shared.model.DescriptionCol52)23 RowNumberCol52 (org.drools.workbench.models.guided.dtable.shared.model.RowNumberCol52)23 ModelField (org.kie.soup.project.datamodel.oracle.ModelField)23