mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-13 19:19:38 +02:00
ECHO Refactoring
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7460 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
41fbc3906a
commit
a078606ab4
21 changed files with 136 additions and 80 deletions
|
@ -2,6 +2,7 @@ package org.jivesoftware.smackx.jingle;
|
|||
|
||||
import org.jivesoftware.smack.test.SmackTestCase;
|
||||
import org.jivesoftware.smackx.jingle.nat.BasicResolver;
|
||||
import org.jivesoftware.smackx.jingle.nat.BasicTransportManager;
|
||||
|
||||
public class JingleSessionTest extends SmackTestCase {
|
||||
|
||||
|
@ -10,9 +11,9 @@ public class JingleSessionTest extends SmackTestCase {
|
|||
}
|
||||
|
||||
public void testEqualsObject() {
|
||||
JingleSession js1 = new OutgoingJingleSession(getConnection(0), "res1", null, new BasicResolver());
|
||||
JingleSession js2 = new OutgoingJingleSession(getConnection(1), "res1", null, new BasicResolver());
|
||||
JingleSession js3 = new OutgoingJingleSession(getConnection(2), "res2", null, new BasicResolver());
|
||||
JingleSession js1 = new OutgoingJingleSession(getConnection(0), "res1", null, new BasicTransportManager());
|
||||
JingleSession js2 = new OutgoingJingleSession(getConnection(1), "res1", null, new BasicTransportManager());
|
||||
JingleSession js3 = new OutgoingJingleSession(getConnection(2), "res2", null, new BasicTransportManager());
|
||||
|
||||
System.out.println(js1.getSid());
|
||||
System.out.println(js2.getSid());
|
||||
|
@ -34,8 +35,8 @@ public class JingleSessionTest extends SmackTestCase {
|
|||
String ini2 = "initiator2";
|
||||
String sid2 = "sid2";
|
||||
|
||||
JingleSession js1 = new OutgoingJingleSession(getConnection(0), sid1, null, new BasicResolver());
|
||||
JingleSession js2 = new OutgoingJingleSession(getConnection(1), sid2, null, new BasicResolver());
|
||||
JingleSession js1 = new OutgoingJingleSession(getConnection(0), sid1, null, new BasicTransportManager());
|
||||
JingleSession js2 = new OutgoingJingleSession(getConnection(1), sid2, null, new BasicTransportManager());
|
||||
|
||||
// For a packet, we should be able to get a session that handles that...
|
||||
assertNotNull(JingleSession.getInstanceFor(getConnection(0)));
|
||||
|
|
|
@ -205,10 +205,9 @@ public class STUNResolverTest extends SmackTestCase {
|
|||
});
|
||||
|
||||
try {
|
||||
stunResolver.initialize();
|
||||
stunResolver.initializeAndWait();
|
||||
Thread.sleep(55000);
|
||||
assertTrue(valCounter() > 0);
|
||||
stunResolver.resolve();
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
@ -257,8 +256,8 @@ public class STUNResolverTest extends SmackTestCase {
|
|||
};
|
||||
|
||||
// Explicit resolution
|
||||
tr1.resolve();
|
||||
tr2.resolve();
|
||||
tr1.resolve(null);
|
||||
tr2.resolve(null);
|
||||
|
||||
final JingleManager man0 = new JingleManager(getConnection(0), tr1);
|
||||
final JingleManager man1 = new JingleManager(getConnection(1), tr2);
|
||||
|
@ -356,8 +355,8 @@ public class STUNResolverTest extends SmackTestCase {
|
|||
TransportCandidate.Fixed c2 = new TransportCandidate.Fixed("localhost", 22444);
|
||||
|
||||
try {
|
||||
c1.addCandidateEcho();
|
||||
c2.addCandidateEcho();
|
||||
c1.addCandidateEcho(null);
|
||||
c2.addCandidateEcho(null);
|
||||
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
|
|
|
@ -62,7 +62,7 @@ public class TransportCandidateTest extends SmackTestCase {
|
|||
|
||||
};
|
||||
try {
|
||||
tc.addCandidateEcho();
|
||||
tc.addCandidateEcho(null);
|
||||
assertTrue(tc.getCandidateEcho().test(InetAddress.getByName("localhost"),10020));
|
||||
}
|
||||
catch (SocketException e) {
|
||||
|
|
|
@ -36,7 +36,7 @@ public class TransportResolverTest extends SmackTestCase {
|
|||
assertFalse(tr.isResolved());
|
||||
|
||||
try {
|
||||
tr.resolve();
|
||||
tr.resolve(null);
|
||||
} catch (XMPPException e) {
|
||||
e.printStackTrace();
|
||||
fail("Error resolving");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue