use of org.drools.workbench.services.verifier.api.client.index.ObjectType in project drools-wb by kiegroup.
the class PatternResolver method resolveObjectType.
private ObjectType resolveObjectType(final String factType) {
final ObjectType first = index.getObjectTypes().where(ObjectType.type().is(factType)).select().first();
if (first == null) {
final ObjectType objectType = new ObjectType(factType, configuration);
index.getObjectTypes().add(objectType);
return objectType;
} else {
return first;
}
}
use of org.drools.workbench.services.verifier.api.client.index.ObjectType 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.ObjectType 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.ObjectType 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.ObjectType in project drools-wb by kiegroup.
the class QueryableIndexTest method setUp.
@Before
public void setUp() throws Exception {
configuration = new AnalyzerConfigurationMock();
final Rules rules = new Rules();
rules.add(new Rule(0, configuration));
rules.add(new Rule(1, configuration));
rules.add(new Rule(2, configuration));
final Columns columns = new Columns();
firstColumn = new Column(0, configuration);
columns.add(firstColumn);
columns.add(new Column(1, configuration));
final ObjectTypes objectTypes = new ObjectTypes();
objectTypes.add(new ObjectType("Person", configuration));
objectTypes.add(new ObjectType("Address", configuration));
queryableIndex = new QueryableIndex(rules, columns, objectTypes);
}
Aggregations