use of org.drools.verifier.core.AnalyzerConfigurationMock in project drools by kiegroup.
the class CheckRunManagerTest method setUp.
@Before
public void setUp() throws Exception {
configuration = new AnalyzerConfigurationMock();
checkStorage = new CheckStorage(new CheckFactory(configuration) {
@Override
public HashSet<Check> makeSingleChecks(final RuleInspector ruleInspector) {
final HashSet<Check> result = new HashSet<>();
result.add(new MockSingleCheck(ruleInspector));
return result;
}
});
ruleInspectors = new ArrayList<>();
when(cache.all()).thenReturn(ruleInspectors);
ruleInspector1 = mockRowInspector(1);
ruleInspectors.add(ruleInspector1);
ruleInspector2 = mockRowInspector(2);
ruleInspectors.add(ruleInspector2);
ruleInspector3 = mockRowInspector(3);
ruleInspectors.add(ruleInspector3);
checkRunManager.addChecks(ruleInspector1.getChecks());
checkRunManager.addChecks(ruleInspector2.getChecks());
checkRunManager.addChecks(ruleInspector3.getChecks());
}
use of org.drools.verifier.core.AnalyzerConfigurationMock in project drools by kiegroup.
the class CheckFactoryTest method emptyWhiteList.
@Test
public void emptyWhiteList() throws Exception {
final AnalyzerConfigurationMock configuration = new AnalyzerConfigurationMock(CheckConfiguration.newEmpty());
assertTrue(new CheckFactory(configuration).makeSingleChecks(mock(RuleInspector.class)).isEmpty());
assertFalse(new CheckFactory(configuration).makePairRowCheck(mock(RuleInspector.class), mock(RuleInspector.class)).isPresent());
}
use of org.drools.verifier.core.AnalyzerConfigurationMock in project drools by kiegroup.
the class ConditionsInspectorTest method setUp.
@Before
public void setUp() throws Exception {
configurationMock = new AnalyzerConfigurationMock();
field = new Field(new ObjectField("Person", "Integer", "age", configurationMock), "Person", "Integer", "age", configurationMock);
}
use of org.drools.verifier.core.AnalyzerConfigurationMock in project drools by kiegroup.
the class ActionInspectorConflictResolverTest method testRedundancy006.
@Test
public void testRedundancy006() 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()), "20");
assertTrue(a.isRedundant(b));
assertTrue(b.isRedundant(a));
}
use of org.drools.verifier.core.AnalyzerConfigurationMock in project drools by kiegroup.
the class ActionInspectorConflictResolverTest method testRedundancy008.
@Test
public void testRedundancy008() throws Exception {
Date date = new Date();
ActionInspector a = createSetActionInspector(new Field(mock(ObjectField.class), "Person", "Integer", "birthDay", new AnalyzerConfigurationMock()), date);
ActionInspector b = createSetActionInspector(new Field(mock(ObjectField.class), "Person", "Integer", "birthDay", new AnalyzerConfigurationMock()), format(date));
assertTrue(a.isRedundant(b));
assertTrue(b.isRedundant(a));
}
Aggregations