1 package net.sf.openrocket.util;
3 import static org.junit.Assert.*;
5 import java.io.IOException;
6 import java.lang.reflect.InvocationTargetException;
10 public class ReflectionTest {
13 public void textHandleInvocationTargetException() {
14 Throwable cause = null;
17 cause = new InvocationTargetException(null);
18 Reflection.handleWrappedException((InvocationTargetException)cause);
20 } catch (BugException e) {
21 assertTrue(cause == e.getCause());
25 cause = new IllegalStateException("Test");
26 Reflection.handleWrappedException(new InvocationTargetException(cause));
28 } catch (IllegalStateException e) {
29 assertTrue(cause == e);
33 cause = new AbstractMethodError();
34 Reflection.handleWrappedException(new InvocationTargetException(cause));
36 } catch (AbstractMethodError e) {
37 assertTrue(cause == e);
41 cause = new IOException();
42 Reflection.handleWrappedException(new InvocationTargetException(cause));
44 } catch (BugException e) {
45 assertTrue(cause == e.getCause());