From ae15ced8130290f60b908cd753adb96f6f76b4d4 Mon Sep 17 00:00:00 2001 From: Thiago Camargo Date: Thu, 22 Feb 2007 16:54:13 +0000 Subject: [PATCH] Echo Test Added git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@7241 b35dd754-fafc-0310-a699-88a17e54d16e --- .../jingle/nat/TransportCandidateTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/jingle/extension/test/org/jivesoftware/smackx/jingle/nat/TransportCandidateTest.java b/jingle/extension/test/org/jivesoftware/smackx/jingle/nat/TransportCandidateTest.java index 53676b6cf..505cd1455 100644 --- a/jingle/extension/test/org/jivesoftware/smackx/jingle/nat/TransportCandidateTest.java +++ b/jingle/extension/test/org/jivesoftware/smackx/jingle/nat/TransportCandidateTest.java @@ -2,6 +2,9 @@ package org.jivesoftware.smackx.jingle.nat; import java.util.ArrayList; import java.util.Collections; +import java.net.SocketException; +import java.net.UnknownHostException; +import java.net.InetAddress; import org.jivesoftware.smack.test.SmackTestCase; @@ -54,6 +57,22 @@ public class TransportCandidateTest extends SmackTestCase { assertEquals(candList.get(candList.size() - 1), candH); } + public void testEcho(){ + TransportCandidate tc = new TransportCandidate("localhost",10222){ + + }; + try { + tc.addCandidateEcho(); + assertTrue(tc.getCandidateEcho().test(InetAddress.getByName("localhost"),10020)); + } + catch (SocketException e) { + e.printStackTrace(); + } + catch (UnknownHostException e) { + e.printStackTrace(); + } + } + protected int getMaxConnections() { return 0; }