Class ExpressionLanguageContractTest.Nesting

java.lang.Object
io.github.brantunger.unruly.test.ExpressionLanguageContractTest.Nesting
Enclosing class:
ExpressionLanguageContractTest

public static final class ExpressionLanguageContractTest.Nesting extends Object
The fact the nested-run checks run their rules against: its value property starts a run nested inside the run that reads it, on the same thread, as a getter a condition or an action reads, or a function it calls, does when it runs rules. Only nestedRunInsideAnAction, nestedRunInsideACondition, nestedRunFailsInsideACondition, nestedRunFailsInsideAnAction and nestedRunFailureRethrownAsIs create one. It's public, with a public getter, so that a language can read the property, by reflection or however else it reads a JavaBean's. It keeps what the nested run returned, or the exception it threw, which the checks and NestedRuns read.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Starts the nested run, and returns 7 whether the run returned or threw an exception, unless it's the one nestedRunFailureRethrownAsIs gives the outer run, which throws on, unchanged, the exception the run threw; an Error it threw is thrown on.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getValue

      public int getValue()
      Starts the nested run, and returns 7 whether the run returned or threw an exception, unless it's the one nestedRunFailureRethrownAsIs gives the outer run, which throws on, unchanged, the exception the run threw; an Error it threw is thrown on. The one a check gives the nested run itself, so that the nested run fails, throws an IllegalStateException instead, and starts nothing. The check looks for it among the causes and suppressed exceptions of the nested run's failure, or for its message there.
      Returns:
      7