1 /*
   2  * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
   3  * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
   4  */
   5 package jdk.testlibrary;
   6 
   7 /**
   8  * This type serves no other purpose than to simply allow automatically running
   9  * something in a thread, and have all exceptions propagated to
  10  * RuntimeExceptions, which are thrown up to thread, which in turn should
  11  * probably be a {@link TestThread} to they are stored.
  12  */
  13 public abstract class XRun implements Runnable {
  14     public void run() {
  15         try {
  16             xrun();
  17         } catch (Error e) {
  18             throw e;
  19         } catch (RuntimeException e) {
  20             throw e;
  21         } catch (Throwable e) {
  22             throw new RuntimeException(e);
  23         }
  24     }
  25 
  26     public abstract void xrun() throws Throwable;
  27 }