Interface Litmus


  • public interface Litmus
    Callback to be called when a test for validity succeeds or fails.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static Litmus IGNORE
      Implementation of Litmus that returns a status code but does not throw.
      static Litmus THROW
      Implementation of Litmus that throws an AssertionError on failure.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean check​(boolean condition, java.lang.String message, java.lang.Object... args)
      Checks a condition.
      boolean fail​(java.lang.String message, java.lang.Object... args)
      Called when test fails.
      boolean succeed()
      Called when test succeeds.
    • Field Detail

      • THROW

        static final Litmus THROW
        Implementation of Litmus that throws an AssertionError on failure.
      • IGNORE

        static final Litmus IGNORE
        Implementation of Litmus that returns a status code but does not throw.
    • Method Detail

      • fail

        boolean fail​(java.lang.String message,
                     java.lang.Object... args)
        Called when test fails. Returns false or throws.
        Parameters:
        message - Message
        args - Arguments
      • succeed

        boolean succeed()
        Called when test succeeds. Returns true.
      • check

        boolean check​(boolean condition,
                      java.lang.String message,
                      java.lang.Object... args)
        Checks a condition.

        If the condition is true, calls succeed(); if the condition is false, calls fail(java.lang.String, java.lang.Object...), converting info into a string message.