PentahoChainedException extends RuntimeException { public Throwable getRootCause() { Throwable aReason = this; Throwable lastReason = null; while ( ( aReason != null ) ) { lastReason = aReason; aReason = aReason.getCause(); } return lastReason; } PentahoChainedException();  PentahoChainedException( final String message );  PentahoChainedException( final String message, final Throwable reas );  PentahoChainedException( final Throwable reas ); Throwable getRootCause(); @Override synchronized void printStackTrace( final java.io.PrintWriter pw ); @Override synchronized void printStackTrace( final PrintStream ps );  }
@Test public void testGetRootCause() { PentahoChainedException exception = new PentahoChainedException( CAUSE ); Throwable rootCause = exception.getRootCause(); assertEquals( CAUSE, rootCause ); }