Search in sources :

Example 6 with AnalyzerConfigurationMock

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

the class ActionInspectorConflictResolverTest method testRedundancy002.

@Test
public void testRedundancy002() 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");
    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 7 with AnalyzerConfigurationMock

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

the class ActionInspectorConflictResolverTest method testConflict002.

@Test
public void testConflict002() 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");
    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 8 with AnalyzerConfigurationMock

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

the class PatternInspectorTest method setUp.

@Before
public void setUp() throws Exception {
    configurationMock = new AnalyzerConfigurationMock();
    a = new PatternInspector(new Pattern("a", new ObjectType("org.Person", configurationMock), configurationMock), mock(RuleInspectorUpdater.class), mock(AnalyzerConfiguration.class));
    b = new PatternInspector(new Pattern("b", new ObjectType("org.Person", configurationMock), configurationMock), mock(RuleInspectorUpdater.class), mock(AnalyzerConfiguration.class));
}
Also used : Pattern(org.drools.verifier.core.index.model.Pattern) ObjectType(org.drools.verifier.core.index.model.ObjectType) AnalyzerConfigurationMock(org.drools.verifier.core.AnalyzerConfigurationMock) Before(org.junit.Before)

Example 9 with AnalyzerConfigurationMock

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

the class RelationResolverConflictsTest method setUp.

@Before
public void setUp() throws Exception {
    configuration = new AnalyzerConfigurationMock();
    a = new InspectorList(configuration);
    b = new InspectorList(configuration);
    firstItemInA = spy(new Person(10));
    isConflicting = spy(new Person(15));
    a.add(firstItemInA);
    a.add(isConflicting);
    b.add(new Person(10));
    relationResolver = new RelationResolver(a, true);
}
Also used : AnalyzerConfigurationMock(org.drools.verifier.core.AnalyzerConfigurationMock) InspectorList(org.drools.verifier.core.maps.InspectorList) Before(org.junit.Before)

Example 10 with AnalyzerConfigurationMock

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

the class FieldInspectorUpdateTest method setUp.

@Before
public void setUp() throws Exception {
    configurationMock = new AnalyzerConfigurationMock();
    final Field field = spy(new Field(objectField, "org.Person", "String", "name", configurationMock));
    fieldCondition = makeCondition(field);
    fieldAction = makeAction(field);
    new FieldInspector(field, ruleInspectorUpdater, new AnalyzerConfigurationMock());
}
Also used : ObjectField(org.drools.verifier.core.index.model.ObjectField) Field(org.drools.verifier.core.index.model.Field) AnalyzerConfigurationMock(org.drools.verifier.core.AnalyzerConfigurationMock) Before(org.junit.Before)

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