Search in sources :

Example 16 with AnalyzerConfigurationMock

use of org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock in project drools-wb 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()), DataType.DataTypes.BOOLEAN, true);
    ActionInspector b = createSetActionInspector(new Field(mock(ObjectField.class), "Person", "Boolean", "isOldEnough", new AnalyzerConfigurationMock()), DataType.DataTypes.STRING, "false");
    assertTrue(a.conflicts(b));
    assertTrue(b.conflicts(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 17 with AnalyzerConfigurationMock

use of org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock in project drools-wb 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()), DataType.DataTypes.STRING, "Toni");
    ActionInspector b = createSetActionInspector(new Field(mock(ObjectField.class), "Person", "String", "name", new AnalyzerConfigurationMock()), DataType.DataTypes.STRING, "Rambo");
    assertTrue(a.conflicts(b));
    assertTrue(b.conflicts(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 18 with AnalyzerConfigurationMock

use of org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock in project drools-wb 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()), DataType.DataTypes.BOOLEAN, true);
    ActionInspector b = createSetActionInspector(new Field(mock(ObjectField.class), "Person", "Boolean", "isOldEnough", new AnalyzerConfigurationMock()), DataType.DataTypes.STRING, "false");
    assertFalse(a.isRedundant(b));
    assertFalse(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 19 with AnalyzerConfigurationMock

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

the class RuleInspectorCacheTest method setUp.

@Before
public void setUp() throws Exception {
    final Index index = new IndexImpl();
    final AnalyzerConfiguration configuration = new AnalyzerConfigurationMock();
    cache = new RuleInspectorCache(index, configuration);
    cache.addRule(new Rule(0, configuration));
    cache.addRule(new Rule(1, configuration));
    cache.addRule(new Rule(2, configuration));
    cache.addRule(new Rule(3, configuration));
    cache.addRule(new Rule(4, configuration));
    cache.addRule(new Rule(5, configuration));
    cache.addRule(new Rule(6, configuration));
}
Also used : AnalyzerConfigurationMock(org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock) RuleInspectorCache(org.drools.workbench.services.verifier.core.cache.RuleInspectorCache) IndexImpl(org.drools.workbench.services.verifier.api.client.index.IndexImpl) Index(org.drools.workbench.services.verifier.api.client.index.Index) Rule(org.drools.workbench.services.verifier.api.client.index.Rule) AnalyzerConfiguration(org.drools.workbench.services.verifier.api.client.configuration.AnalyzerConfiguration) Before(org.junit.Before)

Example 20 with AnalyzerConfigurationMock

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

the class FieldInspectorRelationsTest method setUp.

@Before
public void setUp() throws Exception {
    configurationMock = new AnalyzerConfigurationMock();
    ObjectField objectField = mock(ObjectField.class);
    a = new FieldInspector(new Field(objectField, "org.Person", "String", "name", configurationMock), mock(RuleInspectorUpdater.class), mock(AnalyzerConfiguration.class));
    b = new FieldInspector(new Field(objectField, "org.Person", "String", "name", configurationMock), mock(RuleInspectorUpdater.class), mock(AnalyzerConfiguration.class));
}
Also used : Field(org.drools.workbench.services.verifier.api.client.index.Field) ObjectField(org.drools.workbench.services.verifier.api.client.index.ObjectField) AnalyzerConfigurationMock(org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock) ObjectField(org.drools.workbench.services.verifier.api.client.index.ObjectField) Before(org.junit.Before)

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