Class JavaTestError

java.lang.Object
java.lang.Throwable
java.lang.Error
com.sun.javatest.JavaTestError
All Implemented Interfaces:
Serializable

public class JavaTestError extends Error
Special error class to be used for errors which may pop out of JT Harness and be seen by the user.
See Also:
  • Field Details

    • original

      protected Throwable original
      The original problem. Useful if you need the stack trace.
  • Constructor Details

    • JavaTestError

      public JavaTestError(String s)
      Constructs a JavaTestError object with a literal string as the message text. You should ensure that the string you supply here is subject to I18N.
      Parameters:
      s - Literal string to use as the message text.
    • JavaTestError

      public JavaTestError(String s, Throwable original)
      Constructs a JavaTestError object with a literal string as the message text. You should ensure that the string you supply here is subject to I18N.
      Parameters:
      s - Literal string to use as the message text.
      original - The exception which originally caused the problem.
    • JavaTestError

      public JavaTestError(Throwable original)
      Constructs a JavaTestError object to be thrown when an unexpected exception has been caught.
      Parameters:
      original - The exception which originally caused the problem.
      See Also:
    • JavaTestError

      public JavaTestError(I18NResourceBundle i18n, String key)
      Constructs a JavaTestError object with an I18N string as the message.
      Parameters:
      i18n - The resource bundle to get the message text from.
      key - The key to access the resource bundle.
    • JavaTestError

      public JavaTestError(I18NResourceBundle i18n, String key, Object arg)
      Constructs a JavaTestError object with an I18N string as the message.
      Parameters:
      i18n - The resource bundle to get the message text from.
      key - The key to access the resource bundle.
      arg - Item to be substituted into the internationalized string.
    • JavaTestError

      public JavaTestError(I18NResourceBundle i18n, String key, Object... args)
      Constructs a JavaTestError object with an I18N string as the message.
      Parameters:
      i18n - The resource bundle to get the message text from.
      key - The key to access the resource bundle.
      args - Items to be substituted into the internationalized string.
    • JavaTestError

      public JavaTestError(I18NResourceBundle i18n, String key, Throwable original)
      Constructs a JavaTestError object with an I18N string as the message and the error or exception which caused this error to be thrown. The original throwable will probably be something like an IOException object.
      Parameters:
      i18n - The resource bundle to get the message text from.
      key - The key to access the resource bundle.
      original - The problem which ultimately caused this error.
    • JavaTestError

      public JavaTestError(I18NResourceBundle i18n, String key, Object arg, Throwable original)
      Constructs a JavaTestError object with an I18N string as the message and the error or exception which caused this error to be thrown. The original throwable will probably be something like an IOException object.
      Parameters:
      i18n - The resource bundle to get the message text from.
      key - The key to access the resource bundle.
      arg - Item to be substituted into the internationalized string.
      original - The problem which ultimately caused this error.
    • JavaTestError

      public JavaTestError(I18NResourceBundle i18n, String key, Object[] args, Throwable original)
      Constructs a JavaTestError object with an I18N string as the message and the error or exception which caused this error to be thrown. The original throwable will probably be something like an IOException object.
      Parameters:
      i18n - The resource bundle to get the message text from.
      key - The key to access the resource bundle.
      args - Items to be substituted into the internationalized string.
      original - The problem which ultimately caused this error.
  • Method Details

    • unexpectedException

      public static void unexpectedException(Throwable t)
      Print out a message when an unexpected exception has been caught.
      Parameters:
      t - The exception that was caught.
      See Also:
    • printStackTrace

      public void printStackTrace()
      Overrides:
      printStackTrace in class Throwable
    • printStackTrace

      public void printStackTrace(PrintStream s)
      Overrides:
      printStackTrace in class Throwable
    • printStackTrace

      public void printStackTrace(PrintWriter s)
      Overrides:
      printStackTrace in class Throwable
    • getOriginalFault

      public Throwable getOriginalFault()
      If available, find out what error or exception caused JT Harness to create this object and to throw it.
      Returns:
      The original Throwable object that this object was created in response to. May be null if there was none.