mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-09-10 18:59:41 +02: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
|
@ -72,7 +72,7 @@ public class IQTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* Check that sending an IQ to a full JID that is offline returns an IQ ERROR instead
|
||||
* of being route to some other resource of the same user.
|
||||
* of being route to some other resource of the same user.
|
||||
*/
|
||||
public void testFullJIDToOfflineUser() {
|
||||
// Request the version from the server.
|
||||
|
|
|
@ -21,7 +21,7 @@ import org.jivesoftware.smack.test.SmackTestCase;
|
|||
import org.jivesoftware.smack.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Includes set of login tests.
|
||||
* Includes set of login tests.
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
*/
|
||||
|
|
|
@ -213,7 +213,7 @@ public class MessageTest extends SmackTestCase {
|
|||
StanzaCollector collector = getConnection(0).createStanzaCollector(new MessageTypeFilter(Message.Type.chat));
|
||||
StanzaCollector coll3 = conn3.createStanzaCollector(new MessageTypeFilter(Message.Type.chat));
|
||||
|
||||
// User1 sends a message to the bare JID of User0
|
||||
// User1 sends a message to the bare JID of User0
|
||||
Chat chat = getConnection(1).getChatManager().createChat(getBareJID(0), null);
|
||||
chat.sendMessage("Test 1");
|
||||
chat.sendMessage("Test 2");
|
||||
|
@ -325,7 +325,7 @@ public class MessageTest extends SmackTestCase {
|
|||
StanzaCollector coll3 = conn3.createStanzaCollector(new MessageTypeFilter(Message.Type.chat));
|
||||
StanzaCollector coll4 = conn4.createStanzaCollector(new MessageTypeFilter(Message.Type.chat));
|
||||
|
||||
// Send a message from this resource to indicate most recent activity
|
||||
// Send a message from this resource to indicate most recent activity
|
||||
conn3.sendStanza(new Message("admin@" + getXMPPServiceDomain()));
|
||||
|
||||
// User1 sends a message to the bare JID of User0
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.jivesoftware.smack.packet.PrivacyItem;
|
|||
/**
|
||||
* This class supports automated tests about privacy communication from the
|
||||
* server to the client.
|
||||
*
|
||||
*
|
||||
* @author Francisco Vives
|
||||
*/
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ public class ReconnectionTest extends SmackTestCase {
|
|||
private CountDownLatch countDownLatch;
|
||||
|
||||
private XMPPTCPConnectionTestListener(CountDownLatch latch) {
|
||||
countDownLatch = latch;
|
||||
countDownLatch = latch;
|
||||
}
|
||||
|
||||
private XMPPTCPConnectionTestListener() {
|
||||
|
|
|
@ -17,7 +17,7 @@ package org.jivesoftware.smack;
|
|||
/**
|
||||
* Run all tests defined in RosterTest but initialize the roster before connection is logged in and
|
||||
* authenticated.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class RosterInitializedBeforeConnectTest extends RosterSmackTest {
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.jivesoftware.smack.test.SmackTestCase;
|
|||
|
||||
/**
|
||||
* Test cases for adding the {@link RosterListener} in different connection states.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class RosterListenerTest extends SmackTestCase {
|
||||
|
|
|
@ -78,7 +78,7 @@ public class RosterSmackTest extends SmackTestCase {
|
|||
|
||||
@Override
|
||||
public void entriesAdded(Collection<String> addresses) {}
|
||||
};
|
||||
};
|
||||
|
||||
roster.addRosterListener(latchCounter);
|
||||
|
||||
|
@ -422,7 +422,7 @@ public class RosterSmackTest extends SmackTestCase {
|
|||
|
||||
/**
|
||||
* Test presence management.<p>
|
||||
*
|
||||
*
|
||||
* 1. Log in user0 from a client and user1 from 2 clients
|
||||
* 2. Create presence subscription of type BOTH between 2 users
|
||||
* 3. Check that presence is correctly delivered to both users
|
||||
|
@ -699,12 +699,12 @@ public class RosterSmackTest extends SmackTestCase {
|
|||
public void entriesUpdated(Collection<String> addresses) {}
|
||||
|
||||
@Override
|
||||
public void entriesDeleted(Collection<String> addresses) {
|
||||
public void entriesDeleted(Collection<String> addresses) {
|
||||
latch.countDown();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void entriesAdded(Collection<String> addresses) {}
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -22,9 +22,9 @@ import org.xmlpull.v1.XmlPullParserException;
|
|||
|
||||
import java.io.StringReader;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Test the PrivacyProvider class with valids privacy xmls
|
||||
*
|
||||
*
|
||||
* @author Francisco Vives
|
||||
*/
|
||||
public class PrivacyProviderTest extends SmackTestCase {
|
||||
|
@ -47,7 +47,7 @@ public class PrivacyProviderTest extends SmackTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Check the parser with an xml with all kind of stanzas.
|
||||
* Check the parser with an xml with all kind of stanzas.
|
||||
* To create the xml string based from an xml file, replace:\n with: "\n + "
|
||||
*/
|
||||
public void testFull() {
|
||||
|
@ -296,7 +296,7 @@ public class PrivacyProviderTest extends SmackTestCase {
|
|||
|
||||
|
||||
/**
|
||||
* Check the parser with an xml with empty lists. It includes the active,
|
||||
* Check the parser with an xml with empty lists. It includes the active,
|
||||
* default and special list.
|
||||
* To create the xml string based from an xml file, replace:\n with: "\n + "
|
||||
*/
|
||||
|
@ -338,7 +338,7 @@ public class PrivacyProviderTest extends SmackTestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Check the parser with an xml with empty lists. It includes the active,
|
||||
* Check the parser with an xml with empty lists. It includes the active,
|
||||
* default and special list.
|
||||
* To create the xml string based from an xml file, replace:\n with: "\n + "
|
||||
*/
|
||||
|
|
|
@ -452,7 +452,7 @@ public class PrivacyTest extends SmackTestCase {
|
|||
// Look for the same server and original items
|
||||
receivedItem = privacyItems.get(j);
|
||||
index = 0;
|
||||
while ((index < originalPrivacyItems.length)
|
||||
while ((index < originalPrivacyItems.length)
|
||||
&& (originalPrivacyItems[index].getOrder() != receivedItem.getOrder())) {
|
||||
index++;
|
||||
}
|
||||
|
@ -484,7 +484,7 @@ public class PrivacyTest extends SmackTestCase {
|
|||
/**
|
||||
* This class supports automated tests about privacy communication from the
|
||||
* server to the client.
|
||||
*
|
||||
*
|
||||
* @author Francisco Vives
|
||||
*/
|
||||
|
||||
|
|
|
@ -36,17 +36,17 @@ import org.xmlpull.v1.XmlPullParserFactory;
|
|||
import org.xmlpull.v1.XmlPullParser;
|
||||
|
||||
/**
|
||||
* Base class for all the test cases which provides a pre-configured execution context. This
|
||||
* means that any test case that subclassifies this base class will have access to a pool of
|
||||
* Base class for all the test cases which provides a pre-configured execution context. This
|
||||
* means that any test case that subclassifies this base class will have access to a pool of
|
||||
* connections and to the user of each connection. The maximum number of connections in the pool
|
||||
* can be controlled by the message {@link #getMaxConnections()} which every subclass must
|
||||
* implement.<p>
|
||||
*
|
||||
* This base class defines a default execution context (i.e. host, port, chat domain and muc
|
||||
* can be controlled by the message {@link #getMaxConnections()} which every subclass must
|
||||
* implement.<p>
|
||||
*
|
||||
* This base class defines a default execution context (i.e. host, port, chat domain and muc
|
||||
* domain) which can be found in the file "config/test-case.xml". However, each subclass could
|
||||
* redefine the default configuration by providing its own configuration file (if desired). The
|
||||
* name of the configuration file must be of the form <test class name>.xml (e.g. RosterTest.xml).
|
||||
* The file must be placed in the folder "config". This folder is where the default configuration
|
||||
* The file must be placed in the folder "config". This folder is where the default configuration
|
||||
* file is being held.
|
||||
*
|
||||
* @author Gaston Dombiak
|
||||
|
@ -81,21 +81,21 @@ public abstract class SmackTestCase extends TestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the maximum number of connections to initialize for this test case. All the
|
||||
* initialized connections will be connected to the server using a new test account for
|
||||
* each conection.
|
||||
*
|
||||
* Returns the maximum number of connections to initialize for this test case. All the
|
||||
* initialized connections will be connected to the server using a new test account for
|
||||
* each conection.
|
||||
*
|
||||
* @return the maximum number of connections to initialize for this test case.
|
||||
*/
|
||||
protected abstract int getMaxConnections();
|
||||
|
||||
/**
|
||||
* Returns a SocketFactory that will be used to create the socket to the XMPP server. By
|
||||
* Returns a SocketFactory that will be used to create the socket to the XMPP server. By
|
||||
* default no SocketFactory is used but subclasses my want to redefine this method.<p>
|
||||
*
|
||||
* A custom SocketFactory allows fine-grained control of the actual connection to the XMPP
|
||||
*
|
||||
* A custom SocketFactory allows fine-grained control of the actual connection to the XMPP
|
||||
* server. A typical use for a custom SocketFactory is when connecting through a SOCKS proxy.
|
||||
*
|
||||
*
|
||||
* @return a SocketFactory that will be used to create the socket to the XMPP server.
|
||||
*/
|
||||
protected SocketFactory getSocketFactory() {
|
||||
|
@ -111,7 +111,7 @@ public abstract class SmackTestCase extends TestCase {
|
|||
* <p>
|
||||
* Connections are connected by default.
|
||||
* Overwrite this method if the test case needs unconnected connections.
|
||||
*
|
||||
*
|
||||
* @return <code>true</code> if connections should NOT be connected automatically,
|
||||
* <code>false</code> if connections should be connected automatically.
|
||||
*/
|
||||
|
@ -123,11 +123,11 @@ public abstract class SmackTestCase extends TestCase {
|
|||
* Returns the XMPPTCPConnection located at the requested position. Each test case holds a
|
||||
* pool of connections which is initialized while setting up the test case. The maximum
|
||||
* number of connections is controlled by the message {@link #getMaxConnections()} which
|
||||
* every subclass must implement.<p>
|
||||
*
|
||||
* If the requested position is greater than the connections size then an
|
||||
* IllegalArgumentException will be thrown.
|
||||
*
|
||||
* every subclass must implement.<p>
|
||||
*
|
||||
* If the requested position is greater than the connections size then an
|
||||
* IllegalArgumentException will be thrown.
|
||||
*
|
||||
* @param index the position in the pool of the connection to look for.
|
||||
* @return the XMPPTCPConnection located at the requested position.
|
||||
*/
|
||||
|
@ -156,9 +156,9 @@ public abstract class SmackTestCase extends TestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the user (e.g. johndoe) that is using the connection
|
||||
* Returns the name of the user (e.g. johndoe) that is using the connection
|
||||
* located at the requested position.
|
||||
*
|
||||
*
|
||||
* @param index the position in the pool of the connection to look for.
|
||||
* @return the user of the user (e.g. johndoe).
|
||||
*/
|
||||
|
@ -167,9 +167,9 @@ public abstract class SmackTestCase extends TestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the password of the user (e.g. johndoe) that is using the connection
|
||||
* Returns the password of the user (e.g. johndoe) that is using the connection
|
||||
* located at the requested position.
|
||||
*
|
||||
*
|
||||
* @param index the position in the pool of the connection to look for.
|
||||
* @return the password of the user (e.g. johndoe).
|
||||
*/
|
||||
|
@ -180,7 +180,7 @@ public abstract class SmackTestCase extends TestCase {
|
|||
/**
|
||||
* Returns the bare XMPP address of the user (e.g. johndoe@jabber.org) that is
|
||||
* using the connection located at the requested position.
|
||||
*
|
||||
*
|
||||
* @param index the position in the pool of the connection to look for.
|
||||
* @return the bare XMPP address of the user (e.g. johndoe@jabber.org).
|
||||
*/
|
||||
|
@ -191,7 +191,7 @@ public abstract class SmackTestCase extends TestCase {
|
|||
/**
|
||||
* Returns the full XMPP address of the user (e.g. johndoe@jabber.org/Smack) that is
|
||||
* using the connection located at the requested position.
|
||||
*
|
||||
*
|
||||
* @param index the position in the pool of the connection to look for.
|
||||
* @return the full XMPP address of the user (e.g. johndoe@jabber.org/Smack).
|
||||
*/
|
||||
|
@ -213,7 +213,7 @@ public abstract class SmackTestCase extends TestCase {
|
|||
|
||||
/**
|
||||
* Returns the default groupchat service domain.
|
||||
*
|
||||
*
|
||||
* @return the default groupchat service domain.
|
||||
*/
|
||||
protected String getChatDomain() {
|
||||
|
@ -222,7 +222,7 @@ public abstract class SmackTestCase extends TestCase {
|
|||
|
||||
/**
|
||||
* Returns the default MUC service domain.
|
||||
*
|
||||
*
|
||||
* @return the default MUC service domain.
|
||||
*/
|
||||
protected String getMUCDomain() {
|
||||
|
@ -273,7 +273,7 @@ public abstract class SmackTestCase extends TestCase {
|
|||
if (!getConnection(0).getAccountManager().supportsAccountCreation())
|
||||
fail("Server does not support account creation");
|
||||
|
||||
// Create the account and try logging in again as the
|
||||
// Create the account and try logging in again as the
|
||||
// same user.
|
||||
try {
|
||||
createAccount(i, currentUser, currentPassword);
|
||||
|
@ -345,7 +345,7 @@ public abstract class SmackTestCase extends TestCase {
|
|||
con.login(getUsername(i), getUsername(i));
|
||||
}
|
||||
else if (!getConnection(i).isAuthenticated()) {
|
||||
getConnection(i).login(getUsername(i), getUsername(i));
|
||||
getConnection(i).login(getUsername(i), getUsername(i));
|
||||
}
|
||||
// Delete the created account for the test
|
||||
getConnection(i).getAccountManager().deleteAccount();
|
||||
|
@ -366,22 +366,22 @@ public abstract class SmackTestCase extends TestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Initializes the context of the test case. We will first try to load the configuration from
|
||||
* a file whose name is conformed by the test case class name plus an .xml extension
|
||||
* (e.g RosterTest.xml). If no file was found under that name then we will try to load the
|
||||
* Initializes the context of the test case. We will first try to load the configuration from
|
||||
* a file whose name is conformed by the test case class name plus an .xml extension
|
||||
* (e.g RosterTest.xml). If no file was found under that name then we will try to load the
|
||||
* default configuration for all the test cases from the file "config/test-case.xml".
|
||||
*
|
||||
*/
|
||||
private void init() {
|
||||
try {
|
||||
boolean found = false;
|
||||
// Try to load the configutation from an XML file specific for this test case
|
||||
// Try to load the configutation from an XML file specific for this test case
|
||||
Enumeration<URL> resources =
|
||||
ClassLoader.getSystemClassLoader().getResources(getConfigurationFilename());
|
||||
while (resources.hasMoreElements()) {
|
||||
found = parseURL(resources.nextElement());
|
||||
}
|
||||
// If none was found then try to load the configuration from the default configuration
|
||||
// If none was found then try to load the configuration from the default configuration
|
||||
// file (i.e. "config/test-case.xml")
|
||||
if (!found) {
|
||||
resources = ClassLoader.getSystemClassLoader().getResources("config/test-case.xml");
|
||||
|
@ -401,8 +401,8 @@ public abstract class SmackTestCase extends TestCase {
|
|||
/**
|
||||
* Returns true if the given URL was found and parsed without problems. The file provided
|
||||
* by the URL must contain information useful for the test case configuration, such us,
|
||||
* host and port of the server.
|
||||
*
|
||||
* host and port of the server.
|
||||
*
|
||||
* @param url the url of the file to parse.
|
||||
* @return true if the given URL was found and parsed without problems.
|
||||
*/
|
||||
|
@ -487,11 +487,11 @@ public abstract class SmackTestCase extends TestCase {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the name of the configuration file related to <b>this</b> test case. By default all
|
||||
* Returns the name of the configuration file related to <b>this</b> test case. By default all
|
||||
* the test cases will use the same configuration file. However, it's possible to override the
|
||||
* default configuration by providing a file of the form <test case class name>.xml
|
||||
* (e.g. RosterTest.xml).
|
||||
*
|
||||
*
|
||||
* @return the name of the configuration file related to this test case.
|
||||
*/
|
||||
private String getConfigurationFilename() {
|
||||
|
@ -502,7 +502,7 @@ public abstract class SmackTestCase extends TestCase {
|
|||
|
||||
/**
|
||||
* Subscribes all connections with each other: They all become friends
|
||||
*
|
||||
*
|
||||
* @throws XMPPException
|
||||
*/
|
||||
protected void letsAllBeFriends() throws XMPPException {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue