Search in sources :

Example 1 with RuntimeTypeCheckOption

use of org.kie.dmn.core.compiler.RuntimeTypeCheckOption in project drools by kiegroup.

the class DMNRuntimeTypeCheckTest method testAskTypeCheckInKModuleButOverrideRuntime.

@Test
public void testAskTypeCheckInKModuleButOverrideRuntime() {
    DMNRuntime runtime = getRuntimeWithTypeCheckOption("true", ks.getResources().newClassPathResource("forTypeCheckTest.dmn", this.getClass()));
    ((DMNRuntimeImpl) runtime).setOption(new RuntimeTypeCheckOption(false));
    assertPerformTypeCheck(runtime);
}
Also used : DMNRuntimeImpl(org.kie.dmn.core.impl.DMNRuntimeImpl) RuntimeTypeCheckOption(org.kie.dmn.core.compiler.RuntimeTypeCheckOption) DMNRuntime(org.kie.dmn.api.core.DMNRuntime) Test(org.junit.Test)

Example 2 with RuntimeTypeCheckOption

use of org.kie.dmn.core.compiler.RuntimeTypeCheckOption in project drools by kiegroup.

the class DMNRuntimeTypeCheckTest method testExplicitDisableTypeCheckInKModuleButOverrideRuntime.

@Test
public void testExplicitDisableTypeCheckInKModuleButOverrideRuntime() {
    DMNRuntime runtime = getRuntimeWithTypeCheckOption("false", ks.getResources().newClassPathResource("forTypeCheckTest.dmn", this.getClass()));
    ((DMNRuntimeImpl) runtime).setOption(new RuntimeTypeCheckOption(true));
    assertPerformTypeCheck(runtime);
}
Also used : DMNRuntimeImpl(org.kie.dmn.core.impl.DMNRuntimeImpl) RuntimeTypeCheckOption(org.kie.dmn.core.compiler.RuntimeTypeCheckOption) DMNRuntime(org.kie.dmn.api.core.DMNRuntime) Test(org.junit.Test)

Example 3 with RuntimeTypeCheckOption

use of org.kie.dmn.core.compiler.RuntimeTypeCheckOption in project drools by kiegroup.

the class DMNRuntimeTypeCheckTest method testDefaultNoTypeCheckButOverrideRuntime.

@Test
public void testDefaultNoTypeCheckButOverrideRuntime() {
    // do NOT use the DMNRuntimeUtil as that enables typeSafe check override for runtime.
    final KieContainer kieContainer = KieHelper.getKieContainer(ks.newReleaseId("org.kie", "dmn-test-" + UUID.randomUUID(), "1.0"), ks.getResources().newClassPathResource("forTypeCheckTest.dmn", this.getClass()));
    DMNRuntime runtime = kieContainer.newKieSession().getKieRuntime(DMNRuntime.class);
    ((DMNRuntimeImpl) runtime).setOption(new RuntimeTypeCheckOption(true));
    assertPerformTypeCheck(runtime);
}
Also used : DMNRuntimeImpl(org.kie.dmn.core.impl.DMNRuntimeImpl) RuntimeTypeCheckOption(org.kie.dmn.core.compiler.RuntimeTypeCheckOption) DMNRuntime(org.kie.dmn.api.core.DMNRuntime) KieContainer(org.kie.api.runtime.KieContainer) Test(org.junit.Test)

Example 4 with RuntimeTypeCheckOption

use of org.kie.dmn.core.compiler.RuntimeTypeCheckOption in project drools by kiegroup.

the class DMNRuntimeUtil method typeSafeGetKieRuntime.

private static DMNRuntime typeSafeGetKieRuntime(final KieContainer kieContainer) {
    DMNRuntime dmnRuntime = kieContainer.newKieSession().getKieRuntime(DMNRuntime.class);
    ((DMNRuntimeImpl) dmnRuntime).setOption(new RuntimeTypeCheckOption(true));
    return dmnRuntime;
}
Also used : DMNRuntimeImpl(org.kie.dmn.core.impl.DMNRuntimeImpl) RuntimeTypeCheckOption(org.kie.dmn.core.compiler.RuntimeTypeCheckOption) DMNRuntime(org.kie.dmn.api.core.DMNRuntime)

Aggregations

DMNRuntime (org.kie.dmn.api.core.DMNRuntime)4 RuntimeTypeCheckOption (org.kie.dmn.core.compiler.RuntimeTypeCheckOption)4 DMNRuntimeImpl (org.kie.dmn.core.impl.DMNRuntimeImpl)4 Test (org.junit.Test)3 KieContainer (org.kie.api.runtime.KieContainer)1