Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-5821

executable-model test failure in test-compiler-integration FunctionsTest

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 7.53.0.Final
    • 7.46.0.Final
    • executable model
    • None
    • 2021 Week 13-15 (from Mar 29)
    • 1
    • Undefined
    • NEW
    • NEW
    • ---
    • ---

    Description

      FunctionsTest.testFunctionException() failed with a subtle difference of Exception wrapping between standard-drl and exec-model.

      standard-drl

      Exception executing consequence for rule "Throw Function Exception" in org.drools.compiler.test: java.lang.Exception: this should throw an exception
      	at org.drools.core.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
      	at org.drools.core.common.DefaultAgenda.handleException(DefaultAgenda.java:1306)
      	at org.drools.core.phreak.RuleExecutor.innerFireActivation(RuleExecutor.java:455)
      	at org.drools.core.phreak.RuleExecutor.fireActivation(RuleExecutor.java:395)
      	at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:151)
      	at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:103)
      ...
      Caused by: java.lang.Exception: this should throw an exception
      	at org.drools.compiler.test.ThrowException.throwException(ThrowException.java:15)
      	at org.drools.compiler.test.Rule_Throw_Function_Exception2118143865.defaultConsequence(Rule_Throw_Function_Exception2118143865.java:7)
      	at org.drools.compiler.test.Rule_Throw_Function_Exception2118143865DefaultConsequenceInvokerGenerated.evaluate(Unknown Source)
      	at org.drools.compiler.test.Rule_Throw_Function_Exception2118143865DefaultConsequenceInvoker.evaluate(Unknown Source)
      	at org.drools.core.phreak.RuleExecutor.innerFireActivation(RuleExecutor.java:448)
      	... 59 more
      

      exec-model

      Exception executing consequence for rule "Throw Function Exception" in org.drools.compiler.test: java.lang.RuntimeException: java.lang.Exception: this should throw an exception
      	at org.drools.core.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:39)
      	at org.drools.core.common.DefaultAgenda.handleException(DefaultAgenda.java:1306)
      	at org.drools.core.phreak.RuleExecutor.innerFireActivation(RuleExecutor.java:455)
      	at org.drools.core.phreak.RuleExecutor.fireActivation(RuleExecutor.java:395)
      	at org.drools.core.phreak.RuleExecutor.fire(RuleExecutor.java:151)
      	at org.drools.core.phreak.RuleExecutor.evaluateNetworkAndFire(RuleExecutor.java:103)
      ...
      Caused by: java.lang.RuntimeException: java.lang.Exception: this should throw an exception
      	at org.drools.compiler.test.Rules92421AED801E096CA184717103EEBE81.throwException(Rules92421AED801E096CA184717103EEBE81.java:40)
      	at org.drools.compiler.test.PA0.LambdaConsequenceA0D802DCD20DBEF3900866EB028E0353.execute(LambdaConsequenceA0D802DCD20DBEF3900866EB028E0353.java:22)
      	at org.drools.model.functions.Block0$Impl.execute(Block0.java:39)
      	at org.drools.modelcompiler.consequence.LambdaConsequence.evaluate(LambdaConsequence.java:76)
      	at org.drools.core.phreak.RuleExecutor.innerFireActivation(RuleExecutor.java:448)
      	... 59 more
      Caused by: java.lang.Exception: this should throw an exception
      	at org.drools.compiler.test.Rules92421AED801E096CA184717103EEBE81.throwException(Rules92421AED801E096CA184717103EEBE81.java:38)
      	... 63 more
      

      exec-model wraps an Exception from a function with an RuntimeException:

      public class Rules92421AED801E096CA184717103EEBE81 implements org.drools.model.Model {
      
          ...
          public static void throwException() {
              try {
                  throw new Exception("this should throw an exception");
              } catch (Exception e) {
                  throw new RuntimeException(e);
              }
          }
      }
      

      Attachments

        Issue Links

          Activity

            People

              rhn-support-tkobayas Toshiya Kobayashi
              rhn-support-tkobayas Toshiya Kobayashi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: