use of org.drools.workbench.services.verifier.api.client.index.Field 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));
}
use of org.drools.workbench.services.verifier.api.client.index.Field 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));
}
use of org.drools.workbench.services.verifier.api.client.index.Field in project drools-wb by kiegroup.
the class FieldConditionBuilder method build.
public Condition build() throws BuildException {
PortablePreconditions.checkNotNull("conditionCol52", conditionCol52);
PortablePreconditions.checkNotNull("columnIndex", columnIndex);
try {
final Field field = resolveField();
final Condition condition = buildCondition(field);
field.getConditions().add(condition);
return condition;
} catch (final BuildException buildException) {
throw buildException;
} catch (final Exception e) {
throw new BuildException("Failed to build " + pattern.getName() + " # " + ToString.toString(conditionCol52));
}
}
use of org.drools.workbench.services.verifier.api.client.index.Field in project drools-wb by kiegroup.
the class FieldInspectorRelationsTest method testRedundancy02.
@Test
public void testRedundancy02() throws Exception {
final FieldInspector x = new FieldInspector(new Field(mock(ObjectField.class), "org.Address", "String", "name", configurationMock), mock(RuleInspectorUpdater.class), mock(AnalyzerConfiguration.class));
assertFalse(x.isRedundant(b));
assertFalse(b.isRedundant(x));
}
use of org.drools.workbench.services.verifier.api.client.index.Field 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));
}
Aggregations