mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-12 10:39:38 +02:00
[SMACK-215] - Added ICE Types as Enum
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@8038 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
b47038b82f
commit
574cdab26f
8 changed files with 54 additions and 36 deletions
|
@ -32,6 +32,7 @@ import org.jivesoftware.smackx.jingle.media.JingleMediaManager;
|
|||
import org.jivesoftware.smackx.jingle.nat.BridgedTransportManager;
|
||||
import org.jivesoftware.smackx.jingle.nat.ICETransportManager;
|
||||
import org.jivesoftware.smackx.jingle.nat.STUNTransportManager;
|
||||
import org.jivesoftware.smackx.packet.JingleError;
|
||||
|
||||
import javax.media.MediaLocator;
|
||||
import javax.media.format.AudioFormat;
|
||||
|
@ -316,7 +317,11 @@ public class JingleMediaTest extends SmackTestCase {
|
|||
|
||||
js0.start();
|
||||
|
||||
Thread.sleep(55000);
|
||||
Thread.sleep(20000);
|
||||
|
||||
js0.sendFormattedError(JingleError.UNSUPPORTED_TRANSPORTS);
|
||||
|
||||
Thread.sleep(20000);
|
||||
|
||||
js0.terminate();
|
||||
|
||||
|
@ -371,7 +376,7 @@ public class JingleMediaTest extends SmackTestCase {
|
|||
try {
|
||||
|
||||
IncomingJingleSession session = request.accept(jm1.getMediaManager().getPayloads());
|
||||
|
||||
|
||||
session.start(request);
|
||||
}
|
||||
catch (XMPPException e) {
|
||||
|
|
|
@ -61,15 +61,15 @@ public class STUNResolverTest extends SmackTestCase {
|
|||
int highestPref = 100;
|
||||
|
||||
TransportCandidate cand1 = new ICECandidate("192.168.2.1", 3, 2,
|
||||
"password", 3468, "username1", 1, "");
|
||||
"password", 3468, "username1", 1, ICECandidate.Type.prflx);
|
||||
TransportCandidate cand2 = new ICECandidate("192.168.5.1", 2, 10,
|
||||
"password", 3469, "username2", 15, "");
|
||||
"password", 3469, "username2", 15, ICECandidate.Type.prflx);
|
||||
TransportCandidate candH = new ICECandidate("192.168.2.11", 1, 2,
|
||||
"password", 3468, "usernameH", highestPref, "");
|
||||
"password", 3468, "usernameH", highestPref, ICECandidate.Type.prflx);
|
||||
TransportCandidate cand3 = new ICECandidate("192.168.2.10", 2, 10,
|
||||
"password", 3469, "username3", 2, "");
|
||||
"password", 3469, "username3", 2, ICECandidate.Type.prflx);
|
||||
TransportCandidate cand4 = new ICECandidate("192.168.4.1", 3, 2,
|
||||
"password", 3468, "username4", 78, "");
|
||||
"password", 3468, "username4", 78, ICECandidate.Type.prflx);
|
||||
|
||||
STUNResolver stunResolver = new STUNResolver() {
|
||||
};
|
||||
|
@ -91,15 +91,15 @@ public class STUNResolverTest extends SmackTestCase {
|
|||
int highestPref = 100;
|
||||
|
||||
TransportCandidate cand1 = new ICECandidate("192.168.2.1", 3, 2,
|
||||
"password", 3468, "username1", 1, "");
|
||||
"password", 3468, "username1", 1, ICECandidate.Type.prflx);
|
||||
TransportCandidate cand2 = new ICECandidate("192.168.5.1", 2, 10,
|
||||
"password", 3469, "username2", 15, "");
|
||||
"password", 3469, "username2", 15, ICECandidate.Type.prflx);
|
||||
TransportCandidate candH = new ICECandidate("192.168.2.11", 1, 2,
|
||||
"password", 3468, "usernameH", highestPref, "");
|
||||
"password", 3468, "usernameH", highestPref, ICECandidate.Type.prflx);
|
||||
TransportCandidate cand3 = new ICECandidate("192.168.2.10", 2, 10,
|
||||
"password", 3469, "username3", 2, "");
|
||||
"password", 3469, "username3", 2, ICECandidate.Type.prflx);
|
||||
TransportCandidate cand4 = new ICECandidate("192.168.4.1", 3, 2,
|
||||
"password", 3468, "username4", 78, "");
|
||||
"password", 3468, "username4", 78, ICECandidate.Type.prflx);
|
||||
|
||||
ICEResolver iceResolver = new ICEResolver(getConnection(0), "stun.xten.net", 3478) {
|
||||
};
|
||||
|
@ -132,7 +132,7 @@ public class STUNResolverTest extends SmackTestCase {
|
|||
|
||||
for (Candidate candidate : cc.getSortedCandidates())
|
||||
try {
|
||||
TransportCandidate transportCandidate = new ICECandidate(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(), ICECandidate.Type.prflx);
|
||||
transportCandidate.setLocalIp(candidate.getBase().getAddress().getInetAddress().getHostAddress());
|
||||
System.out.println("C: " + candidate.getAddress().getInetAddress() + "|" + candidate.getBase().getAddress().getInetAddress() + " p:" + candidate.getPriority());
|
||||
}
|
||||
|
|
|
@ -19,11 +19,11 @@ public class TransportCandidateTest extends SmackTestCase {
|
|||
*/
|
||||
public void testEqualsObject() {
|
||||
TransportCandidate cand1 = new ICECandidate("192.168.2.1", 1, 2,
|
||||
"password", 3468, "username", 25, "");
|
||||
"password", 3468, "username", 25, ICECandidate.Type.prflx);
|
||||
TransportCandidate cand2 = new ICECandidate("192.168.2.1", 1, 2,
|
||||
"password", 3468, "username", 25, "");
|
||||
"password", 3468, "username", 25, ICECandidate.Type.prflx);
|
||||
TransportCandidate cand3 = new ICECandidate("192.168.2.1", 1, 2,
|
||||
"password", 3469, "username", 25, "");
|
||||
"password", 3469, "username", 25, ICECandidate.Type.prflx);
|
||||
|
||||
assertEquals(cand1, cand2);
|
||||
assertFalse(cand1.equals(cand3));
|
||||
|
@ -36,15 +36,15 @@ public class TransportCandidateTest extends SmackTestCase {
|
|||
int highestPref = 100;
|
||||
|
||||
TransportCandidate cand1 = new ICECandidate("192.168.2.1", 3, 2,
|
||||
"password", 3468, "username", 1, "");
|
||||
"password", 3468, "username", 1, ICECandidate.Type.prflx);
|
||||
TransportCandidate cand2 = new ICECandidate("192.168.5.1", 2, 10,
|
||||
"password", 3469, "username", 15, "");
|
||||
"password", 3469, "username", 15,ICECandidate.Type.prflx);
|
||||
TransportCandidate candH = new ICECandidate("192.168.2.1", 1, 2,
|
||||
"password", 3468, "username", highestPref, "");
|
||||
"password", 3468, "username", highestPref, ICECandidate.Type.prflx);
|
||||
TransportCandidate cand3 = new ICECandidate("192.168.2.10", 2, 10,
|
||||
"password", 3469, "username", 2, "");
|
||||
"password", 3469, "username", 2, ICECandidate.Type.prflx);
|
||||
TransportCandidate cand4 = new ICECandidate("192.168.4.1", 3, 2,
|
||||
"password", 3468, "username", 78, "");
|
||||
"password", 3468, "username", 78, ICECandidate.Type.prflx);
|
||||
|
||||
ArrayList candList = new ArrayList();
|
||||
candList.add(cand1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue