Search in sources :

Example 11 with AnalyzerConfigurationMock

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

the class ActionInspectorConflictResolverTest method testNoConflict001.

@Test
public void testNoConflict001() throws Exception {
    ActionInspector a = createSetActionInspector(new Field(mock(ObjectField.class), "Person", "String", "name", new AnalyzerConfigurationMock()), "Toni");
    ActionInspector b = createSetActionInspector(new Field(mock(ObjectField.class), "Address", "String", "street", new AnalyzerConfigurationMock()), "Rambo");
    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) Test(org.junit.Test)

Example 12 with AnalyzerConfigurationMock

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

the class ActionInspectorConflictResolverTest method testNoConflict002.

@Test
public void testNoConflict002() 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");
    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) Test(org.junit.Test)

Example 13 with AnalyzerConfigurationMock

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

the class ActionInspectorConflictResolverTest method testRedundancy004.

@Test
public void testRedundancy004() 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()), "true");
    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)

Example 14 with AnalyzerConfigurationMock

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

the class ActionInspectorConflictResolverTest method testConflict001.

@Test
public void testConflict001() 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()), "Rambo");
    assertTrue(a.conflicts(b));
    assertTrue(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) Test(org.junit.Test)

Example 15 with AnalyzerConfigurationMock

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

the class ActionInspectorConflictResolverTest method testRedundancy003.

@Test
public void testRedundancy003() throws Exception {
    ActionInspector a = createSetActionInspector(new Field(mock(ObjectField.class), "org.test1.Person", "String", "name", new AnalyzerConfigurationMock()), "Toni");
    ActionInspector b = createSetActionInspector(new Field(mock(ObjectField.class), "org.test2.Person", "String", "name", new AnalyzerConfigurationMock()), "Toni");
    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)

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