Search in sources :

Example 1 with AnalyzerConfigurationMock

use of org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock in project drools-wb 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.workbench.services.verifier.api.client.index.Pattern) ObjectType(org.drools.workbench.services.verifier.api.client.index.ObjectType) AnalyzerConfigurationMock(org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock) Before(org.junit.Before)

Example 2 with AnalyzerConfigurationMock

use of org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock in project drools-wb by kiegroup.

the class CheckFactoryTest method defaultWhiteList.

@Test
public void defaultWhiteList() throws Exception {
    final AnalyzerConfigurationMock configuration = new AnalyzerConfigurationMock(CheckConfiguration.newDefault());
    assertFalse(new CheckFactory(configuration).makeSingleChecks(mock(RuleInspector.class)).isEmpty());
    assertTrue(new CheckFactory(configuration).makePairRowCheck(mock(RuleInspector.class), mock(RuleInspector.class)).isPresent());
}
Also used : AnalyzerConfigurationMock(org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock) RuleInspector(org.drools.workbench.services.verifier.core.cache.inspectors.RuleInspector) Test(org.junit.Test)

Example 3 with AnalyzerConfigurationMock

use of org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock in project drools-wb 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.workbench.services.verifier.api.client.index.ObjectField) Field(org.drools.workbench.services.verifier.api.client.index.Field) AnalyzerConfigurationMock(org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock) Before(org.junit.Before)

Example 4 with AnalyzerConfigurationMock

use of org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock in project drools-wb 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()), DataType.DataTypes.NUMERIC_INTEGER, 20);
    ActionInspector b = createSetActionInspector(new Field(mock(ObjectField.class), "Person", "Integer", "age", new AnalyzerConfigurationMock()), DataType.DataTypes.STRING, "20");
    assertTrue(a.isRedundant(b));
    assertTrue(b.isRedundant(a));
}
Also used : ObjectField(org.drools.workbench.services.verifier.api.client.index.ObjectField) Field(org.drools.workbench.services.verifier.api.client.index.Field) AnalyzerConfigurationMock(org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock) Test(org.junit.Test)

Example 5 with AnalyzerConfigurationMock

use of org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock in project drools-wb 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()), DataType.DataTypes.STRING, "Toni");
    ActionInspector b = createSetActionInspector(new Field(mock(ObjectField.class), "Person", "String", "name", new AnalyzerConfigurationMock()), DataType.DataTypes.STRING, "Toni");
    assertTrue(a.isRedundant(b));
    assertTrue(b.isRedundant(a));
}
Also used : ObjectField(org.drools.workbench.services.verifier.api.client.index.ObjectField) Field(org.drools.workbench.services.verifier.api.client.index.Field) AnalyzerConfigurationMock(org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock) Test(org.junit.Test)

Aggregations

AnalyzerConfigurationMock (org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock)21 Field (org.drools.workbench.services.verifier.api.client.index.Field)17 ObjectField (org.drools.workbench.services.verifier.api.client.index.ObjectField)17 Test (org.junit.Test)16 Before (org.junit.Before)5 Date (java.util.Date)2 RuleInspector (org.drools.workbench.services.verifier.core.cache.inspectors.RuleInspector)2 AnalyzerConfiguration (org.drools.workbench.services.verifier.api.client.configuration.AnalyzerConfiguration)1 FieldAction (org.drools.workbench.services.verifier.api.client.index.FieldAction)1 Index (org.drools.workbench.services.verifier.api.client.index.Index)1 IndexImpl (org.drools.workbench.services.verifier.api.client.index.IndexImpl)1 ObjectType (org.drools.workbench.services.verifier.api.client.index.ObjectType)1 Pattern (org.drools.workbench.services.verifier.api.client.index.Pattern)1 Rule (org.drools.workbench.services.verifier.api.client.index.Rule)1 Values (org.drools.workbench.services.verifier.api.client.index.keys.Values)1 RuleInspectorCache (org.drools.workbench.services.verifier.core.cache.RuleInspectorCache)1