ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/JSR166TestCase.java
(Generate patch)

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.241 by jsr166, Sun Jan 28 16:20:42 2018 UTC vs.
Revision 1.242 by jsr166, Mon Feb 19 16:12:11 2018 UTC

# Line 1446 | Line 1446 | public class JSR166TestCase extends Test
1446          }
1447      }
1448  
1449    public abstract class RunnableShouldThrow implements Runnable {
1450        protected abstract void realRun() throws Throwable;
1451
1452        final Class<?> exceptionClass;
1453
1454        <T extends Throwable> RunnableShouldThrow(Class<T> exceptionClass) {
1455            this.exceptionClass = exceptionClass;
1456        }
1457
1458        public final void run() {
1459            try {
1460                realRun();
1461                threadShouldThrow(exceptionClass.getSimpleName());
1462            } catch (Throwable t) {
1463                if (! exceptionClass.isInstance(t))
1464                    threadUnexpectedException(t);
1465            }
1466        }
1467    }
1468
1449      public abstract class ThreadShouldThrow extends Thread {
1450          protected abstract void realRun() throws Throwable;
1451  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines