mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-07 05:31:08 +01:00
's;^\s+$;;' on all source files
And add checkstyle test for lines containing only whitespace characters.
This commit is contained in:
parent
05c97c494b
commit
0fde39fa45
193 changed files with 1066 additions and 1062 deletions
|
|
@ -264,7 +264,7 @@ public class JingleManagerTest extends SmackTestCase {
|
|||
|
||||
JingleManager man0 = new JingleManager(getConnection(0), trl0);
|
||||
JingleManager man1 = new JingleManager(getConnection(1), trl1);
|
||||
|
||||
|
||||
man1.addJingleSessionRequestListener(new JingleSessionRequestListener() {
|
||||
/**
|
||||
* Called when a new session request is detected
|
||||
|
|
@ -323,10 +323,10 @@ public class JingleManagerTest extends SmackTestCase {
|
|||
|
||||
JingleManager man0 = new JingleManager(getConnection(0), trl0);
|
||||
JingleManager man1 = new JingleManager(getConnection(1), trl1);
|
||||
|
||||
|
||||
man0.addCreationListener(ftm0);
|
||||
man1.addCreationListener(ftm1);
|
||||
|
||||
|
||||
man1.addJingleSessionRequestListener(new JingleSessionRequestListener() {
|
||||
/**
|
||||
* Called when a new session request is detected
|
||||
|
|
@ -527,7 +527,7 @@ public class JingleManagerTest extends SmackTestCase {
|
|||
|
||||
JingleManager man0 = new JingleManager(getConnection(0), trl0);
|
||||
JingleManager man1 = new JingleManager(getConnection(1), trl1);
|
||||
|
||||
|
||||
man1.addJingleSessionRequestListener(new JingleSessionRequestListener() {
|
||||
/**
|
||||
* Called when a new session request is detected
|
||||
|
|
@ -681,7 +681,7 @@ public class JingleManagerTest extends SmackTestCase {
|
|||
public void testFullTest() {
|
||||
|
||||
resetCounter();
|
||||
|
||||
|
||||
XMPPTCPConnection x0 = getConnection(0);
|
||||
XMPPTCPConnection x1 = getConnection(1);
|
||||
|
||||
|
|
@ -701,7 +701,7 @@ public class JingleManagerTest extends SmackTestCase {
|
|||
|
||||
JingleManager man0 = new JingleManager(x0, trl0);
|
||||
JingleManager man1 = new JingleManager(x1, trl1);
|
||||
|
||||
|
||||
man1.addJingleSessionRequestListener(new JingleSessionRequestListener() {
|
||||
public void sessionRequested(final JingleSessionRequest request) {
|
||||
|
||||
|
|
@ -796,7 +796,7 @@ public class JingleManagerTest extends SmackTestCase {
|
|||
public void testMediaManager() {
|
||||
|
||||
resetCounter();
|
||||
|
||||
|
||||
XMPPTCPConnection x0 = getConnection(0);
|
||||
XMPPTCPConnection x1 = getConnection(1);
|
||||
|
||||
|
|
@ -807,7 +807,7 @@ public class JingleManagerTest extends SmackTestCase {
|
|||
FixedTransportManager ftm1 = new FixedTransportManager(tr1);
|
||||
|
||||
try {
|
||||
|
||||
|
||||
JingleMediaManager jingleMediaManager = new JingleMediaManager(ftm0) {
|
||||
// Media Session Implementation
|
||||
public JingleMediaSession createMediaSession(final PayloadType payloadType, final TransportCandidate remote,
|
||||
|
|
@ -852,7 +852,7 @@ public class JingleManagerTest extends SmackTestCase {
|
|||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
List<JingleMediaManager> trl0 = new ArrayList<JingleMediaManager>();
|
||||
trl0.add(jingleMediaManager);
|
||||
|
||||
|
|
@ -901,11 +901,11 @@ public class JingleManagerTest extends SmackTestCase {
|
|||
/**
|
||||
* This is a simple test where the user_2 rejects the Jingle session.
|
||||
*/
|
||||
|
||||
|
||||
// This test doesn't make sense in light of multiple <content> sections allowed in XEp-166.
|
||||
// What we really need is a test for actions: content-add and content-remove.
|
||||
|
||||
|
||||
|
||||
|
||||
// public void testIncompatibleCodecs() {
|
||||
//
|
||||
// resetCounter();
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ public class JingleMediaTest extends SmackTestCase {
|
|||
|
||||
final JingleManager jm0 = new JingleManager(x0, jml0);
|
||||
final JingleManager jm1 = new JingleManager(x1, jml1);
|
||||
|
||||
|
||||
jm1.addJingleSessionRequestListener(new JingleSessionRequestListener() {
|
||||
public void sessionRequested(final JingleSessionRequest request) {
|
||||
|
||||
|
|
@ -327,7 +327,7 @@ public class JingleMediaTest extends SmackTestCase {
|
|||
|
||||
XMPPTCPConnection x0 = getConnection(n);
|
||||
XMPPTCPConnection x1 = getConnection(n + 1);
|
||||
|
||||
|
||||
BridgedTransportManager btm0 = new BridgedTransportManager(x0);
|
||||
BridgedTransportManager btm1 = new BridgedTransportManager(x1);
|
||||
|
||||
|
|
@ -346,7 +346,7 @@ public class JingleMediaTest extends SmackTestCase {
|
|||
|
||||
jm0.addCreationListener(btm0);
|
||||
jm1.addCreationListener(btm1);
|
||||
|
||||
|
||||
jm1.addJingleSessionRequestListener(new JingleSessionRequestListener() {
|
||||
public void sessionRequested(final JingleSessionRequest request) {
|
||||
|
||||
|
|
@ -369,7 +369,7 @@ public class JingleMediaTest extends SmackTestCase {
|
|||
|
||||
//js0.sendFormattedError(JingleError.UNSUPPORTED_TRANSPORTS);
|
||||
js0.sendStanza(js0.createJingleError(null, JingleError.UNSUPPORTED_TRANSPORTS));
|
||||
|
||||
|
||||
|
||||
Thread.sleep(20000);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,13 +30,13 @@ public class JingleSessionTest extends SmackTestCase {
|
|||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
|
||||
|
||||
FixedResolver tr1 = new FixedResolver("127.0.0.1", 54222);
|
||||
FixedTransportManager ftm1 = new FixedTransportManager(tr1);
|
||||
TestMediaManager tmm1 = new TestMediaManager(ftm1);
|
||||
List<JingleMediaManager> trl1 = new ArrayList<JingleMediaManager>();
|
||||
trl1.add(tmm1);
|
||||
|
||||
|
||||
JingleSession js1 = new JingleSession(getConnection(0), "res1", null, "10", trl1);
|
||||
JingleSession js2 = new JingleSession(getConnection(1), "res1", null, "10", trl1);
|
||||
JingleSession js3 = new JingleSession(getConnection(2), "res2", null, "11", trl1);
|
||||
|
|
@ -66,7 +66,7 @@ public class JingleSessionTest extends SmackTestCase {
|
|||
TestMediaManager tmm1 = new TestMediaManager(ftm1);
|
||||
List<JingleMediaManager> trl1 = new ArrayList<JingleMediaManager>();
|
||||
trl1.add(tmm1);
|
||||
|
||||
|
||||
JingleSession js1 = new JingleSession(getConnection(0), ini1, null, sid1, trl1);
|
||||
JingleSession js2 = new JingleSession(getConnection(1), ini2, null, sid2, trl1);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,27 +31,27 @@ public class PayloadTypeTest extends SmackTestCase {
|
|||
PayloadType p2 = new PayloadType(0, "pt1", 2);
|
||||
assertTrue(p1.equals(p2));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test for the difference of payloads.
|
||||
*/
|
||||
public void testDifference() {
|
||||
ArrayList<Audio> set1 = new ArrayList<Audio>();
|
||||
ArrayList<Audio> set2 = new ArrayList<Audio>();
|
||||
|
||||
|
||||
PayloadType.Audio common1 = new PayloadType.Audio(34, "supercodec-1", 2, 14000);
|
||||
PayloadType.Audio common2 = new PayloadType.Audio(56, "supercodec-2", 1, 44000);
|
||||
|
||||
|
||||
set1.add(common1);
|
||||
set1.add(common2);
|
||||
set1.add(new PayloadType.Audio(36, "supercodec-3", 2, 28000));
|
||||
set1.add(new PayloadType.Audio(45, "supercodec-4", 1, 98000));
|
||||
|
||||
|
||||
set2.add(new PayloadType.Audio(27, "supercodec-3", 2, 28000));
|
||||
set2.add(common2);
|
||||
set2.add(new PayloadType.Audio(32, "supercodec-4", 1, 98000));
|
||||
set2.add(common1);
|
||||
|
||||
|
||||
// Get the difference
|
||||
ArrayList<Audio> commonSet = new ArrayList<Audio>();
|
||||
commonSet.addAll(set1);
|
||||
|
|
@ -60,7 +60,7 @@ public class PayloadTypeTest extends SmackTestCase {
|
|||
assertTrue(commonSet.size() == 2);
|
||||
System.out.println("Codec " + ((PayloadType.Audio)commonSet.get(0)).getId());
|
||||
System.out.println("Codec " + ((PayloadType.Audio)commonSet.get(1)).getId());
|
||||
|
||||
|
||||
assertTrue(commonSet.contains(common1));
|
||||
assertTrue(commonSet.contains(common2));
|
||||
}
|
||||
|
|
@ -71,22 +71,22 @@ public class PayloadTypeTest extends SmackTestCase {
|
|||
public void testDifferenceSameSet() {
|
||||
ArrayList<Audio> set1 = new ArrayList<Audio>();
|
||||
ArrayList<Audio> set2 = new ArrayList<Audio>();
|
||||
|
||||
|
||||
PayloadType.Audio common1 = new PayloadType.Audio(34, "supercodec-1", 2, 14000);
|
||||
PayloadType.Audio common2 = new PayloadType.Audio(56, "supercodec-2", 1, 44000);
|
||||
PayloadType.Audio common3 = new PayloadType.Audio(0, "supercodec-3", 1, 44000);
|
||||
PayloadType.Audio common4 = new PayloadType.Audio(120, "supercodec-4", 2, 66060);
|
||||
|
||||
|
||||
set1.add(common1);
|
||||
set1.add(common2);
|
||||
set1.add(common3);
|
||||
set1.add(common4);
|
||||
|
||||
|
||||
set2.add(common1);
|
||||
set2.add(common2);
|
||||
set2.add(common3);
|
||||
set2.add(common4);
|
||||
|
||||
|
||||
// Get the difference
|
||||
ArrayList<Audio> commonSet = new ArrayList<Audio>();
|
||||
commonSet.addAll(set1);
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class BasicResolverTest extends SmackTestCase {
|
|||
TransportCandidate tc = new TransportCandidate.Fixed(validHostname, 0);
|
||||
|
||||
resetCounter();
|
||||
|
||||
|
||||
tc.addListener(new TransportResolverListener.Checker() {
|
||||
public void candidateChecked(TransportCandidate cand, boolean result) {
|
||||
if(result == true) {
|
||||
|
|
@ -66,17 +66,17 @@ public class BasicResolverTest extends SmackTestCase {
|
|||
}
|
||||
|
||||
public void candidateChecking(TransportCandidate cand) {
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
tc.check(new ArrayList<TransportCandidate>());
|
||||
|
||||
|
||||
try {
|
||||
Thread.sleep(TransportResolver.CHECK_TIMEOUT);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
|
||||
|
||||
assertTrue(valCounter() > 0);
|
||||
}
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ public class BasicResolverTest extends SmackTestCase {
|
|||
TransportCandidate tc = new TransportCandidate.Fixed(invalidHostname, 0);
|
||||
|
||||
resetCounter();
|
||||
|
||||
|
||||
tc.addListener(new TransportResolverListener.Checker() {
|
||||
public void candidateChecked(TransportCandidate cand, boolean result) {
|
||||
if(result == false) {
|
||||
|
|
@ -98,9 +98,9 @@ public class BasicResolverTest extends SmackTestCase {
|
|||
public void candidateChecking(TransportCandidate cand) {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
tc.check(new ArrayList<TransportCandidate>());
|
||||
|
||||
|
||||
try {
|
||||
Thread.sleep(TransportResolver.CHECK_TIMEOUT);
|
||||
} catch (Exception e) {
|
||||
|
|
@ -109,7 +109,7 @@ public class BasicResolverTest extends SmackTestCase {
|
|||
assertTrue(valCounter() > 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected int getMaxConnections() {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ public class STUNResolverTest extends SmackTestCase {
|
|||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
TransportCandidate transportCandidate = new ICECandidate(candidate.getAddress().getInetAddress()
|
||||
.getHostAddress(), 1, nicNum, "1", candidate.getPort(), "1", candidate.getPriority(),
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public class TransportResolverTest extends SmackTestCase {
|
|||
|
||||
public void testIsResolving() {
|
||||
final TransportResolver tr = new BasicResolver();
|
||||
|
||||
|
||||
tr.addListener(
|
||||
new TransportResolverListener.Resolver() {
|
||||
public void candidateAdded(final TransportCandidate cand) {
|
||||
|
|
@ -48,7 +48,7 @@ public class TransportResolverTest extends SmackTestCase {
|
|||
|
||||
assertFalse(tr.isResolving());
|
||||
assertFalse(tr.isResolved());
|
||||
|
||||
|
||||
try {
|
||||
tr.resolve(null);
|
||||
} catch (XMPPException e) {
|
||||
|
|
|
|||
|
|
@ -36,13 +36,13 @@ public class JingleProviderTest extends SmackTestCase {
|
|||
String nameSpace = Jingle.getNamespace();
|
||||
|
||||
System.out.println("Testing if the Jingle IQ provider is registered...");
|
||||
|
||||
|
||||
// Verify that the Jingle IQProvider is registered.
|
||||
iqProv = (IQProvider)ProviderManager.getInstance().getIQProvider(elementNamee, nameSpace);
|
||||
|
||||
|
||||
assertNotNull(iqProv);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test for parsing a Jingle
|
||||
*/
|
||||
|
|
@ -93,7 +93,7 @@ public class JingleProviderTest extends SmackTestCase {
|
|||
assertTrue(iqReceived instanceof Jingle);
|
||||
|
||||
Jingle jin = (Jingle) iqReceived;
|
||||
|
||||
|
||||
System.out.println("Sent: " + iqSent.toXML());
|
||||
System.out.println("Received: " + jin.toXML());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue