use of org.drools.workbench.services.verifier.api.client.index.Pattern in project drools-wb by kiegroup.
the class PatternInspectorTest method testRedundancy02.
@Test
public void testRedundancy02() throws Exception {
final PatternInspector x = new PatternInspector(new Pattern("x", new ObjectType("org.Address", configurationMock), 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.Pattern 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));
}
use of org.drools.workbench.services.verifier.api.client.index.Pattern in project drools-wb by kiegroup.
the class PatternInspectorTest method testSubsumpt02.
@Test
public void testSubsumpt02() throws Exception {
final PatternInspector x = new PatternInspector(new Pattern("x", new ObjectType("org.Address", configurationMock), configurationMock), mock(RuleInspectorUpdater.class), mock(AnalyzerConfiguration.class));
assertFalse(x.subsumes(b));
assertFalse(b.subsumes(x));
}
use of org.drools.workbench.services.verifier.api.client.index.Pattern in project drools-wb by kiegroup.
the class ConditionBuilder method build.
public Condition build() throws BuildException {
PortablePreconditions.checkNotNull("conditionCol52", conditionCol52);
PortablePreconditions.checkNotNull("columnIndex", columnIndex);
PortablePreconditions.checkNotNull("row", row);
if (conditionCol52 instanceof BRLConditionVariableColumn) {
return builderFactory.getBRLConditionBuilder().with((BRLConditionVariableColumn) conditionCol52).with(row.get(columnIndex)).with(columnIndex).build();
} else {
PortablePreconditions.checkNotNull("rule", rule);
final Pattern pattern = builderFactory.getPatternResolver().with(rule).with(columnIndex).resolve();
return builderFactory.getFieldConditionsBuilder().with(pattern).with(conditionCol52).with(getRealCellValue(conditionCol52, row.get(columnIndex))).with(columnIndex).build();
}
}
use of org.drools.workbench.services.verifier.api.client.index.Pattern in project drools-wb by kiegroup.
the class PatternResolver method resolve.
public Pattern resolve() {
PortablePreconditions.checkNotNull("rule", rule);
final Pattern pattern = rule.getPatterns().where(Pattern.boundName().is(getBoundName())).select().first();
if (pattern == null) {
final Pattern build = new Pattern(getBoundName(), resolveObjectType(getFactType()), configuration);
rule.getPatterns().add(build);
return build;
} else {
return pattern;
}
}
Aggregations