mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +02:00
Add XMPPErrorException.getStanzaError()
Also deprecate getXMPPError and let StanzaError implement ExtensionElement.
This commit is contained in:
parent
651ee7b85e
commit
23bb5c5625
31 changed files with 108 additions and 75 deletions
|
@ -120,7 +120,7 @@ public class LoginTest extends SmackTestCase {
|
|||
conn.getAccountManager().createAccount("user_1", "user_1", getAccountCreationParameters());
|
||||
} catch (XMPPException e) {
|
||||
// Do nothing if the account already exists
|
||||
if (e.getXMPPError().getCode() != 409) {
|
||||
if (e.getStanzaError().getCode() != 409) {
|
||||
throw e;
|
||||
}
|
||||
// Else recreate the connection, ins case the server closed it as
|
||||
|
@ -141,8 +141,8 @@ public class LoginTest extends SmackTestCase {
|
|||
}
|
||||
|
||||
} catch (XMPPException e) {
|
||||
if (e.getXMPPError() != null) {
|
||||
assertEquals("Wrong error code returned", 406, e.getXMPPError().getCode());
|
||||
if (e.getStanzaError() != null) {
|
||||
assertEquals("Wrong error code returned", 406, e.getStanzaError().getCode());
|
||||
} else {
|
||||
fail(e.getMessage());
|
||||
}
|
||||
|
|
|
@ -228,7 +228,7 @@ public class PrivacyTest extends SmackTestCase {
|
|||
// The list should not exist and an error will be raised
|
||||
privacyManager.getDefaultList();
|
||||
} catch (XMPPException xmppException) {
|
||||
assertEquals(404, xmppException.getXMPPError().getCode());
|
||||
assertEquals(404, xmppException.getStanzaError().getCode());
|
||||
}
|
||||
|
||||
assertEquals(null, null);
|
||||
|
@ -255,7 +255,7 @@ public class PrivacyTest extends SmackTestCase {
|
|||
// The list should not exist and an error will be raised
|
||||
privacyManager.getActiveList();
|
||||
} catch (XMPPException xmppException) {
|
||||
assertEquals(404, xmppException.getXMPPError().getCode());
|
||||
assertEquals(404, xmppException.getStanzaError().getCode());
|
||||
}
|
||||
|
||||
assertEquals(null, null);
|
||||
|
@ -341,7 +341,7 @@ public class PrivacyTest extends SmackTestCase {
|
|||
// The list should not exist and an error will be raised
|
||||
privacyManager.getPrivacyList(listName);
|
||||
} catch (XMPPException xmppException) {
|
||||
assertEquals(404, xmppException.getXMPPError().getCode());
|
||||
assertEquals(404, xmppException.getStanzaError().getCode());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue