junit.extensions.abbot
Class ComponentTestFixture.ExceptionCatcher

java.lang.Object
  |
  +--abbot.util.AbstractEventExceptionHandler
        |
        +--junit.extensions.abbot.ComponentTestFixture.ExceptionCatcher
Enclosing class:
ComponentTestFixture

public static class ComponentTestFixture.ExceptionCatcher
extends AbstractEventExceptionHandler

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


Fields inherited from class abbot.util.AbstractEventExceptionHandler
PROP_NAME
 
Constructor Summary
ComponentTestFixture.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.AbstractEventExceptionHandler
handle, isInstalled
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentTestFixture.ExceptionCatcher

public ComponentTestFixture.ExceptionCatcher()
Method Detail

install

public void install()
Description copied from class: AbstractEventExceptionHandler
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 AbstractEventExceptionHandler
Following copied from class: abbot.util.AbstractEventExceptionHandler
Throws:
RuntimeException - if the handler cannot be installed.
IllegalStateException - if this method is invoked from an event dispatch thread.
IllegalArgumentException - if the given class is not derived from this one.

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: AbstractEventExceptionHandler
Define this to handle the exception as needed.
Overrides:
exceptionCaught in class AbstractEventExceptionHandler


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

SourceForge