mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-15 03:59:38 +02:00
Add XMPPConnection.sendStanza(Stanza)
and deprecate sendPacket().
This commit is contained in:
parent
183af99ffb
commit
ed4fa3390f
58 changed files with 183 additions and 167 deletions
|
@ -68,7 +68,7 @@ public class CloseListenerTest {
|
|||
|
||||
// capture reply to the In-Band Bytestream close request
|
||||
ArgumentCaptor<IQ> argument = ArgumentCaptor.forClass(IQ.class);
|
||||
verify(connection).sendPacket(argument.capture());
|
||||
verify(connection).sendStanza(argument.capture());
|
||||
|
||||
// assert that reply is the correct error packet
|
||||
assertEquals(initiatorJID, argument.getValue().getTo());
|
||||
|
|
|
@ -70,7 +70,7 @@ public class DataListenerTest {
|
|||
|
||||
// capture reply to the In-Band Bytestream close request
|
||||
ArgumentCaptor<IQ> argument = ArgumentCaptor.forClass(IQ.class);
|
||||
verify(connection).sendPacket(argument.capture());
|
||||
verify(connection).sendStanza(argument.capture());
|
||||
|
||||
// assert that reply is the correct error packet
|
||||
assertEquals(initiatorJID, argument.getValue().getTo());
|
||||
|
|
|
@ -78,7 +78,7 @@ public class InBandBytestreamRequestTest {
|
|||
|
||||
// capture reply to the In-Band Bytestream open request
|
||||
ArgumentCaptor<IQ> argument = ArgumentCaptor.forClass(IQ.class);
|
||||
verify(connection).sendPacket(argument.capture());
|
||||
verify(connection).sendStanza(argument.capture());
|
||||
|
||||
// assert that reply is the correct error packet
|
||||
assertEquals(initiatorJID, argument.getValue().getTo());
|
||||
|
@ -103,7 +103,7 @@ public class InBandBytestreamRequestTest {
|
|||
|
||||
// capture reply to the In-Band Bytestream open request
|
||||
ArgumentCaptor<IQ> argument = ArgumentCaptor.forClass(IQ.class);
|
||||
verify(connection).sendPacket(argument.capture());
|
||||
verify(connection).sendStanza(argument.capture());
|
||||
|
||||
// assert that reply is the correct acknowledgment packet
|
||||
assertEquals(initiatorJID, argument.getValue().getTo());
|
||||
|
|
|
@ -86,7 +86,7 @@ public class InitiationListenerTest {
|
|||
|
||||
// capture reply to the In-Band Bytestream open request
|
||||
ArgumentCaptor<IQ> argument = ArgumentCaptor.forClass(IQ.class);
|
||||
verify(connection).sendPacket(argument.capture());
|
||||
verify(connection).sendStanza(argument.capture());
|
||||
|
||||
// assert that reply is the correct error packet
|
||||
assertEquals(initiatorJID, argument.getValue().getTo());
|
||||
|
@ -114,7 +114,7 @@ public class InitiationListenerTest {
|
|||
|
||||
// capture reply to the In-Band Bytestream open request
|
||||
ArgumentCaptor<IQ> argument = ArgumentCaptor.forClass(IQ.class);
|
||||
verify(connection).sendPacket(argument.capture());
|
||||
verify(connection).sendStanza(argument.capture());
|
||||
|
||||
// assert that reply is the correct error packet
|
||||
assertEquals(initiatorJID, argument.getValue().getTo());
|
||||
|
@ -204,7 +204,7 @@ public class InitiationListenerTest {
|
|||
|
||||
// capture reply to the In-Band Bytestream open request
|
||||
ArgumentCaptor<IQ> argument = ArgumentCaptor.forClass(IQ.class);
|
||||
verify(connection).sendPacket(argument.capture());
|
||||
verify(connection).sendStanza(argument.capture());
|
||||
|
||||
// assert that reply is the correct error packet
|
||||
assertEquals(initiatorJID, argument.getValue().getTo());
|
||||
|
|
|
@ -93,7 +93,7 @@ public class InitiationListenerTest {
|
|||
|
||||
// capture reply to the SOCKS5 Bytestream initiation
|
||||
ArgumentCaptor<IQ> argument = ArgumentCaptor.forClass(IQ.class);
|
||||
verify(connection).sendPacket(argument.capture());
|
||||
verify(connection).sendStanza(argument.capture());
|
||||
|
||||
// assert that reply is the correct error packet
|
||||
assertEquals(initiatorJID, argument.getValue().getTo());
|
||||
|
@ -183,7 +183,7 @@ public class InitiationListenerTest {
|
|||
|
||||
// capture reply to the SOCKS5 Bytestream initiation
|
||||
ArgumentCaptor<IQ> argument = ArgumentCaptor.forClass(IQ.class);
|
||||
verify(connection).sendPacket(argument.capture());
|
||||
verify(connection).sendStanza(argument.capture());
|
||||
|
||||
// assert that reply is the correct error packet
|
||||
assertEquals(initiatorJID, argument.getValue().getTo());
|
||||
|
|
|
@ -53,7 +53,7 @@ public class ConnectionUtils {
|
|||
* <pre>
|
||||
* <code>
|
||||
* PacketCollector collector = connection.createPacketCollector(new PacketFilter());
|
||||
* connection.sendPacket(packet);
|
||||
* connection.sendStanza(packet);
|
||||
* Packet reply = collector.nextResult();
|
||||
* </code>
|
||||
* </pre>
|
||||
|
@ -95,7 +95,7 @@ public class ConnectionUtils {
|
|||
return null;
|
||||
}
|
||||
};
|
||||
doAnswer(addIncoming).when(connection).sendPacket(isA(Stanza.class));
|
||||
doAnswer(addIncoming).when(connection).sendStanza(isA(Stanza.class));
|
||||
|
||||
// mock receive methods
|
||||
Answer<Stanza> answer = new Answer<Stanza>() {
|
||||
|
|
|
@ -52,7 +52,7 @@ import org.jivesoftware.smack.packet.Stanza;
|
|||
* public void methodToTest() {
|
||||
* Packet packet = new Packet(); // create an XMPP packet
|
||||
* PacketCollector collector = connection.createPacketCollector(new StanzaIdFilter());
|
||||
* connection.sendPacket(packet);
|
||||
* connection.sendStanza(packet);
|
||||
* Packet reply = collector.nextResult();
|
||||
* }
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue