Search in sources :

Example 1 with ConditionsInspectorMultiMap

use of org.drools.workbench.services.verifier.core.cache.inspectors.condition.ConditionsInspectorMultiMap in project drools-wb by kiegroup.

the class RuleInspectorDumper method dumpConditions.

private void dumpConditions() {
    dump.append("Conditions{\n");
    for (final ConditionsInspectorMultiMap conditionsInspectorMultiMap : ruleInspector.getConditionsInspectors()) {
        dumpCondition(conditionsInspectorMultiMap);
    }
    for (final ConditionInspector conditionInspector : ruleInspector.getBrlConditionsInspectors()) {
        dump.append(conditionInspector.toHumanReadableString());
    }
    dump.append("}\n");
}
Also used : ConditionsInspectorMultiMap(org.drools.workbench.services.verifier.core.cache.inspectors.condition.ConditionsInspectorMultiMap) ConditionInspector(org.drools.workbench.services.verifier.core.cache.inspectors.condition.ConditionInspector)

Example 2 with ConditionsInspectorMultiMap

use of org.drools.workbench.services.verifier.core.cache.inspectors.condition.ConditionsInspectorMultiMap in project drools-wb by kiegroup.

the class ConditionsInspectorTest method testSubsume001.

@Test
public void testSubsume001() throws Exception {
    final ConditionsInspectorMultiMap a = getConditions(new ComparableConditionInspector<Integer>(new FieldCondition(field, mock(Column.class), "==", new Values<>(1), configurationMock), configurationMock));
    final ConditionsInspectorMultiMap b = getConditions(new ComparableConditionInspector<Integer>(new FieldCondition(field, mock(Column.class), "==", new Values<>(1), configurationMock), configurationMock));
    assertTrue(a.subsumes(b));
    assertTrue(b.subsumes(a));
}
Also used : FieldCondition(org.drools.workbench.services.verifier.api.client.index.FieldCondition) ConditionsInspectorMultiMap(org.drools.workbench.services.verifier.core.cache.inspectors.condition.ConditionsInspectorMultiMap) Column(org.drools.workbench.services.verifier.api.client.index.Column) Test(org.junit.Test)

Example 3 with ConditionsInspectorMultiMap

use of org.drools.workbench.services.verifier.core.cache.inspectors.condition.ConditionsInspectorMultiMap in project drools-wb by kiegroup.

the class ConditionsInspectorTest method testSubsume003.

@Test
public void testSubsume003() throws Exception {
    final Field nameField = new Field(new ObjectField("Person", "String", "name", configurationMock), "Person", "String", "name", configurationMock);
    final Field lastNameField = new Field(new ObjectField("Person", "String", "lastName", configurationMock), "Person", "String", "lastName", configurationMock);
    final ConditionsInspectorMultiMap a = getConditions(new ComparableConditionInspector<String>(new FieldCondition(nameField, mock(Column.class), "==", new Values<>("Toni"), configurationMock), configurationMock));
    final ConditionsInspectorMultiMap b = getConditions(new ComparableConditionInspector<Integer>(new FieldCondition(field, mock(Column.class), "==", new Values<>(12), configurationMock), configurationMock), new ComparableConditionInspector<String>(new FieldCondition(nameField, mock(Column.class), "==", new Values<>("Toni"), configurationMock), configurationMock), new ComparableConditionInspector<String>(new FieldCondition(lastNameField, mock(Column.class), "==", new Values<>("Rikkola"), configurationMock), configurationMock));
    assertFalse(a.subsumes(b));
    assertTrue(b.subsumes(a));
}
Also used : ObjectField(org.drools.workbench.services.verifier.api.client.index.ObjectField) Field(org.drools.workbench.services.verifier.api.client.index.Field) FieldCondition(org.drools.workbench.services.verifier.api.client.index.FieldCondition) ConditionsInspectorMultiMap(org.drools.workbench.services.verifier.core.cache.inspectors.condition.ConditionsInspectorMultiMap) Column(org.drools.workbench.services.verifier.api.client.index.Column) ObjectField(org.drools.workbench.services.verifier.api.client.index.ObjectField) Test(org.junit.Test)

Example 4 with ConditionsInspectorMultiMap

use of org.drools.workbench.services.verifier.core.cache.inspectors.condition.ConditionsInspectorMultiMap in project drools-wb by kiegroup.

the class ConditionsInspectorTest method testSubsume002.

@Test
public void testSubsume002() throws Exception {
    final ConditionsInspectorMultiMap a = getConditions(new ComparableConditionInspector<Integer>(new FieldCondition(field, mock(Column.class), "==", new Values<>(1), configurationMock), configurationMock));
    final ConditionsInspectorMultiMap b = getConditions(new ComparableConditionInspector<Integer>(new FieldCondition(field, mock(Column.class), "==", new Values<>(1), configurationMock), configurationMock), new ComparableConditionInspector<Integer>(new FieldCondition(new Field(mock(ObjectField.class), "Person", "Integer", "balance", configurationMock), mock(Column.class), "==", new Values<>(111111111), configurationMock), configurationMock));
    assertFalse(a.subsumes(b));
    assertTrue(b.subsumes(a));
}
Also used : FieldCondition(org.drools.workbench.services.verifier.api.client.index.FieldCondition) ObjectField(org.drools.workbench.services.verifier.api.client.index.ObjectField) Field(org.drools.workbench.services.verifier.api.client.index.Field) ConditionsInspectorMultiMap(org.drools.workbench.services.verifier.core.cache.inspectors.condition.ConditionsInspectorMultiMap) Column(org.drools.workbench.services.verifier.api.client.index.Column) Test(org.junit.Test)

Aggregations

ConditionsInspectorMultiMap (org.drools.workbench.services.verifier.core.cache.inspectors.condition.ConditionsInspectorMultiMap)4 Column (org.drools.workbench.services.verifier.api.client.index.Column)3 FieldCondition (org.drools.workbench.services.verifier.api.client.index.FieldCondition)3 Test (org.junit.Test)3 Field (org.drools.workbench.services.verifier.api.client.index.Field)2 ObjectField (org.drools.workbench.services.verifier.api.client.index.ObjectField)2 ConditionInspector (org.drools.workbench.services.verifier.core.cache.inspectors.condition.ConditionInspector)1