mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-25 15:52:06 +01:00
[sinttest] Treat NPE as test failure not as abort condition
This commit is contained in:
parent
c9af25c674
commit
f64288ba6d
1 changed files with 8 additions and 0 deletions
|
@ -590,6 +590,14 @@ public class SmackIntegrationTestFramework {
|
||||||
if (e instanceof InterruptedException) {
|
if (e instanceof InterruptedException) {
|
||||||
throw (InterruptedException) e;
|
throw (InterruptedException) e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We handle NullPointerException as a non fatal exception, as they are mostly caused by an invalid reply where
|
||||||
|
// a extension element is missing. Consider for example
|
||||||
|
// assertEquals(StanzaError.Condition.foo, response.getError().getCondition())
|
||||||
|
// Otherwise NPEs could be caused by an internal bug in Smack, e.g. missing null handling.
|
||||||
|
if (e instanceof NullPointerException) {
|
||||||
|
return (NullPointerException) e;
|
||||||
|
}
|
||||||
if (e instanceof RuntimeException) {
|
if (e instanceof RuntimeException) {
|
||||||
throw (RuntimeException) e;
|
throw (RuntimeException) e;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue