Search in sources :

Example 6 with AnalyzerConfigurationMock

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

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

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

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

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

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