Package ucb.junit

Class textui

java.lang.Object
ucb.junit.textui

public class textui extends Object
An alternative unit test runner with text output.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Verbosity levels.
    static final int
    Verbosity levels.
    static final int
    Verbosity levels.
    static final int
    Verbosity levels.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    main(String... args)
    Produces the report described for runClasses, on the classes named in ARGS.
    static int
    runClasses(int verbosity, Class<?>... classes)
    Run all tests in CLASSES, reporting results on the standard error output, depending on VERBOSITY, which determines what is reported.
    static int
    runClasses(int verbosity, List<Class<?>> classes)
    Return as for runClasses (VERBOSITY, CLASSES), but with the class list stored in a list rather than an array.
    static int
    runClasses(Class<?>... classes)
    Return runClasses(Messages, CLASSES).
    static int
    runClasses(List<Class<?>> classes)
    Return runClasses(MESSAGES, CLASSES).

    Methods inherited from class java.lang.Object

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

  • Constructor Details

    • textui

      public textui()
  • Method Details

    • runClasses

      public static int runClasses(int verbosity, Class<?>... classes)
      Run all tests in CLASSES, reporting results on the standard error output, depending on VERBOSITY, which determines what is reported. if VERBOSITY is
      • Silent, prints nothing.
      • Summary, prints the total test time and numbers of tests run and failed.
      • TestNames, as for Summary, plus print names of failing test methods.
      • Messages, as for TestNames, and print descriptive message notating the error, plus its location in the test routines.
      Returns the number of failed tests.
    • runClasses

      public static int runClasses(Class<?>... classes)
      Return runClasses(Messages, CLASSES).
    • runClasses

      public static int runClasses(int verbosity, List<Class<?>> classes)
      Return as for runClasses (VERBOSITY, CLASSES), but with the class list stored in a list rather than an array.
    • runClasses

      public static int runClasses(List<Class<?>> classes)
      Return runClasses(MESSAGES, CLASSES).
    • main

      public static void main(String... args)
      Produces the report described for runClasses, on the classes named in ARGS. An initial "--level=NAME" determines the verbosity, which may be Silent, Summary, TestNames, or Messages. Default is Messages.