junit.extensions.abbot
Class AWTFixtureHelper.ExceptionCatcher

java.lang.Object
  extended byabbot.util.EventDispatchExceptionHandler
      extended byjunit.extensions.abbot.AWTFixtureHelper.ExceptionCatcher
Enclosing class:
AWTFixtureHelper

public static class AWTFixtureHelper.ExceptionCatcher
extends EventDispatchExceptionHandler

Provide access to the most recent exception caught on the dispatch thread.


Field Summary
 
Fields inherited from class abbot.util.EventDispatchExceptionHandler
PROP_NAME
 
Constructor Summary
AWTFixtureHelper.ExceptionCatcher()
           
 
Method Summary
static void clear()
           
protected  void exceptionCaught(Throwable thr)
          Define this to handle the exception as needed.
static Throwable getThrowable()
          Return the most recent exception caught on the dispatch thread, or null if none has been thrown.
 void install()
          Install a handler for event dispatch exceptions.
 
Methods inherited from class abbot.util.EventDispatchExceptionHandler
handle, isInstalled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AWTFixtureHelper.ExceptionCatcher

public AWTFixtureHelper.ExceptionCatcher()
Method Detail

install

public void install()
Description copied from class: EventDispatchExceptionHandler
Install a handler for event dispatch exceptions. This is kind of a hack, but it's Sun's hack. See the javadoc for java.awt.EventDispatchThread for details. NOTE: we throw an exception immediately, which ensures that our handler is installed, since otherwise someone might set this property later. java.awt.EventDispatchThread doesn't actually load the handler specified by the property until an exception is caught by the event dispatch thread. SwingSet2 in 1.4.1 installs its own. Note that a new instance is created for each exception thrown.

Overrides:
install in class EventDispatchExceptionHandler

getThrowable

public static Throwable getThrowable()
Return the most recent exception caught on the dispatch thread, or null if none has been thrown. Also clears the exception.


clear

public static void clear()

exceptionCaught

protected void exceptionCaught(Throwable thr)
Description copied from class: EventDispatchExceptionHandler
Define this to handle the exception as needed. Default prints a warning to System.err.

Overrides:
exceptionCaught in class EventDispatchExceptionHandler


Copyright © 2002-2004 Timothy Wall. All Rights Reserved.
Abbot is hosted on

SourceForge