JBoss Test 1.2.0.Final

org.jboss.test.thread
Class TestThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.jboss.test.thread.TestThread
All Implemented Interfaces:
Runnable, Thread.UncaughtExceptionHandler

public class TestThread
extends Thread
implements Thread.UncaughtExceptionHandler

TestThread.

A simple thread that you can doJoin() on and it will rethrow any error in the thread's execution as an AssertionFailedError

Version:
$Revision: 1.1 $
Author:
Adrian Brock

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TestThread()
           
TestThread(String name)
           
 
Method Summary
 void doJoin()
           
 void doJoin(long millis)
           
 void doJoinExpectError(Class<? extends Throwable> expected)
           
 void doJoinExpectError(long millis, Class<? extends Throwable> expected)
           
 void uncaughtException(Thread t, Throwable e)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestThread

public TestThread()

TestThread

public TestThread(String name)
Method Detail

uncaughtException

public void uncaughtException(Thread t,
                              Throwable e)
Specified by:
uncaughtException in interface Thread.UncaughtExceptionHandler

doJoin

public void doJoin()
            throws InterruptedException
Throws:
InterruptedException

doJoin

public void doJoin(long millis)
            throws InterruptedException
Throws:
InterruptedException

doJoinExpectError

public void doJoinExpectError(Class<? extends Throwable> expected)
                       throws InterruptedException
Throws:
InterruptedException

doJoinExpectError

public void doJoinExpectError(long millis,
                              Class<? extends Throwable> expected)
                       throws InterruptedException
Throws:
InterruptedException

JBoss Test 1.2.0.Final

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.