Search in sources :

Example 16 with AnalyzerConfigurationMock

use of org.drools.verifier.core.AnalyzerConfigurationMock in project drools by kiegroup.

the class ActionInspectorConflictResolverTest method testRedundancy005.

@Test
public void testRedundancy005() throws Exception {
    ActionInspector a = createSetActionInspector(new Field(mock(ObjectField.class), "Person", "Boolean", "isOldEnough", new AnalyzerConfigurationMock()), true);
    ActionInspector b = createSetActionInspector(new Field(mock(ObjectField.class), "Person", "Boolean", "isOldEnough", new AnalyzerConfigurationMock()), "false");
    assertFalse(a.isRedundant(b));
    assertFalse(b.isRedundant(a));
}
Also used : ObjectField(org.drools.verifier.core.index.model.ObjectField) Field(org.drools.verifier.core.index.model.Field) AnalyzerConfigurationMock(org.drools.verifier.core.AnalyzerConfigurationMock) Test(org.junit.Test)

Example 17 with AnalyzerConfigurationMock

use of org.drools.verifier.core.AnalyzerConfigurationMock in project drools by kiegroup.

the class ActionInspectorConflictResolverTest method testRedundancy007.

@Test
public void testRedundancy007() throws Exception {
    ActionInspector a = createSetActionInspector(new Field(mock(ObjectField.class), "Person", "Integer", "age", new AnalyzerConfigurationMock()), 20);
    ActionInspector b = createSetActionInspector(new Field(mock(ObjectField.class), "Person", "Integer", "age", new AnalyzerConfigurationMock()), "10");
    assertFalse(a.isRedundant(b));
    assertFalse(b.isRedundant(a));
}
Also used : ObjectField(org.drools.verifier.core.index.model.ObjectField) Field(org.drools.verifier.core.index.model.Field) AnalyzerConfigurationMock(org.drools.verifier.core.AnalyzerConfigurationMock) Test(org.junit.Test)

Example 18 with AnalyzerConfigurationMock

use of org.drools.verifier.core.AnalyzerConfigurationMock in project drools by kiegroup.

the class ActionInspectorConflictResolverTest method testRedundancy009.

@Test
public void testRedundancy009() throws Exception {
    Date value = new Date();
    ActionInspector a = createSetActionInspector(new Field(mock(ObjectField.class), "Person", "Integer", "birthDay", new AnalyzerConfigurationMock()), value);
    ActionInspector b = createSetActionInspector(new Field(mock(ObjectField.class), "Person", "Integer", "birthDay", new AnalyzerConfigurationMock()), "29-Dec-1981");
    assertFalse(a.isRedundant(b));
    assertFalse(b.isRedundant(a));
}
Also used : ObjectField(org.drools.verifier.core.index.model.ObjectField) Field(org.drools.verifier.core.index.model.Field) AnalyzerConfigurationMock(org.drools.verifier.core.AnalyzerConfigurationMock) Date(java.util.Date) Test(org.junit.Test)

Example 19 with AnalyzerConfigurationMock

use of org.drools.verifier.core.AnalyzerConfigurationMock in project drools by kiegroup.

the class ActionInspectorConflictResolverTest method testNoConflict003.

@Test
public void testNoConflict003() throws Exception {
    ActionInspector a = createSetActionInspector(new FieldAction(new Field(mock(ObjectField.class), "Person", "String", "name", new AnalyzerConfigurationMock()), mock(Column.class), new Values(true), new AnalyzerConfigurationMock()));
    ActionInspector b = createSetActionInspector(new FieldAction(new Field(mock(ObjectField.class), "Person", "String", "name", new AnalyzerConfigurationMock()), mock(Column.class), new Values(true), new AnalyzerConfigurationMock()));
    assertFalse(a.conflicts(b));
    assertFalse(b.conflicts(a));
}
Also used : ObjectField(org.drools.verifier.core.index.model.ObjectField) Field(org.drools.verifier.core.index.model.Field) AnalyzerConfigurationMock(org.drools.verifier.core.AnalyzerConfigurationMock) ObjectField(org.drools.verifier.core.index.model.ObjectField) Values(org.drools.verifier.core.index.keys.Values) FieldAction(org.drools.verifier.core.index.model.FieldAction) Test(org.junit.Test)

Example 20 with AnalyzerConfigurationMock

use of org.drools.verifier.core.AnalyzerConfigurationMock in project drools by kiegroup.

the class ActionInspectorConflictResolverTest method testRedundancy001.

@Test
public void testRedundancy001() throws Exception {
    ActionInspector a = createSetActionInspector(new Field(mock(ObjectField.class), "Person", "String", "name", new AnalyzerConfigurationMock()), "Toni");
    ActionInspector b = createSetActionInspector(new Field(mock(ObjectField.class), "Person", "String", "name", new AnalyzerConfigurationMock()), "Toni");
    assertTrue(a.isRedundant(b));
    assertTrue(b.isRedundant(a));
}
Also used : ObjectField(org.drools.verifier.core.index.model.ObjectField) Field(org.drools.verifier.core.index.model.Field) AnalyzerConfigurationMock(org.drools.verifier.core.AnalyzerConfigurationMock) Test(org.junit.Test)

Aggregations

AnalyzerConfigurationMock (org.drools.verifier.core.AnalyzerConfigurationMock)29 Field (org.drools.verifier.core.index.model.Field)17 ObjectField (org.drools.verifier.core.index.model.ObjectField)17 Test (org.junit.Test)16 Before (org.junit.Before)13 RuleInspector (org.drools.verifier.core.cache.inspectors.RuleInspector)3 Date (java.util.Date)2 ObjectType (org.drools.verifier.core.index.model.ObjectType)2 InspectorList (org.drools.verifier.core.maps.InspectorList)2 HashSet (java.util.HashSet)1 Check (org.drools.verifier.core.checks.base.Check)1 CheckFactory (org.drools.verifier.core.checks.base.CheckFactory)1 CheckStorage (org.drools.verifier.core.checks.base.CheckStorage)1 SingleCheck (org.drools.verifier.core.checks.base.SingleCheck)1 Values (org.drools.verifier.core.index.keys.Values)1 Column (org.drools.verifier.core.index.model.Column)1 Columns (org.drools.verifier.core.index.model.Columns)1 Conditions (org.drools.verifier.core.index.model.Conditions)1 FieldAction (org.drools.verifier.core.index.model.FieldAction)1 ObjectTypes (org.drools.verifier.core.index.model.ObjectTypes)1