mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-05 12:41:08 +01:00
Enable trailing whitespace checkstyle check
for all source code regions, including javadoc.
This commit is contained in:
parent
9d61a6de7d
commit
e8923b9d16
545 changed files with 3713 additions and 3715 deletions
|
|
@ -24,8 +24,8 @@ import org.jivesoftware.smack.filter.PacketFilter;
|
|||
import org.jivesoftware.smack.filter.StanzaExtensionFilter;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
* @author Matt Tucker
|
||||
*/
|
||||
public class GroupChatInvitationTest extends SmackTestCase {
|
||||
|
|
|
|||
|
|
@ -37,10 +37,10 @@ public class MessageEventManagerTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* High level API test.
|
||||
* This is a simple test to use with an XMPP client and check if the client receives the
|
||||
* This is a simple test to use with an XMPP client and check if the client receives the
|
||||
* message
|
||||
* 1. User_1 will send a message to user_2 requesting to be notified when any of these events
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
*/
|
||||
public void testSendMessageEventRequest() {
|
||||
// Create a chat for each connection
|
||||
|
|
@ -64,10 +64,10 @@ public class MessageEventManagerTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* High level API test.
|
||||
* This is a simple test to use with an XMPP client, check if the client receives the
|
||||
* This is a simple test to use with an XMPP client, check if the client receives the
|
||||
* message and display in the console any notification
|
||||
* 1. User_1 will send a message to user_2 requesting to be notified when any of these events
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
* 2. User_2 will use an XMPP client (like Exodus) to display the message and compose a reply
|
||||
* 3. User_1 will display any notification that receives
|
||||
*/
|
||||
|
|
@ -120,9 +120,9 @@ public class MessageEventManagerTest extends SmackTestCase {
|
|||
/**
|
||||
* High level API test.
|
||||
* 1. User_1 will send a message to user_2 requesting to be notified when any of these events
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
* 2. User_2 will receive the message
|
||||
* 3. User_2 will simulate that the message was displayed
|
||||
* 3. User_2 will simulate that the message was displayed
|
||||
* 4. User_2 will simulate that he/she is composing a reply
|
||||
* 5. User_2 will simulate that he/she has cancelled the reply
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class RosterExchangeManagerTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* High level API test.
|
||||
* This is a simple test to use with an XMPP client and check if the client receives user1's
|
||||
* This is a simple test to use with an XMPP client and check if the client receives user1's
|
||||
* roster
|
||||
* 1. User_1 will send his/her roster to user_2
|
||||
*/
|
||||
|
|
@ -62,7 +62,7 @@ public class RosterExchangeManagerTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* High level API test.
|
||||
* This is a simple test to use with an XMPP client and check if the client receives user1's
|
||||
* This is a simple test to use with an XMPP client and check if the client receives user1's
|
||||
* roster groups
|
||||
* 1. User_1 will send his/her RosterGroups to user_2
|
||||
*/
|
||||
|
|
@ -84,7 +84,7 @@ public class RosterExchangeManagerTest extends SmackTestCase {
|
|||
* High level API test.
|
||||
* 1. User_1 will send his/her roster to user_2
|
||||
* 2. User_2 will receive the entries and iterate over them to check if everything is fine
|
||||
* 3. User_1 will wait several seconds for an ACK from user_2, if none is received then
|
||||
* 3. User_1 will wait several seconds for an ACK from user_2, if none is received then
|
||||
* something is wrong
|
||||
*/
|
||||
public void testSendAndReceiveRoster() {
|
||||
|
|
@ -132,9 +132,9 @@ public class RosterExchangeManagerTest extends SmackTestCase {
|
|||
/**
|
||||
* High level API test.
|
||||
* 1. User_1 will send his/her roster to user_2
|
||||
* 2. User_2 will automatically add the entries that receives to his/her roster in the
|
||||
* 2. User_2 will automatically add the entries that receives to his/her roster in the
|
||||
* corresponding group
|
||||
* 3. User_1 will wait several seconds for an ACK from user_2, if none is received then
|
||||
* 3. User_1 will wait several seconds for an ACK from user_2, if none is received then
|
||||
* something is wrong
|
||||
*/
|
||||
public void testSendAndAcceptRoster() {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import org.jivesoftware.smackx.packet.DiscoverInfo.Identity;
|
|||
|
||||
/**
|
||||
* Tests the service discovery functionality.
|
||||
*
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
public class ServiceDiscoveryManagerTest extends SmackTestCase {
|
||||
|
|
@ -37,7 +37,7 @@ public class ServiceDiscoveryManagerTest extends SmackTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests info discovery of a Smack client.
|
||||
* Tests info discovery of a Smack client.
|
||||
*/
|
||||
public void testSmackInfo() {
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ public class ServiceDiscoveryManagerTest extends SmackTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Tests service discovery of XHTML support.
|
||||
* Tests service discovery of XHTML support.
|
||||
*/
|
||||
public void testXHTMLFeature() {
|
||||
// Check for local XHTML service support
|
||||
|
|
@ -94,17 +94,17 @@ public class ServiceDiscoveryManagerTest extends SmackTestCase {
|
|||
assertTrue(XHTMLManager.isServiceEnabled(getConnection(0)));
|
||||
assertTrue(XHTMLManager.isServiceEnabled(getConnection(1)));
|
||||
// Check for XHTML support in connection1 from connection2
|
||||
// Must specify a full JID and not a bare JID. Ensure that the server is working ok.
|
||||
// Must specify a full JID and not a bare JID. Ensure that the server is working ok.
|
||||
assertFalse(XHTMLManager.isServiceEnabled(getConnection(1), getBareJID(0)));
|
||||
// Using a full JID check that the other client supports XHTML.
|
||||
// Using a full JID check that the other client supports XHTML.
|
||||
assertTrue(XHTMLManager.isServiceEnabled(getConnection(1), getFullJID(0)));
|
||||
|
||||
// Disable the XHTML Message support in connection1
|
||||
XHTMLManager.setServiceEnabled(getConnection(0), false);
|
||||
// Check for local XHTML service support
|
||||
// Check for local XHTML service support
|
||||
assertFalse(XHTMLManager.isServiceEnabled(getConnection(0)));
|
||||
assertTrue(XHTMLManager.isServiceEnabled(getConnection(1)));
|
||||
// Check for XHTML support in connection1 from connection2
|
||||
// Check for XHTML support in connection1 from connection2
|
||||
assertFalse(XHTMLManager.isServiceEnabled(getConnection(1), getFullJID(0)));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,9 +82,9 @@ public class XHTMLManagerTest extends SmackTestCase {
|
|||
/**
|
||||
* High level API test.
|
||||
* 1. User_1 will send a message with XHTML to user_2
|
||||
* 2. User_2 will receive the message and iterate over the XHTML bodies to check if everything
|
||||
* 2. User_2 will receive the message and iterate over the XHTML bodies to check if everything
|
||||
* is fine
|
||||
* 3. User_1 will wait several seconds for an ACK from user_2, if none is received then
|
||||
* 3. User_1 will wait several seconds for an ACK from user_2, if none is received then
|
||||
* something is wrong
|
||||
*/
|
||||
public void testSendSimpleXHTMLMessageAndDisplayReceivedXHTMLMessage() {
|
||||
|
|
@ -142,9 +142,9 @@ public class XHTMLManagerTest extends SmackTestCase {
|
|||
/**
|
||||
* Low level API test. Test a message with two XHTML bodies and several XHTML tags.
|
||||
* 1. User_1 will send a message with XHTML to user_2
|
||||
* 2. User_2 will receive the message and iterate over the XHTML bodies to check if everything
|
||||
* 2. User_2 will receive the message and iterate over the XHTML bodies to check if everything
|
||||
* is fine
|
||||
* 3. User_1 will wait several seconds for an ACK from user_2, if none is received then
|
||||
* 3. User_1 will wait several seconds for an ACK from user_2, if none is received then
|
||||
* something is wrong
|
||||
*/
|
||||
public void testSendComplexXHTMLMessageAndDisplayReceivedXHTMLMessage() {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import org.jivesoftware.smackx.bytestreams.ibb.packet.Open;
|
|||
|
||||
/**
|
||||
* Test for In-Band Bytestreams with real XMPP servers.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class InBandBytestreamTest extends SmackTestCase {
|
||||
|
|
@ -49,7 +49,7 @@ public class InBandBytestreamTest extends SmackTestCase {
|
|||
/**
|
||||
* Target should respond with not-acceptable error if no listeners for incoming In-Band
|
||||
* Bytestream requests are registered.
|
||||
*
|
||||
*
|
||||
* @throws XMPPException should not happen
|
||||
*/
|
||||
public void testRespondWithErrorOnInBandBytestreamRequest() throws XMPPException {
|
||||
|
|
@ -73,7 +73,7 @@ public class InBandBytestreamTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* An In-Band Bytestream should be successfully established using IQ stanzas.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
public void testInBandBytestreamWithIQStanzas() throws Exception {
|
||||
|
|
@ -127,7 +127,7 @@ public class InBandBytestreamTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* An In-Band Bytestream should be successfully established using message stanzas.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
public void testInBandBytestreamWithMessageStanzas() throws Exception {
|
||||
|
|
@ -183,7 +183,7 @@ public class InBandBytestreamTest extends SmackTestCase {
|
|||
/**
|
||||
* An In-Band Bytestream should be successfully established using IQ stanzas. The established
|
||||
* session should transfer data bidirectional.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
public void testBiDirectionalInBandBytestream() throws Exception {
|
||||
|
|
|
|||
|
|
@ -40,14 +40,14 @@ import org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream;
|
|||
|
||||
/**
|
||||
* Test for Socks5 bytestreams with real XMPP servers.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class Socks5ByteStreamTest extends SmackTestCase {
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
*
|
||||
* @param arg0
|
||||
*/
|
||||
public Socks5ByteStreamTest(String arg0) {
|
||||
|
|
@ -56,7 +56,7 @@ public class Socks5ByteStreamTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* Socks5 feature should be added to the service discovery on Smack startup.
|
||||
*
|
||||
*
|
||||
* @throws XMPPException should not happen
|
||||
*/
|
||||
public void testInitializationSocks5FeaturesAndListenerOnStartup() throws XMPPException {
|
||||
|
|
@ -70,7 +70,7 @@ public class Socks5ByteStreamTest extends SmackTestCase {
|
|||
/**
|
||||
* Target should respond with not-acceptable error if no listeners for incoming Socks5
|
||||
* bytestream requests are registered.
|
||||
*
|
||||
*
|
||||
* @throws XMPPException should not happen
|
||||
*/
|
||||
public void testRespondWithErrorOnSocks5BytestreamRequest() throws XMPPException {
|
||||
|
|
@ -94,7 +94,7 @@ public class Socks5ByteStreamTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* Socks5 bytestream should be successfully established using the local Socks5 proxy.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
public void testSocks5BytestreamWithLocalSocks5Proxy() throws Exception {
|
||||
|
|
@ -162,7 +162,7 @@ public class Socks5ByteStreamTest extends SmackTestCase {
|
|||
* This test will fail if the XMPP server doesn't provide any Socks5 proxies or the Socks5 proxy
|
||||
* only allows Socks5 bytestreams in the context of a file transfer (like Openfire in default
|
||||
* configuration, see xmpp.proxy.transfer.required flag).
|
||||
*
|
||||
*
|
||||
* @throws Exception if no Socks5 proxies found or proxy is unwilling to activate Socks5
|
||||
* bytestream
|
||||
*/
|
||||
|
|
@ -237,7 +237,7 @@ public class Socks5ByteStreamTest extends SmackTestCase {
|
|||
* This test will fail if the XMPP server doesn't provide any Socks5 proxies or the Socks5 proxy
|
||||
* only allows Socks5 bytestreams in the context of a file transfer (like Openfire in default
|
||||
* configuration, see xmpp.proxy.transfer.required flag).
|
||||
*
|
||||
*
|
||||
* @throws Exception if no Socks5 proxies found or proxy is unwilling to activate Socks5
|
||||
* bytestream
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ import org.jivesoftware.smackx.packet.XHTMLExtension;
|
|||
|
||||
/**
|
||||
* Tests the new MUC functionalities.
|
||||
*
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
public class MultiUserChatTest extends SmackTestCase {
|
||||
|
|
@ -67,7 +67,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
*/
|
||||
public void testGroupchatCompatibility() {
|
||||
// TODO: this test needs to be re-written so that it manually emulates the old-style
|
||||
// TODO: group chat protocol. Tne GroupChat class was deleted for Smack 3.0.
|
||||
// TODO: group chat protocol. Tne GroupChat class was deleted for Smack 3.0.
|
||||
/*try {
|
||||
Message message;
|
||||
|
||||
|
|
@ -132,7 +132,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
System.out.println(UTC_FORMAT.format(delay.getStamp()));
|
||||
|
||||
assertEquals("Body of first message is incorrect", "Message 3", msg.getBody());
|
||||
// Try to get second historic message
|
||||
// Try to get second historic message
|
||||
msg = muc2.nextMessage(1000);
|
||||
assertNull("Second message is not null", msg);
|
||||
|
||||
|
|
@ -143,15 +143,15 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
history.setMaxStanzas(2);
|
||||
muc3.join("testbot3", null, history, SmackConfiguration.getPacketReplyTimeout());
|
||||
|
||||
// Get first historic message
|
||||
// Get first historic message
|
||||
msg = muc3.nextMessage(1000);
|
||||
assertNotNull("First message is null", msg);
|
||||
assertEquals("Body of first message is incorrect", "Message 2", msg.getBody());
|
||||
// Get second historic message
|
||||
// Get second historic message
|
||||
msg = muc3.nextMessage(1000);
|
||||
assertNotNull("Second message is null", msg);
|
||||
assertEquals("Body of second message is incorrect", "Message 3", msg.getBody());
|
||||
// Try to get third historic message
|
||||
// Try to get third historic message
|
||||
msg = muc3.nextMessage(1000);
|
||||
assertNull("Third message is not null", msg);
|
||||
|
||||
|
|
@ -451,7 +451,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
}
|
||||
});
|
||||
|
||||
// Start a private chat with another participant
|
||||
// Start a private chat with another participant
|
||||
Chat chat = muc2.createPrivateChat(room + "/testbot", null);
|
||||
StanzaCollector collector = chat.createCollector();
|
||||
chat.sendMessage("Hello there");
|
||||
|
|
@ -598,7 +598,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
}
|
||||
});
|
||||
|
||||
// Check that a 403 error is received when a not allowed user tries to change the
|
||||
// Check that a 403 error is received when a not allowed user tries to change the
|
||||
// subject in a room
|
||||
try {
|
||||
muc2.changeSubject("New Subject2");
|
||||
|
|
@ -615,7 +615,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
xmppError.getCode());
|
||||
}
|
||||
|
||||
// Check that every MUC updates its subject when an allowed user changes the subject
|
||||
// Check that every MUC updates its subject when an allowed user changes the subject
|
||||
// in a room
|
||||
muc.changeSubject("New Subject1");
|
||||
Thread.sleep(300);
|
||||
|
|
@ -651,7 +651,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User2 joins the new room
|
||||
MultiUserChat muc2 = new MultiUserChat(getConnection(1), room);
|
||||
muc2.join("testbot2");
|
||||
// User2 will lister for his own "kicking"
|
||||
// User2 will lister for his own "kicking"
|
||||
muc2.addUserStatusListener(new DefaultUserStatusListener() {
|
||||
public void kicked(String actor, String reason) {
|
||||
super.kicked(actor, reason);
|
||||
|
|
@ -663,7 +663,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User3 joins the new room
|
||||
MultiUserChat muc3 = new MultiUserChat(getConnection(2), room);
|
||||
muc3.join("testbot3");
|
||||
// User3 will lister for user2's "kicking"
|
||||
// User3 will lister for user2's "kicking"
|
||||
muc3.addParticipantStatusListener(new DefaultParticipantStatusListener() {
|
||||
public void kicked(String participant, String actor, String reason) {
|
||||
super.kicked(participant, actor, reason);
|
||||
|
|
@ -728,7 +728,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User2 joins the new room
|
||||
MultiUserChat muc2 = new MultiUserChat(getConnection(1), room);
|
||||
muc2.join("testbot2");
|
||||
// User2 will lister for his own "banning"
|
||||
// User2 will lister for his own "banning"
|
||||
muc2.addUserStatusListener(new DefaultUserStatusListener() {
|
||||
public void banned(String actor, String reason) {
|
||||
super.banned(actor, reason);
|
||||
|
|
@ -740,7 +740,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User3 joins the new room
|
||||
MultiUserChat muc3 = new MultiUserChat(getConnection(2), room);
|
||||
muc3.join("testbot3");
|
||||
// User3 will lister for user2's "banning"
|
||||
// User3 will lister for user2's "banning"
|
||||
muc3.addParticipantStatusListener(new DefaultParticipantStatusListener() {
|
||||
public void banned(String participant, String actor, String reason) {
|
||||
super.banned(participant, actor, reason);
|
||||
|
|
@ -808,7 +808,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User2 joins the new room (as a visitor)
|
||||
MultiUserChat muc2 = new MultiUserChat(getConnection(1), room);
|
||||
muc2.join("testbot2");
|
||||
// User2 will listen for his own "voice"
|
||||
// User2 will listen for his own "voice"
|
||||
muc2.addUserStatusListener(new DefaultUserStatusListener() {
|
||||
public void voiceGranted() {
|
||||
super.voiceGranted();
|
||||
|
|
@ -823,7 +823,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User3 joins the new room (as a visitor)
|
||||
MultiUserChat muc3 = new MultiUserChat(getConnection(2), room);
|
||||
muc3.join("testbot3");
|
||||
// User3 will lister for user2's "voice"
|
||||
// User3 will lister for user2's "voice"
|
||||
muc3.addParticipantStatusListener(new DefaultParticipantStatusListener() {
|
||||
public void voiceGranted(String participant) {
|
||||
super.voiceGranted(participant);
|
||||
|
|
@ -898,7 +898,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User2 joins the new room (as a visitor)
|
||||
MultiUserChat muc2 = new MultiUserChat(getConnection(1), room);
|
||||
muc2.join("testbot2");
|
||||
// User2 will listen for moderator privileges
|
||||
// User2 will listen for moderator privileges
|
||||
muc2.addUserStatusListener(new DefaultUserStatusListener() {
|
||||
public void voiceGranted() {
|
||||
super.voiceGranted();
|
||||
|
|
@ -921,7 +921,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User3 joins the new room (as a visitor)
|
||||
MultiUserChat muc3 = new MultiUserChat(getConnection(2), room);
|
||||
muc3.join("testbot3");
|
||||
// User3 will lister for user2's moderator privileges
|
||||
// User3 will lister for user2's moderator privileges
|
||||
muc3.addParticipantStatusListener(new DefaultParticipantStatusListener() {
|
||||
public void voiceGranted(String participant) {
|
||||
super.voiceGranted(participant);
|
||||
|
|
@ -1045,7 +1045,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User2 joins the new room (as a visitor)
|
||||
MultiUserChat muc2 = new MultiUserChat(getConnection(1), room);
|
||||
muc2.join("testbot2");
|
||||
// User2 will listen for membership privileges
|
||||
// User2 will listen for membership privileges
|
||||
muc2.addUserStatusListener(new DefaultUserStatusListener() {
|
||||
public void membershipGranted() {
|
||||
super.membershipGranted();
|
||||
|
|
@ -1060,7 +1060,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User3 joins the new room (as a visitor)
|
||||
MultiUserChat muc3 = new MultiUserChat(getConnection(2), room);
|
||||
muc3.join("testbot3");
|
||||
// User3 will lister for user2's membership privileges
|
||||
// User3 will lister for user2's membership privileges
|
||||
muc3.addParticipantStatusListener(new DefaultParticipantStatusListener() {
|
||||
public void membershipGranted(String participant) {
|
||||
super.membershipGranted(participant);
|
||||
|
|
@ -1139,7 +1139,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User2 joins the new room (as a visitor)
|
||||
MultiUserChat muc2 = new MultiUserChat(getConnection(1), room);
|
||||
muc2.join("testbot2");
|
||||
// User2 will listen for admin privileges
|
||||
// User2 will listen for admin privileges
|
||||
muc2.addUserStatusListener(new DefaultUserStatusListener() {
|
||||
public void membershipGranted() {
|
||||
super.membershipGranted();
|
||||
|
|
@ -1162,7 +1162,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User3 joins the new room (as a visitor)
|
||||
MultiUserChat muc3 = new MultiUserChat(getConnection(2), room);
|
||||
muc3.join("testbot3");
|
||||
// User3 will lister for user2's admin privileges
|
||||
// User3 will lister for user2's admin privileges
|
||||
muc3.addParticipantStatusListener(new DefaultParticipantStatusListener() {
|
||||
public void membershipGranted(String participant) {
|
||||
super.membershipGranted(participant);
|
||||
|
|
@ -1298,7 +1298,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User2 joins the new room (as a visitor)
|
||||
MultiUserChat muc2 = new MultiUserChat(getConnection(1), room);
|
||||
muc2.join("testbot2");
|
||||
// User2 will listen for ownership privileges
|
||||
// User2 will listen for ownership privileges
|
||||
muc2.addUserStatusListener(new DefaultUserStatusListener() {
|
||||
public void membershipGranted() {
|
||||
super.membershipGranted();
|
||||
|
|
@ -1329,7 +1329,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
// User3 joins the new room (as a visitor)
|
||||
MultiUserChat muc3 = new MultiUserChat(getConnection(2), room);
|
||||
muc3.join("testbot3");
|
||||
// User3 will lister for user2's ownership privileges
|
||||
// User3 will lister for user2's ownership privileges
|
||||
muc3.addParticipantStatusListener(new DefaultParticipantStatusListener() {
|
||||
public void membershipGranted(String participant) {
|
||||
super.membershipGranted(participant);
|
||||
|
|
@ -1624,7 +1624,7 @@ public class MultiUserChatTest extends SmackTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Check that ParticipantStatusListener is receiving joining and leaving events correctly.
|
||||
* Check that ParticipantStatusListener is receiving joining and leaving events correctly.
|
||||
*/
|
||||
public void testJoinLeftEvents() {
|
||||
final String[] answer = new String[8];
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ public class MessageEventTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* Low level API test.
|
||||
* This is a simple test to use with an XMPP client and check if the client receives the
|
||||
* This is a simple test to use with an XMPP client and check if the client receives the
|
||||
* message
|
||||
* 1. User_1 will send a message to user_2 requesting to be notified when any of these events
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
*/
|
||||
public void testSendMessageEventRequest() {
|
||||
// Create a chat for each connection
|
||||
|
|
@ -70,10 +70,10 @@ public class MessageEventTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* Low level API test.
|
||||
* This is a simple test to use with an XMPP client, check if the client receives the
|
||||
* This is a simple test to use with an XMPP client, check if the client receives the
|
||||
* message and display in the console any notification
|
||||
* 1. User_1 will send a message to user_2 requesting to be notified when any of these events
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
* occurs: offline, composing, displayed or delivered
|
||||
* 2. User_2 will use an XMPP client (like Exodus) to display the message and compose a reply
|
||||
* 3. User_1 will display any notification that receives
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ public class XHTMLExtensionTest extends SmackTestCase {
|
|||
final StanzaCollector chat2 = getConnection(1).createStanzaCollector(
|
||||
new ThreadFilter(chat1.getThreadID()));
|
||||
|
||||
// Create a Listener that listens for Messages with the extension
|
||||
// Create a Listener that listens for Messages with the extension
|
||||
//"http://jabber.org/protocol/xhtml-im"
|
||||
// This listener will listen on the conn2 and answer an ACK if everything is ok
|
||||
PacketFilter packetFilter =
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub;
|
|||
import org.jivesoftware.smack.packet.PacketExtension;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
@ -56,7 +56,7 @@ class CarExtension implements PacketExtension
|
|||
|
||||
public String toXML()
|
||||
{
|
||||
return "<" + getElementName() + " xmlns='" + getNamespace() + "'><paint color='" +
|
||||
return "<" + getElementName() + " xmlns='" + getNamespace() + "'><paint color='" +
|
||||
getColor() + "'/><tires num='" + getNumTires() + "'/></" + getElementName() + ">";
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import org.jivesoftware.smack.provider.PacketExtensionProvider;
|
|||
import org.xmlpull.v1.XmlPullParser;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import org.jivesoftware.smackx.packet.DiscoverInfo.Identity;
|
|||
import org.jivesoftware.smackx.pubsub.test.SingleUserTestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
@ -76,7 +76,7 @@ public class EntityUseCases extends SingleUserTestCase
|
|||
|
||||
assertTrue(subscriptions.size() < 3);
|
||||
|
||||
for (Subscription subscription : subscriptions)
|
||||
for (Subscription subscription : subscriptions)
|
||||
{
|
||||
assertNull(subscription.getNode());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import org.jivesoftware.smack.packet.XMPPError;
|
|||
import org.jivesoftware.smackx.pubsub.test.PubSubTestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import org.jivesoftware.smack.XMPPException;
|
|||
import org.jivesoftware.smackx.pubsub.test.SingleUserTestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ import org.jivesoftware.smackx.pubsub.packet.PubSubNamespace;
|
|||
import org.jivesoftware.smackx.pubsub.test.SingleUserTestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
@ -69,9 +69,9 @@ public class PublisherUseCases extends SingleUserTestCase
|
|||
public void testSendNodeTrPay_WithPayload() throws XMPPException
|
||||
{
|
||||
LeafNode node = getPubnode(false, true);
|
||||
node.send(new PayloadItem<SimplePayload>(null,
|
||||
node.send(new PayloadItem<SimplePayload>(null,
|
||||
new SimplePayload("book", "pubsub:test:book", "<book xmlns='pubsub:test:book'><title>Lord of the Rings</title></book>")));
|
||||
node.send(new PayloadItem<SimplePayload>("test" + System.currentTimeMillis(),
|
||||
node.send(new PayloadItem<SimplePayload>("test" + System.currentTimeMillis(),
|
||||
new SimplePayload("book", "pubsub:test:book", "<book xmlns='pubsub:test:book'><title>Two Towers</title></book>")));
|
||||
}
|
||||
|
||||
|
|
@ -80,18 +80,18 @@ public class PublisherUseCases extends SingleUserTestCase
|
|||
LeafNode node = getPubnode(true, false);
|
||||
node.send(new Item());
|
||||
node.send(new Item("test" + System.currentTimeMillis()));
|
||||
node.send(new PayloadItem<SimplePayload>(null,
|
||||
node.send(new PayloadItem<SimplePayload>(null,
|
||||
new SimplePayload("book", "pubsub:test:book", "<book xmlns='pubsub:test:book'><title>Lord of the Rings</title></book>")));
|
||||
node.send(new PayloadItem<SimplePayload>("test" + System.currentTimeMillis(),
|
||||
node.send(new PayloadItem<SimplePayload>("test" + System.currentTimeMillis(),
|
||||
new SimplePayload("book", "pubsub:test:book", "<book xmlns='pubsub:test:book'><title>Two Towers</title></book>")));
|
||||
}
|
||||
|
||||
public void testSendPerPay_WithPayload() throws Exception
|
||||
{
|
||||
LeafNode node = getPubnode(true, true);
|
||||
node.send(new PayloadItem<SimplePayload>(null,
|
||||
node.send(new PayloadItem<SimplePayload>(null,
|
||||
new SimplePayload("book", "pubsub:test:book", "<book xmlns='pubsub:test:book'><title>Lord of the Rings</title></book>")));
|
||||
node.send(new PayloadItem<SimplePayload>("test" + System.currentTimeMillis(),
|
||||
node.send(new PayloadItem<SimplePayload>("test" + System.currentTimeMillis(),
|
||||
new SimplePayload("book", "pubsub:test:book", "<book xmlns='pubsub:test:book'><title>Two Towers</title></book>")));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ import org.jivesoftware.smackx.FormField;
|
|||
import org.jivesoftware.smackx.pubsub.test.SingleUserTestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
@ -138,17 +138,17 @@ public class SubscriberUseCases extends SingleUserTestCase
|
|||
}
|
||||
|
||||
// public void testSubscribeWithConfig() throws Exception
|
||||
// {
|
||||
// {
|
||||
// LeafNode node = getPubnode(false, false);
|
||||
//
|
||||
// Subscription sub = node.subscribe(getBareJID(0));
|
||||
//
|
||||
//
|
||||
// assertEquals(getBareJID(0), sub.getJid());
|
||||
// assertNotNull(sub.getId());
|
||||
// assertEquals(node.getId(), sub.getNode());
|
||||
// assertEquals(true, sub.isConfigRequired());
|
||||
// }
|
||||
//
|
||||
//
|
||||
public void testGetItems() throws Exception
|
||||
{
|
||||
LeafNode node = getPubnode(true, false);
|
||||
|
|
@ -197,7 +197,7 @@ public class SubscriberUseCases extends SingleUserTestCase
|
|||
List<PayloadItem<SimplePayload>> payloadItems = payloadNode.getItems();
|
||||
Map<String, PayloadItem<SimplePayload>> idMap = new HashMap<String, PayloadItem<SimplePayload>>();
|
||||
|
||||
for (PayloadItem<SimplePayload> payloadItem : payloadItems)
|
||||
for (PayloadItem<SimplePayload> payloadItem : payloadItems)
|
||||
{
|
||||
idMap.put(payloadItem.getId(), payloadItem);
|
||||
}
|
||||
|
|
@ -262,9 +262,9 @@ public class SubscriberUseCases extends SingleUserTestCase
|
|||
assertTrue(listContainsId("5", items));
|
||||
}
|
||||
|
||||
private static boolean listContainsId(String id, List<Item> items)
|
||||
private static boolean listContainsId(String id, List<Item> items)
|
||||
{
|
||||
for (Item item : items)
|
||||
for (Item item : items)
|
||||
{
|
||||
if (item.getId().equals(id))
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import org.jivesoftware.smack.XMPPException;
|
|||
import org.jivesoftware.smackx.pubsub.test.SingleUserTestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import org.jivesoftware.smackx.pubsub.listener.ItemEventListener;
|
|||
import org.jivesoftware.smackx.pubsub.listener.NodeConfigListener;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
@ -97,7 +97,7 @@ public class TestEvents extends SmackTestCase
|
|||
subNode.subscribe(getConnection(1).getUser());
|
||||
subNode.addConfigurationListener(sub1Handler);
|
||||
|
||||
ConfigureForm currentConfig = creatorNode.getNodeConfiguration();
|
||||
ConfigureForm currentConfig = creatorNode.getNodeConfiguration();
|
||||
ConfigureForm form = new ConfigureForm(currentConfig.createAnswerForm());
|
||||
form.setPersistentItems(true);
|
||||
form.setDeliverPayloads(false);
|
||||
|
|
@ -108,7 +108,7 @@ public class TestEvents extends SmackTestCase
|
|||
assertEquals(nodeId, event.getNode());
|
||||
assertNull(event.getConfiguration());
|
||||
|
||||
currentConfig = creatorNode.getNodeConfiguration();
|
||||
currentConfig = creatorNode.getNodeConfiguration();
|
||||
form = new ConfigureForm(currentConfig.createAnswerForm());
|
||||
form.setDeliverPayloads(true);
|
||||
creatorNode.sendConfigurationForm(form);
|
||||
|
|
@ -205,7 +205,7 @@ public class TestEvents extends SmackTestCase
|
|||
|
||||
/*
|
||||
* For this test, the following extension needs to be added to the meta-inf/smack.providers file
|
||||
*
|
||||
*
|
||||
* <extensionProvider>
|
||||
* <elementName>car</elementName>
|
||||
* <namespace>pubsub:test:vehicle</namespace>
|
||||
|
|
@ -585,7 +585,7 @@ public class TestEvents extends SmackTestCase
|
|||
}
|
||||
}
|
||||
|
||||
private static LeafNode getPubnode(PubSubManager manager, String id, boolean persistItems, boolean deliverPayload)
|
||||
private static LeafNode getPubnode(PubSubManager manager, String id, boolean persistItems, boolean deliverPayload)
|
||||
throws XMPPException
|
||||
{
|
||||
ConfigureForm form = new ConfigureForm(FormType.submit);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package org.jivesoftware.smackx.pubsub;
|
|||
import junit.framework.TestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
@ -27,7 +27,7 @@ public class TestMessageContent extends TestCase
|
|||
{
|
||||
String payloadXmlWithNS = "<book xmlns='pubsub:test:book'><author name='Stephen King'/></book>";
|
||||
|
||||
public void testItemWithId()
|
||||
public void testItemWithId()
|
||||
{
|
||||
Item item = new Item("123");
|
||||
assertEquals("<item id='123'/>", item.toXML());
|
||||
|
|
@ -35,7 +35,7 @@ public class TestMessageContent extends TestCase
|
|||
assertNull(item.getNamespace());
|
||||
}
|
||||
|
||||
public void testItemWithNoId()
|
||||
public void testItemWithNoId()
|
||||
{
|
||||
Item item = new Item();
|
||||
assertEquals("<item/>", item.toXML());
|
||||
|
|
@ -44,7 +44,7 @@ public class TestMessageContent extends TestCase
|
|||
assertEquals("<item/>", itemNull.toXML());
|
||||
}
|
||||
|
||||
public void testSimplePayload()
|
||||
public void testSimplePayload()
|
||||
{
|
||||
SimplePayload payloadNS = new SimplePayload("book", "pubsub:test:book", payloadXmlWithNS);
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import org.jivesoftware.smackx.pubsub.LeafNode;
|
|||
import org.jivesoftware.smackx.pubsub.PubSubManager;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ import org.jivesoftware.smackx.pubsub.LeafNode;
|
|||
import org.jivesoftware.smackx.pubsub.PubSubManager;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Robin Collier
|
||||
*
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue