TSK-115 JAASRunner throws ClassCastException if tests fail
This commit is contained in:
parent
a6f95fcd55
commit
69784458af
|
|
@ -57,17 +57,24 @@ public class JAASRunner extends BlockJUnit4ClassRunner {
|
||||||
try {
|
try {
|
||||||
base.evaluate();
|
base.evaluate();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
if (e instanceof Exception) {
|
|
||||||
throw (Exception) e;
|
|
||||||
} else {
|
|
||||||
throw new Exception(e);
|
throw new Exception(e);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} catch (PrivilegedActionException e) {
|
} catch (PrivilegedActionException e) {
|
||||||
throw (Exception) e.getCause();
|
Throwable cause = e.getCause();
|
||||||
|
Throwable nestedCause = null;
|
||||||
|
if (cause != null) {
|
||||||
|
nestedCause = cause.getCause();
|
||||||
|
}
|
||||||
|
if (nestedCause != null) {
|
||||||
|
throw nestedCause;
|
||||||
|
} else if (cause != null) {
|
||||||
|
throw cause;
|
||||||
|
} else {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue