mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-06 05:01:12 +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
|
|
@ -35,7 +35,7 @@ import org.powermock.reflect.Whitebox;
|
|||
|
||||
/**
|
||||
* Test for the CloseListener class.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class CloseListenerTest extends InitExtensions {
|
||||
|
|
@ -46,7 +46,7 @@ public class CloseListenerTest extends InitExtensions {
|
|||
/**
|
||||
* If a close request to an unknown session is received it should be replied
|
||||
* with an <item-not-found/> error.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import org.powermock.reflect.Whitebox;
|
|||
|
||||
/**
|
||||
* Test for the CloseListener class.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class DataListenerTest extends InitExtensions {
|
||||
|
|
@ -47,7 +47,7 @@ public class DataListenerTest extends InitExtensions {
|
|||
/**
|
||||
* If a data stanza of an unknown session is received it should be replied
|
||||
* with an <item-not-found/> error.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -25,14 +25,14 @@ import org.jxmpp.jid.Jid;
|
|||
|
||||
/**
|
||||
* Utility methods to create packets.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class IBBPacketUtils {
|
||||
|
||||
/**
|
||||
* Returns an error IQ.
|
||||
*
|
||||
*
|
||||
* @param from the senders JID
|
||||
* @param to the recipients JID
|
||||
* @param condition the XMPP error condition
|
||||
|
|
@ -49,7 +49,7 @@ public class IBBPacketUtils {
|
|||
|
||||
/**
|
||||
* Returns a result IQ.
|
||||
*
|
||||
*
|
||||
* @param from the senders JID
|
||||
* @param to the recipients JID
|
||||
* @return a result IQ
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ import org.jxmpp.jid.JidTestUtil;
|
|||
|
||||
/**
|
||||
* Test for InBandBytestreamManager.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class InBandBytestreamManagerTest extends InitExtensions {
|
||||
|
|
@ -61,9 +61,9 @@ public class InBandBytestreamManagerTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Initialize fields used in the tests.
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Before
|
||||
public void setup() throws XMPPException, SmackException, InterruptedException {
|
||||
|
|
@ -105,9 +105,9 @@ public class InBandBytestreamManagerTest extends InitExtensions {
|
|||
* Invoking {@link InBandBytestreamManager#establishSession(org.jxmpp.jid.Jid)} should
|
||||
* throw an exception if the given target does not support in-band
|
||||
* bytestream.
|
||||
* @throws SmackException
|
||||
* @throws XMPPException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException
|
||||
* @throws XMPPException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test
|
||||
public void shouldFailIfTargetDoesNotSupportIBB() throws SmackException, XMPPException, InterruptedException {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ import org.mockito.ArgumentCaptor;
|
|||
|
||||
/**
|
||||
* Test for InBandBytestreamRequest.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class InBandBytestreamRequestTest extends InitExtensions {
|
||||
|
|
@ -71,8 +71,8 @@ public class InBandBytestreamRequestTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test reject() method.
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
* @throws NotConnectedException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test
|
||||
public void shouldReplyWithErrorIfRequestIsRejected() throws NotConnectedException, InterruptedException {
|
||||
|
|
@ -96,7 +96,7 @@ public class InBandBytestreamRequestTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test accept() method.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ import org.powermock.reflect.Whitebox;
|
|||
* Test for InBandBytestreamSession.
|
||||
* <p>
|
||||
* Tests sending data encapsulated in message stanzas.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class InBandBytestreamSessionMessageTest extends InitExtensions {
|
||||
|
|
@ -77,9 +77,9 @@ public class InBandBytestreamSessionMessageTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Initialize fields used in the tests.
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Before
|
||||
public void setup() throws XMPPException, SmackException, InterruptedException {
|
||||
|
|
@ -115,7 +115,7 @@ public class InBandBytestreamSessionMessageTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test the output stream write(byte[]) method.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -140,7 +140,7 @@ public class InBandBytestreamSessionMessageTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test the output stream write(byte) method.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -167,7 +167,7 @@ public class InBandBytestreamSessionMessageTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test the output stream write(byte[], int, int) method.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -196,7 +196,7 @@ public class InBandBytestreamSessionMessageTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test the output stream flush() method.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -223,7 +223,7 @@ public class InBandBytestreamSessionMessageTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test successive calls to the output stream flush() method.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -252,7 +252,7 @@ public class InBandBytestreamSessionMessageTest extends InitExtensions {
|
|||
/**
|
||||
* If a data stanza is received out of order the session should be closed. See XEP-0047 Section
|
||||
* 2.2.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -292,7 +292,7 @@ public class InBandBytestreamSessionMessageTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test the input stream read(byte[], int, int) method.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -337,7 +337,7 @@ public class InBandBytestreamSessionMessageTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test the input stream read() method.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ import org.powermock.reflect.Whitebox;
|
|||
* <p>
|
||||
* Tests the basic behavior of an In-Band Bytestream session along with sending data encapsulated in
|
||||
* IQ stanzas.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class InBandBytestreamSessionTest extends InitExtensions {
|
||||
|
|
@ -78,9 +78,9 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Initialize fields used in the tests.
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Before
|
||||
public void setup() throws XMPPException, SmackException, InterruptedException {
|
||||
|
|
@ -114,7 +114,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test the output stream write(byte[]) method.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -140,7 +140,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test the output stream write(byte) method.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -168,7 +168,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test the output stream write(byte[], int, int) method.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -198,7 +198,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test the output stream flush() method.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -226,7 +226,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test successive calls to the output stream flush() method.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -255,7 +255,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test that the data is correctly chunked.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -298,7 +298,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* If the input stream is closed the output stream should not be closed as well.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -337,7 +337,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Valid data packets should be confirmed.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -363,7 +363,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
/**
|
||||
* If the data stanza has a sequence that is already used an 'unexpected-request' error should
|
||||
* be returned. See XEP-0047 Section 2.2.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -405,7 +405,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
/**
|
||||
* If the data stanza contains invalid Base64 encoding an 'bad-request' error should be
|
||||
* returned. See XEP-0047 Section 2.2.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -441,7 +441,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
/**
|
||||
* If a data stanza is received out of order the session should be closed. See XEP-0047 Section
|
||||
* 2.2.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -484,7 +484,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test the input stream read(byte[], int, int) method.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -531,7 +531,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* Test the input stream read() method.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -575,7 +575,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* If the output stream is closed the input stream should not be closed as well.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -618,7 +618,7 @@ public class InBandBytestreamSessionTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* If the input stream is closed concurrently there should be no deadlock.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ import org.powermock.reflect.Whitebox;
|
|||
|
||||
/**
|
||||
* Test for the InitiationListener class.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class InitiationListenerTest extends InitExtensions {
|
||||
|
|
@ -78,7 +78,7 @@ public class InitiationListenerTest extends InitExtensions {
|
|||
/**
|
||||
* If no listeners are registered for incoming In-Band Bytestream requests, all request should
|
||||
* be rejected with an error.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -105,7 +105,7 @@ public class InitiationListenerTest extends InitExtensions {
|
|||
/**
|
||||
* Open request with a block size that exceeds the maximum block size should be replied with an
|
||||
* resource-constraint error.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -132,7 +132,7 @@ public class InitiationListenerTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* If a listener for all requests is registered it should be notified on incoming requests.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -160,7 +160,7 @@ public class InitiationListenerTest extends InitExtensions {
|
|||
/**
|
||||
* If a listener for a specific user in registered it should be notified on incoming requests
|
||||
* for that user.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -188,7 +188,7 @@ public class InitiationListenerTest extends InitExtensions {
|
|||
/**
|
||||
* If listener for a specific user is registered it should not be notified on incoming requests
|
||||
* from other users.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -222,7 +222,7 @@ public class InitiationListenerTest extends InitExtensions {
|
|||
/**
|
||||
* If a user specific listener and an all requests listener is registered only the user specific
|
||||
* listener should be notified.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -255,7 +255,7 @@ public class InitiationListenerTest extends InitExtensions {
|
|||
/**
|
||||
* If a user specific listener and an all requests listener is registered only the all requests
|
||||
* listener should be notified on an incoming request for another user.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -288,7 +288,7 @@ public class InitiationListenerTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* If a request with a specific session ID should be ignored no listeners should be notified.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import org.jxmpp.jid.impl.JidCreate;
|
|||
|
||||
/**
|
||||
* Test for the Close class.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class CloseTest extends InitExtensions {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import org.junit.Test;
|
|||
|
||||
/**
|
||||
* Test for the DataPacketExtension class.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class DataPacketExtensionTest extends InitExtensions {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import org.jxmpp.jid.impl.JidCreate;
|
|||
|
||||
/**
|
||||
* Test for the Data class.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class DataTest extends InitExtensions {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import org.jxmpp.jid.impl.JidCreate;
|
|||
|
||||
/**
|
||||
* Test for the Open class.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class OpenTest extends InitExtensions {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import org.xmlpull.v1.XmlPullParserFactory;
|
|||
|
||||
/**
|
||||
* Test for the OpenIQProvider class.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class OpenIQProviderTest extends InitExtensions {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ import org.powermock.reflect.Whitebox;
|
|||
|
||||
/**
|
||||
* Test for the InitiationListener class.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class InitiationListenerTest {
|
||||
|
|
@ -88,7 +88,7 @@ public class InitiationListenerTest {
|
|||
/**
|
||||
* If no listeners are registered for incoming SOCKS5 Bytestream requests, all request should be
|
||||
* rejected with an error.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -111,7 +111,7 @@ public class InitiationListenerTest {
|
|||
|
||||
/**
|
||||
* If a listener for all requests is registered it should be notified on incoming requests.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -136,7 +136,7 @@ public class InitiationListenerTest {
|
|||
/**
|
||||
* If a listener for a specific user in registered it should be notified on incoming requests
|
||||
* for that user.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -161,7 +161,7 @@ public class InitiationListenerTest {
|
|||
/**
|
||||
* If listener for a specific user is registered it should not be notified on incoming requests
|
||||
* from other users.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -192,7 +192,7 @@ public class InitiationListenerTest {
|
|||
/**
|
||||
* If a user specific listener and an all requests listener is registered only the user specific
|
||||
* listener should be notified.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -222,7 +222,7 @@ public class InitiationListenerTest {
|
|||
/**
|
||||
* If a user specific listener and an all requests listener is registered only the all requests
|
||||
* listener should be notified on an incoming request for another user.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -254,7 +254,7 @@ public class InitiationListenerTest {
|
|||
|
||||
/**
|
||||
* If a request with a specific session ID should be ignored no listeners should be notified.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ import org.jxmpp.stringprep.XmppStringprepException;
|
|||
|
||||
/**
|
||||
* Test for Socks5BytestreamManager.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class Socks5ByteStreamManagerTest {
|
||||
|
|
@ -81,9 +81,9 @@ public class Socks5ByteStreamManagerTest {
|
|||
|
||||
/**
|
||||
* Initialize fields used in the tests.
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Before
|
||||
public void setup() throws XMPPException, SmackException, InterruptedException {
|
||||
|
|
@ -146,7 +146,7 @@ public class Socks5ByteStreamManagerTest {
|
|||
/**
|
||||
* Invoking {@link Socks5BytestreamManager#establishSession(org.jxmpp.jid.Jid)} should throw an exception
|
||||
* if the given target does not support SOCKS5 Bytestream.
|
||||
* @throws XMPPException
|
||||
* @throws XMPPException
|
||||
*/
|
||||
@Test
|
||||
public void shouldFailIfTargetDoesNotSupportSocks5() throws XMPPException {
|
||||
|
|
@ -462,7 +462,7 @@ public class Socks5ByteStreamManagerTest {
|
|||
/**
|
||||
* Invoking {@link Socks5BytestreamManager#establishSession(org.jxmpp.jid.Jid, String)} should fail if the
|
||||
* proxy used by target is invalid.
|
||||
* @throws XmppStringprepException
|
||||
* @throws XmppStringprepException
|
||||
*/
|
||||
@Test
|
||||
public void shouldFailIfTargetUsesInvalidSocks5Proxy() throws XmppStringprepException {
|
||||
|
|
@ -638,7 +638,7 @@ public class Socks5ByteStreamManagerTest {
|
|||
/**
|
||||
* Invoking {@link Socks5BytestreamManager#establishSession(org.jxmpp.jid.Jid, String)} should successfully
|
||||
* negotiate and return a SOCKS5 Bytestream connection.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -753,7 +753,7 @@ public class Socks5ByteStreamManagerTest {
|
|||
/**
|
||||
* If multiple network addresses are added to the local SOCKS5 proxy, all of them should be
|
||||
* contained in the SOCKS5 Bytestream request.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -852,7 +852,7 @@ public class Socks5ByteStreamManagerTest {
|
|||
* Invoking {@link Socks5BytestreamManager#establishSession(org.jxmpp.jid.Jid, String)} the first time
|
||||
* should successfully negotiate a SOCKS5 Bytestream via the second SOCKS5 proxy and should
|
||||
* prioritize this proxy for a second SOCKS5 Bytestream negotiation.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -937,7 +937,7 @@ public class Socks5ByteStreamManagerTest {
|
|||
* Invoking {@link Socks5BytestreamManager#establishSession(org.jxmpp.jid.Jid, String)} the first time
|
||||
* should successfully negotiate a SOCKS5 Bytestream via the second SOCKS5 proxy. The second
|
||||
* negotiation should run in the same manner if prioritization is disabled.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ import org.jxmpp.jid.impl.JidCreate;
|
|||
|
||||
/**
|
||||
* Tests for the Socks5BytestreamRequest class.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class Socks5ByteStreamRequestTest {
|
||||
|
|
@ -67,9 +67,9 @@ public class Socks5ByteStreamRequestTest {
|
|||
|
||||
/**
|
||||
* Initialize fields used in the tests.
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Before
|
||||
public void setup() throws XMPPException, SmackException, InterruptedException {
|
||||
|
|
@ -85,7 +85,7 @@ public class Socks5ByteStreamRequestTest {
|
|||
/**
|
||||
* Accepting a SOCKS5 Bytestream request should fail if the request doesn't contain any Socks5
|
||||
* proxies.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -127,7 +127,7 @@ public class Socks5ByteStreamRequestTest {
|
|||
/**
|
||||
* Accepting a SOCKS5 Bytestream request should fail if target is not able to connect to any of
|
||||
* the provided SOCKS5 proxies.
|
||||
*
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -170,7 +170,7 @@ public class Socks5ByteStreamRequestTest {
|
|||
|
||||
/**
|
||||
* Target should not try to connect to SOCKS5 proxies that already failed twice.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -259,7 +259,7 @@ public class Socks5ByteStreamRequestTest {
|
|||
|
||||
/**
|
||||
* Target should not not blacklist any SOCKS5 proxies regardless of failing connections.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -316,7 +316,7 @@ public class Socks5ByteStreamRequestTest {
|
|||
* If the SOCKS5 Bytestream request contains multiple SOCKS5 proxies and the first one doesn't
|
||||
* respond, the connection attempt to this proxy should not consume the whole timeout for
|
||||
* connecting to the proxies.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -381,7 +381,7 @@ public class Socks5ByteStreamRequestTest {
|
|||
|
||||
/**
|
||||
* Accepting the SOCKS5 Bytestream request should be successfully.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ import org.jxmpp.jid.JidTestUtil;
|
|||
|
||||
/**
|
||||
* Test for Socks5ClientForInitiator class.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class Socks5ClientForInitiatorTest {
|
||||
|
|
@ -74,9 +74,9 @@ public class Socks5ClientForInitiatorTest {
|
|||
|
||||
/**
|
||||
* Initialize fields used in the tests.
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPException
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Before
|
||||
public void setup() throws XMPPException, SmackException, InterruptedException {
|
||||
|
|
@ -90,7 +90,7 @@ public class Socks5ClientForInitiatorTest {
|
|||
|
||||
/**
|
||||
* If the target is not connected to the local SOCKS5 proxy an exception should be thrown.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -128,7 +128,7 @@ public class Socks5ClientForInitiatorTest {
|
|||
|
||||
/**
|
||||
* Initiator and target should successfully connect to the local SOCKS5 proxy.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -197,7 +197,7 @@ public class Socks5ClientForInitiatorTest {
|
|||
/**
|
||||
* If the initiator can connect to a SOCKS5 proxy but activating the stream fails an exception
|
||||
* should be thrown.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -241,7 +241,7 @@ public class Socks5ClientForInitiatorTest {
|
|||
/**
|
||||
* Target and initiator should successfully connect to a "remote" SOCKS5 proxy and the initiator
|
||||
* activates the bytestream.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import org.jxmpp.jid.JidTestUtil;
|
|||
|
||||
/**
|
||||
* Test for Socks5Client class.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class Socks5ClientTest {
|
||||
|
|
@ -54,7 +54,7 @@ public class Socks5ClientTest {
|
|||
|
||||
/**
|
||||
* Initialize fields used in the tests.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Before
|
||||
|
|
@ -68,7 +68,7 @@ public class Socks5ClientTest {
|
|||
/**
|
||||
* A SOCKS5 client MUST close connection if server doesn't accept any of the given
|
||||
* authentication methods. (See RFC1928 Section 3)
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -126,7 +126,7 @@ public class Socks5ClientTest {
|
|||
|
||||
/**
|
||||
* The SOCKS5 client should close connection if server replies in an unsupported way.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -188,7 +188,7 @@ public class Socks5ClientTest {
|
|||
|
||||
/**
|
||||
* The SOCKS5 client should close connection if server replies with an error.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -254,7 +254,7 @@ public class Socks5ClientTest {
|
|||
|
||||
/**
|
||||
* The SOCKS5 client should successfully connect to the SOCKS5 server.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@Test
|
||||
|
|
@ -330,7 +330,7 @@ public class Socks5ClientTest {
|
|||
|
||||
/**
|
||||
* Close fake SOCKS5 proxy.
|
||||
*
|
||||
*
|
||||
* @throws Exception should not happen
|
||||
*/
|
||||
@After
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import org.jxmpp.jid.Jid;
|
|||
|
||||
/**
|
||||
* A collection of utility methods to create XMPP packets.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class Socks5PacketUtils {
|
||||
|
|
@ -35,7 +35,7 @@ public class Socks5PacketUtils {
|
|||
/**
|
||||
* Returns a SOCKS5 Bytestream initialization request packet. The Request doesn't contain any
|
||||
* SOCKS5 proxies.
|
||||
*
|
||||
*
|
||||
* @param from the initiator
|
||||
* @param to the target
|
||||
* @param sessionID the session ID
|
||||
|
|
@ -53,7 +53,7 @@ public class Socks5PacketUtils {
|
|||
/**
|
||||
* Returns a response to a SOCKS5 Bytestream initialization request. The stanza doesn't contain
|
||||
* the uses-host information.
|
||||
*
|
||||
*
|
||||
* @param from the target
|
||||
* @param to the initiator
|
||||
* @return response to a SOCKS5 Bytestream initialization request
|
||||
|
|
@ -68,7 +68,7 @@ public class Socks5PacketUtils {
|
|||
|
||||
/**
|
||||
* Returns a response to an item discovery request. The stanza doesn't contain any items.
|
||||
*
|
||||
*
|
||||
* @param from the XMPP server
|
||||
* @param to the XMPP client
|
||||
* @return response to an item discovery request
|
||||
|
|
@ -83,7 +83,7 @@ public class Socks5PacketUtils {
|
|||
|
||||
/**
|
||||
* Returns a response to an info discovery request. The stanza doesn't contain any infos.
|
||||
*
|
||||
*
|
||||
* @param from the target
|
||||
* @param to the initiator
|
||||
* @return response to an info discovery request
|
||||
|
|
@ -98,7 +98,7 @@ public class Socks5PacketUtils {
|
|||
|
||||
/**
|
||||
* Returns a response IQ for a activation request to the proxy.
|
||||
*
|
||||
*
|
||||
* @param from JID of the proxy
|
||||
* @param to JID of the client who wants to activate the SOCKS5 Bytestream
|
||||
* @return response IQ for a activation request to the proxy
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ import org.jivesoftware.smack.util.StringUtils;
|
|||
/**
|
||||
* Simple SOCKS5 proxy for testing purposes. It is almost the same as the Socks5Proxy class but the
|
||||
* port can be configured more easy and it all connections are allowed.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public final class Socks5TestProxy {
|
||||
|
|
@ -71,7 +71,7 @@ public final class Socks5TestProxy {
|
|||
|
||||
/**
|
||||
* Returns the local SOCKS5 proxy server.
|
||||
*
|
||||
*
|
||||
* @param port of the test proxy
|
||||
* @return the local SOCKS5 proxy server
|
||||
*/
|
||||
|
|
@ -144,7 +144,7 @@ public final class Socks5TestProxy {
|
|||
|
||||
/**
|
||||
* Returns the host address of the local SOCKS5 proxy server.
|
||||
*
|
||||
*
|
||||
* @return the host address of the local SOCKS5 proxy server
|
||||
*/
|
||||
public static String getAddress() {
|
||||
|
|
@ -158,7 +158,7 @@ public final class Socks5TestProxy {
|
|||
|
||||
/**
|
||||
* Returns the port of the local SOCKS5 proxy server. If it is not running -1 will be returned.
|
||||
*
|
||||
*
|
||||
* @return the port of the local SOCKS5 proxy server or -1 if proxy is not running
|
||||
*/
|
||||
public int getPort() {
|
||||
|
|
@ -170,7 +170,7 @@ public final class Socks5TestProxy {
|
|||
|
||||
/**
|
||||
* Returns the socket for the given digest.
|
||||
*
|
||||
*
|
||||
* @param digest identifying the connection
|
||||
* @return socket or null if there is no socket for the given digest
|
||||
*/
|
||||
|
|
@ -193,7 +193,7 @@ public final class Socks5TestProxy {
|
|||
|
||||
/**
|
||||
* Returns true if the local SOCKS5 proxy server is running, otherwise false.
|
||||
*
|
||||
*
|
||||
* @return true if the local SOCKS5 proxy server is running, otherwise false
|
||||
*/
|
||||
public boolean isRunning() {
|
||||
|
|
@ -202,7 +202,7 @@ public final class Socks5TestProxy {
|
|||
|
||||
/**
|
||||
* Implementation of a simplified SOCKS5 proxy server.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
class Socks5ServerProcess implements Runnable {
|
||||
|
|
@ -248,7 +248,7 @@ public final class Socks5TestProxy {
|
|||
|
||||
/**
|
||||
* Negotiates a SOCKS5 connection and stores it on success.
|
||||
*
|
||||
*
|
||||
* @param socket connection to the client
|
||||
* @throws SmackException if client requests a connection in an unsupported way
|
||||
* @throws IOException if a network error occurred
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class EntityCapsManagerTest extends InitExtensions {
|
|||
/**
|
||||
* <a href="http://xmpp.org/extensions/xep-0115.html#ver-gen-complex">XEP-
|
||||
* 0115 Complex Generation Example</a>.
|
||||
* @throws XmppStringprepException
|
||||
* @throws XmppStringprepException
|
||||
*/
|
||||
@Test
|
||||
public void testComplexGenerationExample() throws XmppStringprepException {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class DelayInformationTest extends InitExtensions {
|
|||
String control;
|
||||
GregorianCalendar calendar = new GregorianCalendar(2002, 9 - 1, 10, 23, 8, 25);
|
||||
calendar.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
Date date = calendar.getTime();
|
||||
Date date = calendar.getTime();
|
||||
|
||||
control = XMLBuilder.create("x")
|
||||
.a("xmlns", "jabber:x:delay")
|
||||
|
|
@ -112,7 +112,7 @@ public class DelayInformationTest extends InitExtensions {
|
|||
|
||||
delayInfo = p.parse(PacketParserUtils.getParserFor(control));
|
||||
|
||||
GregorianCalendar cal = (GregorianCalendar) calendar.clone();
|
||||
GregorianCalendar cal = (GregorianCalendar) calendar.clone();
|
||||
cal.add(Calendar.MILLISECOND, 120);
|
||||
assertEquals(cal.getTime(), delayInfo.getStamp());
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import org.jxmpp.util.XmppDateTime;
|
|||
|
||||
/**
|
||||
* Unit tests for GeoLocation.
|
||||
*
|
||||
*
|
||||
* @author Ishan Khanna
|
||||
*/
|
||||
public class GeoLocationTest extends InitExtensions {
|
||||
|
|
@ -84,7 +84,7 @@ public class GeoLocationTest extends InitExtensions {
|
|||
public void toXMLMethodTest() throws Exception {
|
||||
|
||||
// @formatter:off
|
||||
final String geoLocationMessageString = "<message from='portia@merchantofvenice.lit'"
|
||||
final String geoLocationMessageString = "<message from='portia@merchantofvenice.lit'"
|
||||
+ " to='bassanio@merchantofvenice.lit'>"
|
||||
+ "<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+ "<accuracy>23</accuracy>"
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public class GeoLocationProviderTest extends InitExtensions {
|
|||
@Test
|
||||
public void testGeoLocationProviderWithNoDatumSet() throws Exception {
|
||||
// @formatter:off
|
||||
final String geoLocationString = "<message from='portia@merchantofvenice.lit'"
|
||||
final String geoLocationString = "<message from='portia@merchantofvenice.lit'"
|
||||
+ " to='bassanio@merchantofvenice.lit'>"
|
||||
+ "<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+ "<accuracy>23</accuracy>"
|
||||
|
|
@ -104,7 +104,7 @@ public class GeoLocationProviderTest extends InitExtensions {
|
|||
public void testGeoLocationWithDatumSet() throws Exception {
|
||||
|
||||
// @formatter:off
|
||||
final String geoLocationString = "<message from='portia@merchantofvenice.lit'"
|
||||
final String geoLocationString = "<message from='portia@merchantofvenice.lit'"
|
||||
+ " to='bassanio@merchantofvenice.lit'>"
|
||||
+ "<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+ "<accuracy>23</accuracy>"
|
||||
|
|
@ -173,7 +173,7 @@ public class GeoLocationProviderTest extends InitExtensions {
|
|||
public void testGeoLocationWithoutAccuracySetAndWithErrorSet() throws Exception {
|
||||
|
||||
// @formatter:off
|
||||
final String geoLocationString = "<message from='portia@merchantofvenice.lit'"
|
||||
final String geoLocationString = "<message from='portia@merchantofvenice.lit'"
|
||||
+ " to='bassanio@merchantofvenice.lit'>"
|
||||
+ "<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+ "<error>90</error>"
|
||||
|
|
@ -193,7 +193,7 @@ public class GeoLocationProviderTest extends InitExtensions {
|
|||
public void testGeoLocationWithAccuracySetAndWithoutErrorSet() throws Exception {
|
||||
|
||||
// @formatter:off
|
||||
final String geoLocationString = "<message from='portia@merchantofvenice.lit'"
|
||||
final String geoLocationString = "<message from='portia@merchantofvenice.lit'"
|
||||
+ " to='bassanio@merchantofvenice.lit'>"
|
||||
+ "<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+ "<accuracy>90</accuracy>"
|
||||
|
|
@ -213,7 +213,7 @@ public class GeoLocationProviderTest extends InitExtensions {
|
|||
public void testGeoLocationWithAccuracySetAndErrorSet() throws Exception {
|
||||
|
||||
// @formatter:off
|
||||
final String geoLocationString = "<message from='portia@merchantofvenice.lit'"
|
||||
final String geoLocationString = "<message from='portia@merchantofvenice.lit'"
|
||||
+ " to='bassanio@merchantofvenice.lit'>"
|
||||
+ "<geoloc xmlns='http://jabber.org/protocol/geoloc'>"
|
||||
+ "<accuracy>90</accuracy>"
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class PingTest extends InitExtensions {
|
|||
public void checkProvider() throws Exception {
|
||||
// @formatter:off
|
||||
String control = "<iq from='capulet.lit' to='juliet@capulet.lit/balcony' id='s2c1' type='get'>"
|
||||
+ "<ping xmlns='urn:xmpp:ping'/>"
|
||||
+ "<ping xmlns='urn:xmpp:ping'/>"
|
||||
+ "</iq>";
|
||||
// @formatter:on
|
||||
DummyConnection con = new DummyConnection();
|
||||
|
|
@ -98,10 +98,10 @@ public class PingTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* DummyConnection will not reply so it will timeout.
|
||||
* @throws SmackException
|
||||
* @throws XMPPException
|
||||
* @throws IOException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException
|
||||
* @throws XMPPException
|
||||
* @throws IOException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
@Test
|
||||
public void checkFailedPingOnTimeout() throws SmackException, IOException, XMPPException, InterruptedException {
|
||||
|
|
@ -125,12 +125,12 @@ public class PingTest extends InitExtensions {
|
|||
public void checkFailedPingToEntityError() throws Exception {
|
||||
ThreadedDummyConnection threadedCon = getAuthenticatedDummyConnection();
|
||||
// @formatter:off
|
||||
String reply =
|
||||
String reply =
|
||||
"<iq type='error' id='qrzSp-16' to='test@myserver.com'>" +
|
||||
"<ping xmlns='urn:xmpp:ping'/>" +
|
||||
"<error type='cancel'>" +
|
||||
"<service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>" +
|
||||
"</error>" +
|
||||
"</error>" +
|
||||
"</iq>";
|
||||
// @formatter:on
|
||||
IQ serviceUnavailable = PacketParserUtils.parseStanza(reply);
|
||||
|
|
@ -161,12 +161,12 @@ public class PingTest extends InitExtensions {
|
|||
public void checkPingToServerError() throws Exception {
|
||||
ThreadedDummyConnection con = getAuthenticatedDummyConnection();
|
||||
// @formatter:off
|
||||
String reply =
|
||||
String reply =
|
||||
"<iq type='error' id='qrzSp-16' to='test@myserver.com' from='" + con.getXMPPServiceDomain() + "'>" +
|
||||
"<ping xmlns='urn:xmpp:ping'/>" +
|
||||
"<error type='cancel'>" +
|
||||
"<service-unavailable xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>" +
|
||||
"</error>" +
|
||||
"</error>" +
|
||||
"</iq>";
|
||||
// @formatter:on
|
||||
IQ serviceUnavailable = PacketParserUtils.parseStanza(reply);
|
||||
|
|
@ -195,7 +195,7 @@ public class PingTest extends InitExtensions {
|
|||
info.addFeature(Ping.NAMESPACE);
|
||||
|
||||
// @formatter:off
|
||||
String reply =
|
||||
String reply =
|
||||
"<iq type='result' id='qrzSp-16' to='test@myserver.com'>" +
|
||||
"<query xmlns='http://jabber.org/protocol/disco#info'><identity category='client' type='pc' name='Pidgin'/>" +
|
||||
"<feature var='urn:xmpp:ping'/>" +
|
||||
|
|
@ -217,7 +217,7 @@ public class PingTest extends InitExtensions {
|
|||
info.addFeature(Ping.NAMESPACE);
|
||||
|
||||
// @formatter:off
|
||||
String reply =
|
||||
String reply =
|
||||
"<iq type='result' id='qrzSp-16' to='test@myserver.com'>" +
|
||||
"<query xmlns='http://jabber.org/protocol/disco#info'><identity category='client' type='pc' name='Pidgin'/>" +
|
||||
"<feature var='urn:xmpp:noping'/>" +
|
||||
|
|
@ -241,12 +241,12 @@ public class PingTest extends InitExtensions {
|
|||
|
||||
/**
|
||||
* The returned connection won't send replies to IQs
|
||||
*
|
||||
*
|
||||
* @return
|
||||
* @throws XMPPException
|
||||
* @throws IOException
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
* @throws XMPPException
|
||||
* @throws IOException
|
||||
* @throws SmackException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
private static DummyConnection getAuthenticatedDummyConnectionWithoutIqReplies() throws SmackException, IOException, XMPPException, InterruptedException {
|
||||
DummyConnection con = new DummyConnection();
|
||||
|
|
|
|||
|
|
@ -97,8 +97,8 @@ public class ItemValidationTest extends InitExtensions {
|
|||
"<event xmlns='http://jabber.org/protocol/pubsub#event'>" +
|
||||
"<items node='testNode'>" +
|
||||
"<item id='testid1' />" +
|
||||
"</items>" +
|
||||
"</event>" +
|
||||
"</items>" +
|
||||
"</event>" +
|
||||
"</message>");
|
||||
|
||||
Stanza message = PacketParserUtils.parseMessage(parser);
|
||||
|
|
@ -126,9 +126,9 @@ public class ItemValidationTest extends InitExtensions {
|
|||
"<items node='testNode'>" +
|
||||
"<item id='testid1' >" +
|
||||
itemContent +
|
||||
"</item>" +
|
||||
"</items>" +
|
||||
"</event>" +
|
||||
"</item>" +
|
||||
"</items>" +
|
||||
"</event>" +
|
||||
"</message>");
|
||||
|
||||
Stanza message = PacketParserUtils.parseMessage(parser);
|
||||
|
|
@ -150,7 +150,7 @@ public class ItemValidationTest extends InitExtensions {
|
|||
|
||||
@Test
|
||||
public void parseComplexItem() throws Exception {
|
||||
String itemContent =
|
||||
String itemContent =
|
||||
"<entry xmlns='http://www.w3.org/2005/Atom'>" +
|
||||
"<title>Soliloquy</title>" +
|
||||
"<summary>" +
|
||||
|
|
@ -172,9 +172,9 @@ public class ItemValidationTest extends InitExtensions {
|
|||
"<items node='testNode'>" +
|
||||
"<item id='testid1' >" +
|
||||
itemContent +
|
||||
"</item>" +
|
||||
"</items>" +
|
||||
"</event>" +
|
||||
"</item>" +
|
||||
"</items>" +
|
||||
"</event>" +
|
||||
"</message>");
|
||||
|
||||
Stanza message = PacketParserUtils.parseMessage(parser);
|
||||
|
|
@ -204,9 +204,9 @@ public class ItemValidationTest extends InitExtensions {
|
|||
"<items node='testNode'>" +
|
||||
"<item id='testid1' >" +
|
||||
itemContent +
|
||||
"</item>" +
|
||||
"</items>" +
|
||||
"</event>" +
|
||||
"</item>" +
|
||||
"</items>" +
|
||||
"</event>" +
|
||||
"</message>");
|
||||
|
||||
Stanza message = PacketParserUtils.parseMessage(parser);
|
||||
|
|
|
|||
|
|
@ -38,10 +38,10 @@ public class PubSubProviderTest {
|
|||
@Test
|
||||
public void subscriptionsOwnerResultTest() throws Exception {
|
||||
// @formatter:off
|
||||
final String resultStanza =
|
||||
final String resultStanza =
|
||||
"<iq from='pubsub.example.org' to='julia@example.org/Smack' id='HaT4m-13' type='result'>" +
|
||||
"<pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>" +
|
||||
"<subscriptions node='test'>" +
|
||||
"<pubsub xmlns='http://jabber.org/protocol/pubsub#owner'>" +
|
||||
"<subscriptions node='test'>" +
|
||||
"<subscription jid='foo@example.org/Smack' subscription='subscribed' subid='58C1A6F99F2A7'/>" +
|
||||
"<subscription jid='julia@example.org/Smack' subscription='subscribed' subid='58C18F8917321'/>" +
|
||||
"</subscriptions>" +
|
||||
|
|
|
|||
|
|
@ -33,9 +33,9 @@ public class HeadersProviderTest {
|
|||
@Test
|
||||
public void headersInMessageTest() throws Exception {
|
||||
// @formatter:off
|
||||
final String messageStanza =
|
||||
final String messageStanza =
|
||||
"<message xmlns='jabber:client' from='romeo@shakespeare.lit/orchard' to='juliet@capulet.com' type='chat'>" +
|
||||
"<body>Wherefore are thou?!?</body>" +
|
||||
"<body>Wherefore are thou?!?</body>" +
|
||||
"<headers xmlns='http://jabber.org/protocol/shim'>" +
|
||||
"<header name='Urgency'>high</header>" +
|
||||
"</headers>" +
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2014 Anno van Vliet, All rights reserved.
|
||||
* Copyright 2014 Anno van Vliet, All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
|
|
|||
|
|
@ -171,8 +171,8 @@ public class DataValidationTest {
|
|||
/**
|
||||
* @param output
|
||||
* @return
|
||||
* @throws XmlPullParserException
|
||||
* @throws IOException
|
||||
* @throws XmlPullParserException
|
||||
* @throws IOException
|
||||
*/
|
||||
private static XmlPullParser getParser(String output) throws XmlPullParserException, IOException {
|
||||
return TestUtils.getParser(output, "validate");
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ import org.mockito.stubbing.Answer;
|
|||
|
||||
/**
|
||||
* A collection of utility methods to create mocked XMPP connections.
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class ConnectionUtils {
|
||||
|
|
@ -52,7 +52,7 @@ public class ConnectionUtils {
|
|||
* <p>
|
||||
* This mocked connection can used to collect packets that require a reply using a
|
||||
* StanzaCollector.
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* <code>
|
||||
* StanzaCollector collector = connection.createStanzaCollector(new PacketFilter());
|
||||
|
|
@ -60,13 +60,13 @@ public class ConnectionUtils {
|
|||
* Stanza reply = collector.nextResult();
|
||||
* </code>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* @param protocol protocol helper containing answer packets
|
||||
* @param initiatorJID the user associated to the XMPP connection
|
||||
* @return a mocked XMPP connection
|
||||
* @throws SmackException
|
||||
* @throws XMPPErrorException
|
||||
* @throws InterruptedException
|
||||
* @throws SmackException
|
||||
* @throws XMPPErrorException
|
||||
* @throws InterruptedException
|
||||
*/
|
||||
public static XMPPConnection createMockedConnection(final Protocol protocol,
|
||||
EntityFullJid initiatorJID) throws SmackException, XMPPErrorException, InterruptedException {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import org.jivesoftware.smack.util.XmlUtil;
|
|||
* </li>
|
||||
* </ul>
|
||||
* Example:
|
||||
*
|
||||
*
|
||||
* <pre>
|
||||
* <code>
|
||||
* public void methodToTest() {
|
||||
|
|
@ -47,7 +47,7 @@ import org.jivesoftware.smack.util.XmlUtil;
|
|||
* connection.sendStanza(packet);
|
||||
* Stanza reply = collector.nextResult();
|
||||
* }
|
||||
*
|
||||
*
|
||||
* public void testMethod() {
|
||||
* EntityFullJid userJid = JidCreate.entityFullFrom("user@xmpp-server.org");
|
||||
* DomainBareJid serverJid = JidCreate.domainBareFrom("user-server.org");
|
||||
|
|
@ -55,20 +55,20 @@ import org.jivesoftware.smack.util.XmlUtil;
|
|||
* Protocol protocol = new Protocol();
|
||||
* // create mocked connection
|
||||
* XMPPConnection connection = ConnectionUtils.createMockedConnection(protocol, userJid, serverJid);
|
||||
*
|
||||
*
|
||||
* // add reply stanza to protocol
|
||||
* Stanza reply = new Packet();
|
||||
* protocol.add(reply);
|
||||
*
|
||||
*
|
||||
* // call method to test
|
||||
* methodToTest();
|
||||
*
|
||||
*
|
||||
* // verify protocol
|
||||
* protocol.verifyAll();
|
||||
* }
|
||||
* </code>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
* Additionally to adding the response to the protocol instance you can pass
|
||||
* verifications that will be executed when {@link #verifyAll()} is invoked.
|
||||
* (See {@link Verification} for more details.)
|
||||
|
|
@ -77,7 +77,7 @@ import org.jivesoftware.smack.util.XmlUtil;
|
|||
* also print out the XML messages in the order they are sent to the console.
|
||||
* This may be useful to inspect the whole protocol "by hand".
|
||||
* </p>
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public class Protocol {
|
||||
|
|
@ -103,7 +103,7 @@ public class Protocol {
|
|||
/**
|
||||
* Adds a responses and all verifications for the request/response pair to
|
||||
* the protocol.
|
||||
*
|
||||
*
|
||||
* @param response the response for a request
|
||||
* @param verifications verifications for request/response pair
|
||||
*/
|
||||
|
|
@ -155,7 +155,7 @@ public class Protocol {
|
|||
|
||||
/**
|
||||
* Returns the responses queue.
|
||||
*
|
||||
*
|
||||
* @return the responses queue
|
||||
*/
|
||||
protected Queue<Stanza> getResponses() {
|
||||
|
|
@ -164,7 +164,7 @@ public class Protocol {
|
|||
|
||||
/**
|
||||
* Returns a list of all collected requests.
|
||||
*
|
||||
*
|
||||
* @return list of requests
|
||||
*/
|
||||
public List<Stanza> getRequests() {
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@ import org.jivesoftware.smack.packet.Stanza;
|
|||
* Implement this interface to verify a request/response pair.
|
||||
* <p>
|
||||
* For convenience there are some useful predefined implementations.
|
||||
*
|
||||
*
|
||||
* @param <T> class of the request
|
||||
* @param <S> class of the response
|
||||
*
|
||||
*
|
||||
* @author Henning Staib
|
||||
*/
|
||||
public interface Verification<T extends Stanza, S extends Stanza> {
|
||||
|
|
@ -96,7 +96,7 @@ public interface Verification<T extends Stanza, S extends Stanza> {
|
|||
|
||||
/**
|
||||
* Implement this method to make assertions of the request/response pairs.
|
||||
*
|
||||
*
|
||||
* @param request the request collected by the mocked XMPP connection
|
||||
* @param response the response added to the protocol instance
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue