1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2025-09-12 18:49:39 +02:00

ECHO Fixes

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7473 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Thiago Camargo 2007-03-12 19:09:19 +00:00 committed by thiago
parent a078606ab4
commit 3787c7a8af
9 changed files with 159 additions and 203 deletions

View file

@ -349,44 +349,6 @@ public class STUNResolverTest extends SmackTestCase {
}
}
public void testEcho() {
TransportCandidate.Fixed c1 = new TransportCandidate.Fixed("localhost", 22222);
TransportCandidate.Fixed c2 = new TransportCandidate.Fixed("localhost", 22444);
try {
c1.addCandidateEcho(null);
c2.addCandidateEcho(null);
try {
Thread.sleep(100);
}
catch (InterruptedException e) {
e.printStackTrace();
}
TransportCandidate.CandidateEcho ce1 = c1.getCandidateEcho();
TransportCandidate.CandidateEcho ce2 = c2.getCandidateEcho();
for (int i = 0; i < 10; i++) {
assertTrue(ce1.test(InetAddress.getByName("localhost"), 22444, 100));
System.out.println("Bind OK");
}
for (int i = 0; i < 10; i++) {
assertTrue(ce2.test(InetAddress.getByName("localhost"), 22222, 100));
System.out.println("Bind OK");
}
}
catch (SocketException e) {
e.printStackTrace();
}
catch (UnknownHostException e) {
e.printStackTrace();
}
}
protected int getMaxConnections() {
return 2;
}

View file

@ -57,22 +57,6 @@ public class TransportCandidateTest extends SmackTestCase {
assertEquals(candList.get(candList.size() - 1), candH);
}
public void testEcho(){
TransportCandidate tc = new TransportCandidate("localhost",10222){
};
try {
tc.addCandidateEcho(null);
assertTrue(tc.getCandidateEcho().test(InetAddress.getByName("localhost"),10020));
}
catch (SocketException e) {
e.printStackTrace();
}
catch (UnknownHostException e) {
e.printStackTrace();
}
}
protected int getMaxConnections() {
return 0;
}