Search in sources :

Example 1 with ObjectType

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;
    }
}
Also used : ObjectType(org.drools.workbench.services.verifier.api.client.index.ObjectType)

Example 2 with ObjectType

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));
}
Also used : Pattern(org.drools.workbench.services.verifier.api.client.index.Pattern) ObjectType(org.drools.workbench.services.verifier.api.client.index.ObjectType) AnalyzerConfiguration(org.drools.workbench.services.verifier.api.client.configuration.AnalyzerConfiguration) Test(org.junit.Test)

Example 3 with ObjectType

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));
}
Also used : Pattern(org.drools.workbench.services.verifier.api.client.index.Pattern) ObjectType(org.drools.workbench.services.verifier.api.client.index.ObjectType) AnalyzerConfigurationMock(org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock) Before(org.junit.Before)

Example 4 with ObjectType

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));
}
Also used : Pattern(org.drools.workbench.services.verifier.api.client.index.Pattern) ObjectType(org.drools.workbench.services.verifier.api.client.index.ObjectType) AnalyzerConfiguration(org.drools.workbench.services.verifier.api.client.configuration.AnalyzerConfiguration) Test(org.junit.Test)

Example 5 with ObjectType

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);
}
Also used : ObjectType(org.drools.workbench.services.verifier.api.client.index.ObjectType) Column(org.drools.workbench.services.verifier.api.client.index.Column) AnalyzerConfigurationMock(org.drools.workbench.services.verifier.api.client.AnalyzerConfigurationMock) Columns(org.drools.workbench.services.verifier.api.client.index.Columns) ObjectTypes(org.drools.workbench.services.verifier.api.client.index.ObjectTypes) Rule(org.drools.workbench.services.verifier.api.client.index.Rule) Rules(org.drools.workbench.services.verifier.api.client.index.Rules) Before(org.junit.Before)

Aggregations

ObjectType (org.drools.workbench.services.verifier.api.client.index.ObjectType)6 Pattern (org.drools.workbench.services.verifier.api.client.index.Pattern)3 Test (org.junit.Test)3 AnalyzerConfiguration (org.drools.workbench.services.verifier.api.client.configuration.AnalyzerConfiguration)2 Before (org.junit.Before)2 AnalyzerConfigurationMock (org.drools.workbench.services.verifier.api.client.AnalyzerConfigurationMock)1 Column (org.drools.workbench.services.verifier.api.client.index.Column)1 Columns (org.drools.workbench.services.verifier.api.client.index.Columns)1 ObjectTypes (org.drools.workbench.services.verifier.api.client.index.ObjectTypes)1 Rule (org.drools.workbench.services.verifier.api.client.index.Rule)1 Rules (org.drools.workbench.services.verifier.api.client.index.Rules)1 AnalyzerConfigurationMock (org.drools.workbench.services.verifier.core.checks.AnalyzerConfigurationMock)1