1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2025-12-06 21:21:08 +01:00

Add XMPPErrorException.getStanzaError()

Also deprecate getXMPPError and let StanzaError implement
ExtensionElement.
This commit is contained in:
Florian Schmaus 2018-06-20 15:55:48 +02:00
parent 651ee7b85e
commit 23bb5c5625
31 changed files with 108 additions and 75 deletions

View file

@ -125,7 +125,7 @@ public class InBandBytestreamManagerTest extends InitExtensions {
}
catch (XMPPErrorException e) {
assertEquals(StanzaError.Condition.feature_not_implemented,
e.getXMPPError().getCondition());
e.getStanzaError().getCondition());
}
}

View file

@ -451,7 +451,7 @@ public class Socks5ByteStreamManagerTest {
}
catch (XMPPErrorException e) {
protocol.verifyAll();
assertEquals(rejectPacket.getError(), e.getXMPPError());
assertEquals(rejectPacket.getError(), e.getStanzaError());
}
catch (Exception e) {
fail(e.getMessage());

View file

@ -110,7 +110,7 @@ public class Socks5ByteStreamRequestTest {
fail("exception should be thrown");
}
catch (XMPPErrorException e) {
assertTrue(e.getXMPPError().getDescriptiveText("en").contains("Could not establish socket with any provided host"));
assertTrue(e.getStanzaError().getDescriptiveText("en").contains("Could not establish socket with any provided host"));
}
// verify targets response
@ -154,7 +154,7 @@ public class Socks5ByteStreamRequestTest {
fail("exception should be thrown");
}
catch (XMPPErrorException e) {
assertTrue(e.getXMPPError().getDescriptiveText("en").contains("Could not establish socket with any provided host"));
assertTrue(e.getStanzaError().getDescriptiveText("en").contains("Could not establish socket with any provided host"));
}
// verify targets response
@ -201,7 +201,7 @@ public class Socks5ByteStreamRequestTest {
fail("exception should be thrown");
}
catch (XMPPErrorException e) {
assertTrue(e.getXMPPError().getDescriptiveText("en").contains(
assertTrue(e.getStanzaError().getDescriptiveText("en").contains(
"Could not establish socket with any provided host"));
}
@ -293,7 +293,7 @@ public class Socks5ByteStreamRequestTest {
fail("exception should be thrown");
}
catch (XMPPErrorException e) {
assertTrue(e.getXMPPError().getDescriptiveText("en").contains(
assertTrue(e.getStanzaError().getDescriptiveText("en").contains(
"Could not establish socket with any provided host"));
}

View file

@ -231,7 +231,7 @@ public class Socks5ClientForInitiatorTest {
fail("exception should be thrown");
}
catch (XMPPErrorException e) {
assertTrue(StanzaError.Condition.internal_server_error.equals(e.getXMPPError().getCondition()));
assertTrue(StanzaError.Condition.internal_server_error.equals(e.getStanzaError().getCondition()));
protocol.verifyAll();
}

View file

@ -77,7 +77,7 @@ public class ConfigureFormTest extends InitExtensions {
fail();
}
catch (XMPPErrorException e) {
Assert.assertEquals(StanzaError.Type.AUTH, e.getXMPPError().getType());
Assert.assertEquals(StanzaError.Type.AUTH, e.getStanzaError().getType());
}
}