mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-07 05:31:08 +01:00
Renamed Connection to XMPPConnection
This commit is contained in:
parent
f3e007bad5
commit
489816c61f
145 changed files with 639 additions and 641 deletions
|
|
@ -51,7 +51,7 @@ public class CompressionTest extends SmackTestCase {
|
|||
// Login with the test account
|
||||
connection.login("user0", "user0");
|
||||
|
||||
assertTrue("Connection is not using stream compression", connection.isUsingCompression());
|
||||
assertTrue("XMPPConnection is not using stream compression", connection.isUsingCompression());
|
||||
|
||||
// Request the version of the server
|
||||
Version version = new Version();
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class MultipleRecipientManagerTest extends SmackTestCase {
|
|||
MultipleRecipientManager.send(getConnection(0), message, to, cc, bcc);
|
||||
|
||||
Packet message1 = collector1.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNotNull("Connection 1 never received the message", message1);
|
||||
assertNotNull("XMPPConnection 1 never received the message", message1);
|
||||
MultipleRecipientInfo info1 = MultipleRecipientManager.getMultipleRecipientInfo(message1);
|
||||
assertNotNull("Message 1 does not contain MultipleRecipientInfo", info1);
|
||||
assertFalse("Message 1 should be 'replyable'", info1.shouldNotReply());
|
||||
|
|
@ -74,7 +74,7 @@ public class MultipleRecipientManagerTest extends SmackTestCase {
|
|||
assertEquals("Incorrect CC address", getBareJID(2), address1);
|
||||
|
||||
Packet message2 = collector2.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNotNull("Connection 2 never received the message", message2);
|
||||
assertNotNull("XMPPConnection 2 never received the message", message2);
|
||||
MultipleRecipientInfo info2 = MultipleRecipientManager.getMultipleRecipientInfo(message2);
|
||||
assertNotNull("Message 2 does not contain MultipleRecipientInfo", info2);
|
||||
assertFalse("Message 2 should be 'replyable'", info2.shouldNotReply());
|
||||
|
|
@ -88,7 +88,7 @@ public class MultipleRecipientManagerTest extends SmackTestCase {
|
|||
assertEquals("Incorrect CC address", getBareJID(2), address2);
|
||||
|
||||
Packet message3 = collector3.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNotNull("Connection 3 never received the message", message3);
|
||||
assertNotNull("XMPPConnection 3 never received the message", message3);
|
||||
MultipleRecipientInfo info3 = MultipleRecipientManager.getMultipleRecipientInfo(message3);
|
||||
assertNotNull("Message 3 does not contain MultipleRecipientInfo", info3);
|
||||
assertFalse("Message 3 should be 'replyable'", info3.shouldNotReply());
|
||||
|
|
@ -130,7 +130,7 @@ public class MultipleRecipientManagerTest extends SmackTestCase {
|
|||
// Get the message and ensure it's ok
|
||||
Message message1 =
|
||||
(Message) collector1.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNotNull("Connection 1 never received the message", message1);
|
||||
assertNotNull("XMPPConnection 1 never received the message", message1);
|
||||
MultipleRecipientInfo info = MultipleRecipientManager.getMultipleRecipientInfo(message1);
|
||||
assertNotNull("Message 1 does not contain MultipleRecipientInfo", info);
|
||||
assertFalse("Message 1 should be 'replyable'", info.shouldNotReply());
|
||||
|
|
@ -144,7 +144,7 @@ public class MultipleRecipientManagerTest extends SmackTestCase {
|
|||
|
||||
// Get the reply and ensure it's ok
|
||||
reply1 = (Message) collector0.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNotNull("Connection 0 never received the reply", reply1);
|
||||
assertNotNull("XMPPConnection 0 never received the reply", reply1);
|
||||
info = MultipleRecipientManager.getMultipleRecipientInfo(reply1);
|
||||
assertNotNull("Replied message does not contain MultipleRecipientInfo", info);
|
||||
assertFalse("Replied message should be 'replyable'", info.shouldNotReply());
|
||||
|
|
@ -159,7 +159,7 @@ public class MultipleRecipientManagerTest extends SmackTestCase {
|
|||
|
||||
// Get the reply and ensure it's ok
|
||||
reply2 = (Message) collector1.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNotNull("Connection 1 never received the reply", reply2);
|
||||
assertNotNull("XMPPConnection 1 never received the reply", reply2);
|
||||
info = MultipleRecipientManager.getMultipleRecipientInfo(reply2);
|
||||
assertNotNull("Replied message does not contain MultipleRecipientInfo", info);
|
||||
assertFalse("Replied message should be 'replyable'", info.shouldNotReply());
|
||||
|
|
@ -168,19 +168,19 @@ public class MultipleRecipientManagerTest extends SmackTestCase {
|
|||
|
||||
// Check that connection2 recevied 3 messages
|
||||
message1 = (Message) collector2.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNotNull("Connection2 didn't receive the 1 message", message1);
|
||||
assertNotNull("XMPPConnection2 didn't receive the 1 message", message1);
|
||||
message1 = (Message) collector2.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNotNull("Connection2 didn't receive the 2 message", message1);
|
||||
assertNotNull("XMPPConnection2 didn't receive the 2 message", message1);
|
||||
message1 = (Message) collector2.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNotNull("Connection2 didn't receive the 3 message", message1);
|
||||
assertNotNull("XMPPConnection2 didn't receive the 3 message", message1);
|
||||
message1 = (Message) collector2.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNull("Connection2 received 4 messages", message1);
|
||||
assertNull("XMPPConnection2 received 4 messages", message1);
|
||||
|
||||
// Check that connection3 recevied only 1 message (was BCC in the first message)
|
||||
message1 = (Message) collector3.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNotNull("Connection3 didn't receive the 1 message", message1);
|
||||
assertNotNull("XMPPConnection3 didn't receive the 1 message", message1);
|
||||
message1 = (Message) collector3.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNull("Connection2 received 2 messages", message1);
|
||||
assertNull("XMPPConnection2 received 2 messages", message1);
|
||||
|
||||
collector0.cancel();
|
||||
collector1.cancel();
|
||||
|
|
@ -210,7 +210,7 @@ public class MultipleRecipientManagerTest extends SmackTestCase {
|
|||
// Get the message and ensure it's ok
|
||||
Message message1 =
|
||||
(Message) collector1.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNotNull("Connection 1 never received the message", message1);
|
||||
assertNotNull("XMPPConnection 1 never received the message", message1);
|
||||
MultipleRecipientInfo info = MultipleRecipientManager.getMultipleRecipientInfo(message1);
|
||||
assertNotNull("Message 1 does not contain MultipleRecipientInfo", info);
|
||||
assertTrue("Message 1 should be not 'replyable'", info.shouldNotReply());
|
||||
|
|
@ -230,15 +230,15 @@ public class MultipleRecipientManagerTest extends SmackTestCase {
|
|||
|
||||
// Check that connection2 recevied 1 messages
|
||||
message1 = (Message) collector2.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNotNull("Connection2 didn't receive the 1 message", message1);
|
||||
assertNotNull("XMPPConnection2 didn't receive the 1 message", message1);
|
||||
message1 = (Message) collector2.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNull("Connection2 received 2 messages", message1);
|
||||
assertNull("XMPPConnection2 received 2 messages", message1);
|
||||
|
||||
// Check that connection3 recevied only 1 message (was BCC in the first message)
|
||||
message1 = (Message) collector3.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNotNull("Connection3 didn't receive the 1 message", message1);
|
||||
assertNotNull("XMPPConnection3 didn't receive the 1 message", message1);
|
||||
message1 = (Message) collector3.nextResult(SmackConfiguration.getPacketReplyTimeout());
|
||||
assertNull("Connection2 received 2 messages", message1);
|
||||
assertNull("XMPPConnection2 received 2 messages", message1);
|
||||
|
||||
collector1.cancel();
|
||||
collector2.cancel();
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import java.io.OutputStream;
|
|||
import java.util.Random;
|
||||
import java.util.concurrent.SynchronousQueue;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
import org.jivesoftware.smack.filter.PacketIDFilter;
|
||||
|
|
@ -53,9 +53,9 @@ public class InBandBytestreamTest extends SmackTestCase {
|
|||
* @throws XMPPException should not happen
|
||||
*/
|
||||
public void testRespondWithErrorOnInBandBytestreamRequest() throws XMPPException {
|
||||
Connection targetConnection = getConnection(0);
|
||||
XMPPConnection targetConnection = getConnection(0);
|
||||
|
||||
Connection initiatorConnection = getConnection(1);
|
||||
XMPPConnection initiatorConnection = getConnection(1);
|
||||
|
||||
Open open = new Open("sessionID", 1024);
|
||||
open.setFrom(initiatorConnection.getUser());
|
||||
|
|
@ -78,8 +78,8 @@ public class InBandBytestreamTest extends SmackTestCase {
|
|||
*/
|
||||
public void testInBandBytestreamWithIQStanzas() throws Exception {
|
||||
|
||||
Connection initiatorConnection = getConnection(0);
|
||||
Connection targetConnection = getConnection(1);
|
||||
XMPPConnection initiatorConnection = getConnection(0);
|
||||
XMPPConnection targetConnection = getConnection(1);
|
||||
|
||||
// test data
|
||||
Random rand = new Random();
|
||||
|
|
@ -132,8 +132,8 @@ public class InBandBytestreamTest extends SmackTestCase {
|
|||
*/
|
||||
public void testInBandBytestreamWithMessageStanzas() throws Exception {
|
||||
|
||||
Connection initiatorConnection = getConnection(0);
|
||||
Connection targetConnection = getConnection(1);
|
||||
XMPPConnection initiatorConnection = getConnection(0);
|
||||
XMPPConnection targetConnection = getConnection(1);
|
||||
|
||||
// test data
|
||||
Random rand = new Random();
|
||||
|
|
@ -188,9 +188,9 @@ public class InBandBytestreamTest extends SmackTestCase {
|
|||
*/
|
||||
public void testBiDirectionalInBandBytestream() throws Exception {
|
||||
|
||||
Connection initiatorConnection = getConnection(0);
|
||||
XMPPConnection initiatorConnection = getConnection(0);
|
||||
|
||||
Connection targetConnection = getConnection(1);
|
||||
XMPPConnection targetConnection = getConnection(1);
|
||||
|
||||
// test data
|
||||
Random rand = new Random();
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import java.util.concurrent.SynchronousQueue;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.SmackConfiguration;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
|
|
@ -60,7 +60,7 @@ public class Socks5ByteStreamTest extends SmackTestCase {
|
|||
* @throws XMPPException should not happen
|
||||
*/
|
||||
public void testInitializationSocks5FeaturesAndListenerOnStartup() throws XMPPException {
|
||||
Connection connection = getConnection(0);
|
||||
XMPPConnection connection = getConnection(0);
|
||||
|
||||
assertTrue(ServiceDiscoveryManager.getInstanceFor(connection).includesFeature(
|
||||
Socks5BytestreamManager.NAMESPACE));
|
||||
|
|
@ -74,9 +74,9 @@ public class Socks5ByteStreamTest extends SmackTestCase {
|
|||
* @throws XMPPException should not happen
|
||||
*/
|
||||
public void testRespondWithErrorOnSocks5BytestreamRequest() throws XMPPException {
|
||||
Connection targetConnection = getConnection(0);
|
||||
XMPPConnection targetConnection = getConnection(0);
|
||||
|
||||
Connection initiatorConnection = getConnection(1);
|
||||
XMPPConnection initiatorConnection = getConnection(1);
|
||||
|
||||
Bytestream bytestreamInitiation = Socks5PacketUtils.createBytestreamInitiation(
|
||||
initiatorConnection.getUser(), targetConnection.getUser(), "session_id");
|
||||
|
|
@ -107,8 +107,8 @@ public class Socks5ByteStreamTest extends SmackTestCase {
|
|||
|
||||
assertTrue(socks5Proxy.isRunning());
|
||||
|
||||
Connection initiatorConnection = getConnection(0);
|
||||
Connection targetConnection = getConnection(1);
|
||||
XMPPConnection initiatorConnection = getConnection(0);
|
||||
XMPPConnection targetConnection = getConnection(1);
|
||||
|
||||
// test data
|
||||
final byte[] data = new byte[] { 1, 2, 3 };
|
||||
|
|
@ -174,8 +174,8 @@ public class Socks5ByteStreamTest extends SmackTestCase {
|
|||
|
||||
assertFalse(Socks5Proxy.getSocks5Proxy().isRunning());
|
||||
|
||||
Connection initiatorConnection = getConnection(0);
|
||||
Connection targetConnection = getConnection(1);
|
||||
XMPPConnection initiatorConnection = getConnection(0);
|
||||
XMPPConnection targetConnection = getConnection(1);
|
||||
|
||||
// test data
|
||||
final byte[] data = new byte[] { 1, 2, 3 };
|
||||
|
|
@ -243,7 +243,7 @@ public class Socks5ByteStreamTest extends SmackTestCase {
|
|||
*/
|
||||
public void testBiDirectionalSocks5BytestreamWithRemoteSocks5Proxy() throws Exception {
|
||||
|
||||
Connection initiatorConnection = getConnection(0);
|
||||
XMPPConnection initiatorConnection = getConnection(0);
|
||||
|
||||
// disable local socks5 proxy
|
||||
SmackConfiguration.setLocalSocks5ProxyEnabled(false);
|
||||
|
|
@ -251,7 +251,7 @@ public class Socks5ByteStreamTest extends SmackTestCase {
|
|||
|
||||
assertFalse(Socks5Proxy.getSocks5Proxy().isRunning());
|
||||
|
||||
Connection targetConnection = getConnection(1);
|
||||
XMPPConnection targetConnection = getConnection(1);
|
||||
|
||||
// test data
|
||||
final byte[] data = new byte[] { 1, 2, 3 };
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import java.util.TimeZone;
|
|||
|
||||
import org.jivesoftware.smack.Chat;
|
||||
import org.jivesoftware.smack.ChatManagerListener;
|
||||
import org.jivesoftware.smack.Connection;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.ConnectionConfiguration;
|
||||
import org.jivesoftware.smack.PacketCollector;
|
||||
import org.jivesoftware.smack.SmackConfiguration;
|
||||
|
|
@ -263,7 +263,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User3 is listening to MUC invitations
|
||||
MultiUserChat.addInvitationListener(getConnection(2), new InvitationListener() {
|
||||
public void invitationReceived(
|
||||
Connection conn,
|
||||
XMPPConnection conn,
|
||||
String room,
|
||||
String inviter,
|
||||
String reason,
|
||||
|
|
@ -313,7 +313,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User3 is listening to MUC invitations
|
||||
MultiUserChat.addInvitationListener(getConnection(2), new InvitationListener() {
|
||||
public void invitationReceived(
|
||||
Connection conn,
|
||||
XMPPConnection conn,
|
||||
String room,
|
||||
String inviter,
|
||||
String reason,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue