Package sbt.testing

Enum Status

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Status>

    public enum Status
    extends java.lang.Enum<Status>
    Represents the status of running a test. Test frameworks can decided which of these to use and what they mean, but in general, the intended meanings are:
    • Success - a test succeeded
    • Error - an "error" occurred during a test
    • Failure - an "failure" during a test
    • Skipped - a test was skipped for any reason
    • Ignored - a test was ignored, i.e., temporarily disabled with the intention of fixing it later
    • Canceled - a test was canceled, i.e., not able to be completed because of some unmet pre-condition, such as a database being offline that the test requires
    • Pending - a test was declared as pending, i.e., with test code and/or production code as yet unimplemented

    The difference between errors and failures, if any, is determined by the test frameworks. JUnit and specs2 differentiate between errors and failures. ScalaTest reports everything (both assertion failures and unexpected errors) as failures. JUnit and ScalaTest support ignored tests. ScalaTest and specs2 support a notion of pending tests. ScalaTest differentiates between ignored and canceled tests, whereas specs2 only supports skipped tests, which are implemented like ScalaTest's canceled tests. TestNG uses "skipped" to report tests that were not executed because of failures in dependencies, which is also similar to canceled tests in ScalaTest.

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      Canceled
      Indicates a test was canceled.
      Error
      Indicates an "error" occurred.
      Failure
      Indicates a "failure" occurred.
      Ignored
      Indicates a test was ignored.
      Pending
      Indicates a test was declared as pending.
      Skipped
      Indicates a test was skipped.
      Success
      Indicates a test succeeded.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Status valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Status[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • Success

        public static final Status Success
        Indicates a test succeeded.
      • Error

        public static final Status Error
        Indicates an "error" occurred.
      • Failure

        public static final Status Failure
        Indicates a "failure" occurred.
      • Skipped

        public static final Status Skipped
        Indicates a test was skipped.
      • Ignored

        public static final Status Ignored
        Indicates a test was ignored.
      • Canceled

        public static final Status Canceled
        Indicates a test was canceled.
      • Pending

        public static final Status Pending
        Indicates a test was declared as pending.
    • Method Detail

      • values

        public static Status[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Status c : Status.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Status valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null