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

More Jingle Refactoring

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7245 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Thiago Camargo 2007-02-22 19:14:18 +00:00 committed by thiago
parent ae15ced813
commit bd176c2515
10 changed files with 375 additions and 316 deletions

View file

@ -60,15 +60,15 @@ public class STUNResolverTest extends SmackTestCase {
public void testGetPreferredCandidate() throws Exception {
int highestPref = 100;
TransportCandidate cand1 = new TransportCandidate.Ice("192.168.2.1", 3, 2,
TransportCandidate cand1 = new ICECandidate("192.168.2.1", 3, 2,
"password", 3468, "username1", 1, "");
TransportCandidate cand2 = new TransportCandidate.Ice("192.168.5.1", 2, 10,
TransportCandidate cand2 = new ICECandidate("192.168.5.1", 2, 10,
"password", 3469, "username2", 15, "");
TransportCandidate candH = new TransportCandidate.Ice("192.168.2.11", 1, 2,
TransportCandidate candH = new ICECandidate("192.168.2.11", 1, 2,
"password", 3468, "usernameH", highestPref, "");
TransportCandidate cand3 = new TransportCandidate.Ice("192.168.2.10", 2, 10,
TransportCandidate cand3 = new ICECandidate("192.168.2.10", 2, 10,
"password", 3469, "username3", 2, "");
TransportCandidate cand4 = new TransportCandidate.Ice("192.168.4.1", 3, 2,
TransportCandidate cand4 = new ICECandidate("192.168.4.1", 3, 2,
"password", 3468, "username4", 78, "");
STUNResolver stunResolver = new STUNResolver() {
@ -90,15 +90,15 @@ public class STUNResolverTest extends SmackTestCase {
public void testGetPreferredCandidateICE() throws Exception {
int highestPref = 100;
TransportCandidate cand1 = new TransportCandidate.Ice("192.168.2.1", 3, 2,
TransportCandidate cand1 = new ICECandidate("192.168.2.1", 3, 2,
"password", 3468, "username1", 1, "");
TransportCandidate cand2 = new TransportCandidate.Ice("192.168.5.1", 2, 10,
TransportCandidate cand2 = new ICECandidate("192.168.5.1", 2, 10,
"password", 3469, "username2", 15, "");
TransportCandidate candH = new TransportCandidate.Ice("192.168.2.11", 1, 2,
TransportCandidate candH = new ICECandidate("192.168.2.11", 1, 2,
"password", 3468, "usernameH", highestPref, "");
TransportCandidate cand3 = new TransportCandidate.Ice("192.168.2.10", 2, 10,
TransportCandidate cand3 = new ICECandidate("192.168.2.10", 2, 10,
"password", 3469, "username3", 2, "");
TransportCandidate cand4 = new TransportCandidate.Ice("192.168.4.1", 3, 2,
TransportCandidate cand4 = new ICECandidate("192.168.4.1", 3, 2,
"password", 3468, "username4", 78, "");
ICEResolver iceResolver = new ICEResolver(getConnection(0), "stun.xten.net", 3478) {
@ -129,11 +129,10 @@ public class STUNResolverTest extends SmackTestCase {
// priorize candidates
cc.prioritizeCandidates();
// get SortedCandidates
//List<Candidate> sortedCandidates = cc.getSortedCandidates();
for (Candidate candidate : cc.getSortedCandidates())
try {
TransportCandidate transportCandidate = new TransportCandidate.Ice(candidate.getAddress().getInetAddress().getHostAddress(), 1, candidate.getNetwork(), "1", candidate.getPort(), "1", candidate.getPriority(), "");
TransportCandidate transportCandidate = new ICECandidate(candidate.getAddress().getInetAddress().getHostAddress(), 1, candidate.getNetwork(), "1", candidate.getPort(), "1", candidate.getPriority(), "");
transportCandidate.setLocalIp(candidate.getBase().getAddress().getInetAddress().getHostAddress());
System.out.println("C: " + candidate.getAddress().getInetAddress() + "|" + candidate.getBase().getAddress().getInetAddress() + " p:" + candidate.getPriority());
}

View file

@ -18,11 +18,11 @@ public class TransportCandidateTest extends SmackTestCase {
* Test for equals()
*/
public void testEqualsObject() {
TransportCandidate cand1 = new TransportCandidate.Ice("192.168.2.1", 1, 2,
TransportCandidate cand1 = new ICECandidate("192.168.2.1", 1, 2,
"password", 3468, "username", 25, "");
TransportCandidate cand2 = new TransportCandidate.Ice("192.168.2.1", 1, 2,
TransportCandidate cand2 = new ICECandidate("192.168.2.1", 1, 2,
"password", 3468, "username", 25, "");
TransportCandidate cand3 = new TransportCandidate.Ice("192.168.2.1", 1, 2,
TransportCandidate cand3 = new ICECandidate("192.168.2.1", 1, 2,
"password", 3469, "username", 25, "");
assertEquals(cand1, cand2);
@ -35,15 +35,15 @@ public class TransportCandidateTest extends SmackTestCase {
public void testCompareTo() {
int highestPref = 100;
TransportCandidate cand1 = new TransportCandidate.Ice("192.168.2.1", 3, 2,
TransportCandidate cand1 = new ICECandidate("192.168.2.1", 3, 2,
"password", 3468, "username", 1, "");
TransportCandidate cand2 = new TransportCandidate.Ice("192.168.5.1", 2, 10,
TransportCandidate cand2 = new ICECandidate("192.168.5.1", 2, 10,
"password", 3469, "username", 15, "");
TransportCandidate candH = new TransportCandidate.Ice("192.168.2.1", 1, 2,
TransportCandidate candH = new ICECandidate("192.168.2.1", 1, 2,
"password", 3468, "username", highestPref, "");
TransportCandidate cand3 = new TransportCandidate.Ice("192.168.2.10", 2, 10,
TransportCandidate cand3 = new ICECandidate("192.168.2.10", 2, 10,
"password", 3469, "username", 2, "");
TransportCandidate cand4 = new TransportCandidate.Ice("192.168.4.1", 3, 2,
TransportCandidate cand4 = new ICECandidate("192.168.4.1", 3, 2,
"password", 3468, "username", 78, "");
ArrayList candList = new ArrayList();