Search in sources :

Example 1 with PackageDataModelOracleImpl

use of org.kie.soup.project.datamodel.commons.oracle.PackageDataModelOracleImpl in project drools by kiegroup.

the class RuleModelDRLPersistenceExtensionsTest method unmarshalWithExtensions.

@Test
public void unmarshalWithExtensions() {
    RuleModel ruleModel = RuleModelDRLPersistenceImpl.getInstance().unmarshal(DRL_RULE, Collections.emptyList(), new PackageDataModelOracleImpl(), Arrays.asList(new TestIActionPersistenceExtension()));
    assertEquals(1, ruleModel.rhs.length);
    IAction iAction = ruleModel.rhs[0];
    assertTrue(iAction instanceof TestIAction);
}
Also used : TestIActionPersistenceExtension(org.drools.workbench.models.commons.backend.rule.extensions.TestIActionPersistenceExtension) TestIAction(org.drools.workbench.models.commons.backend.rule.actions.TestIAction) IAction(org.drools.workbench.models.datamodel.rule.IAction) TestIAction(org.drools.workbench.models.commons.backend.rule.actions.TestIAction) RuleModel(org.drools.workbench.models.datamodel.rule.RuleModel) PackageDataModelOracleImpl(org.kie.soup.project.datamodel.commons.oracle.PackageDataModelOracleImpl) Test(org.junit.Test)

Example 2 with PackageDataModelOracleImpl

use of org.kie.soup.project.datamodel.commons.oracle.PackageDataModelOracleImpl in project drools by kiegroup.

the class RuleModelDRLPersistenceExtensionsTest method unmarshalDSLWithoutExtensions.

@Test
public void unmarshalDSLWithoutExtensions() {
    RuleModel ruleModel = RuleModelDRLPersistenceImpl.getInstance().unmarshalUsingDSL(DSL_RULE, Collections.emptyList(), new PackageDataModelOracleImpl());
    assertEquals(1, ruleModel.rhs.length);
    IAction iAction = ruleModel.rhs[0];
    assertTrue(iAction instanceof FreeFormLine);
}
Also used : FreeFormLine(org.drools.workbench.models.datamodel.rule.FreeFormLine) TestIAction(org.drools.workbench.models.commons.backend.rule.actions.TestIAction) IAction(org.drools.workbench.models.datamodel.rule.IAction) RuleModel(org.drools.workbench.models.datamodel.rule.RuleModel) PackageDataModelOracleImpl(org.kie.soup.project.datamodel.commons.oracle.PackageDataModelOracleImpl) Test(org.junit.Test)

Example 3 with PackageDataModelOracleImpl

use of org.kie.soup.project.datamodel.commons.oracle.PackageDataModelOracleImpl in project drools by kiegroup.

the class RuleModelDRLPersistenceExtensionsTest method unmarshalWithoutExtensions.

@Test
public void unmarshalWithoutExtensions() {
    RuleModel ruleModel = RuleModelDRLPersistenceImpl.getInstance().unmarshal(DRL_RULE, Collections.emptyList(), new PackageDataModelOracleImpl());
    assertEquals(1, ruleModel.rhs.length);
    IAction iAction = ruleModel.rhs[0];
    assertTrue(iAction instanceof FreeFormLine);
}
Also used : FreeFormLine(org.drools.workbench.models.datamodel.rule.FreeFormLine) TestIAction(org.drools.workbench.models.commons.backend.rule.actions.TestIAction) IAction(org.drools.workbench.models.datamodel.rule.IAction) RuleModel(org.drools.workbench.models.datamodel.rule.RuleModel) PackageDataModelOracleImpl(org.kie.soup.project.datamodel.commons.oracle.PackageDataModelOracleImpl) Test(org.junit.Test)

Example 4 with PackageDataModelOracleImpl

use of org.kie.soup.project.datamodel.commons.oracle.PackageDataModelOracleImpl in project drools by kiegroup.

the class RuleModelDRLPersistenceExtensionsTest method unmarshalDSLWithExtensions.

@Test
public void unmarshalDSLWithExtensions() {
    RuleModel ruleModel = RuleModelDRLPersistenceImpl.getInstance().unmarshalUsingDSL(DSL_RULE, Collections.emptyList(), new PackageDataModelOracleImpl(), Arrays.asList(new TestIActionPersistenceExtension()));
    assertEquals(1, ruleModel.rhs.length);
    IAction iAction = ruleModel.rhs[0];
    assertTrue(iAction instanceof TestIAction);
}
Also used : TestIActionPersistenceExtension(org.drools.workbench.models.commons.backend.rule.extensions.TestIActionPersistenceExtension) TestIAction(org.drools.workbench.models.commons.backend.rule.actions.TestIAction) IAction(org.drools.workbench.models.datamodel.rule.IAction) TestIAction(org.drools.workbench.models.commons.backend.rule.actions.TestIAction) RuleModel(org.drools.workbench.models.datamodel.rule.RuleModel) PackageDataModelOracleImpl(org.kie.soup.project.datamodel.commons.oracle.PackageDataModelOracleImpl) Test(org.junit.Test)

Aggregations

TestIAction (org.drools.workbench.models.commons.backend.rule.actions.TestIAction)4 IAction (org.drools.workbench.models.datamodel.rule.IAction)4 RuleModel (org.drools.workbench.models.datamodel.rule.RuleModel)4 Test (org.junit.Test)4 PackageDataModelOracleImpl (org.kie.soup.project.datamodel.commons.oracle.PackageDataModelOracleImpl)4 TestIActionPersistenceExtension (org.drools.workbench.models.commons.backend.rule.extensions.TestIActionPersistenceExtension)2 FreeFormLine (org.drools.workbench.models.datamodel.rule.FreeFormLine)2