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

SMACK-363 Applied code cleanup patches for many generics related issues.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@13325 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
rcollier 2012-10-26 10:47:55 +00:00
parent 6dc64671e2
commit e08c8afe44
109 changed files with 577 additions and 605 deletions

View file

@ -4,6 +4,7 @@ import java.util.ArrayList;
import org.jivesoftware.smack.test.SmackTestCase;
import org.jivesoftware.smackx.jingle.media.PayloadType;
import org.jivesoftware.smackx.jingle.media.PayloadType.Audio;
public class PayloadTypeTest extends SmackTestCase {
@ -21,8 +22,8 @@ public class PayloadTypeTest extends SmackTestCase {
* Test for the difference of payloads.
*/
public void testDifference() {
ArrayList set1 = new ArrayList();
ArrayList set2 = new ArrayList();
ArrayList<Audio> set1 = new ArrayList<Audio>();
ArrayList<Audio> set2 = new ArrayList<Audio>();
PayloadType.Audio common1 = new PayloadType.Audio(34, "supercodec-1", 2, 14000);
PayloadType.Audio common2 = new PayloadType.Audio(56, "supercodec-2", 1, 44000);
@ -38,7 +39,7 @@ public class PayloadTypeTest extends SmackTestCase {
set2.add(common1);
// Get the difference
ArrayList commonSet = new ArrayList();
ArrayList<Audio> commonSet = new ArrayList<Audio>();
commonSet.addAll(set1);
commonSet.retainAll(set2);
@ -54,8 +55,8 @@ public class PayloadTypeTest extends SmackTestCase {
* Test for the difference of payloads when we are handling the same sets.
*/
public void testDifferenceSameSet() {
ArrayList set1 = new ArrayList();
ArrayList set2 = new ArrayList();
ArrayList<Audio> set1 = new ArrayList<Audio>();
ArrayList<Audio> set2 = new ArrayList<Audio>();
PayloadType.Audio common1 = new PayloadType.Audio(34, "supercodec-1", 2, 14000);
PayloadType.Audio common2 = new PayloadType.Audio(56, "supercodec-2", 1, 44000);
@ -73,7 +74,7 @@ public class PayloadTypeTest extends SmackTestCase {
set2.add(common4);
// Get the difference
ArrayList commonSet = new ArrayList();
ArrayList<Audio> commonSet = new ArrayList<Audio>();
commonSet.addAll(set1);
commonSet.retainAll(set2);

View file

@ -1,5 +1,6 @@
package org.jivesoftware.smackx.jingle.nat;
import de.javawi.jstun.test.demo.StunServer;
import de.javawi.jstun.test.demo.ice.Candidate;
import de.javawi.jstun.test.demo.ice.ICENegociator;
import de.javawi.jstun.util.UtilityException;
@ -13,6 +14,7 @@ import org.jivesoftware.smackx.jingle.listeners.JingleSessionRequestListener;
import org.jivesoftware.smackx.jingle.media.JingleMediaManager;
import org.jivesoftware.smackx.jingle.media.PayloadType;
import org.jivesoftware.smackx.jingle.mediaimpl.test.TestMediaManager;
import org.jivesoftware.smackx.jingle.nat.STUNResolver.STUNService;
import java.net.NetworkInterface;
import java.net.SocketException;
@ -182,7 +184,7 @@ public class STUNResolverTest extends SmackTestCase {
public void testLoadSTUNServers() throws Exception {
STUNResolver stunResolver = new STUNResolver() {
};
ArrayList stunServers = stunResolver.loadSTUNServers();
ArrayList<STUNService> stunServers = stunResolver.loadSTUNServers();
assertTrue(stunServers.size() > 0);
System.out.println(stunServers.size() + " servers loaded");
@ -244,8 +246,8 @@ public class STUNResolverTest extends SmackTestCase {
*
* @return A testing list
*/
private ArrayList getTestPayloads1() {
ArrayList result = new ArrayList();
private ArrayList<PayloadType> getTestPayloads1() {
ArrayList<PayloadType> result = new ArrayList<PayloadType>();
result.add(new PayloadType.Audio(34, "supercodec-1", 2, 14000));
result.add(new PayloadType.Audio(56, "supercodec-2", 1, 44000));
@ -255,8 +257,8 @@ public class STUNResolverTest extends SmackTestCase {
return result;
}
private ArrayList getTestPayloads2() {
ArrayList result = new ArrayList();
private ArrayList<PayloadType> getTestPayloads2() {
ArrayList<PayloadType> result = new ArrayList<PayloadType>();
result.add(new PayloadType.Audio(27, "supercodec-3", 2, 28000));
result.add(new PayloadType.Audio(56, "supercodec-2", 1, 44000));

View file

@ -2,9 +2,6 @@ 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;
@ -35,18 +32,18 @@ public class TransportCandidateTest extends SmackTestCase {
public void testCompareTo() {
int highestPref = 100;
TransportCandidate cand1 = new ICECandidate("192.168.2.1", 3, 2,
ICECandidate cand1 = new ICECandidate("192.168.2.1", 3, 2,
"password", 3468, "username", 1, ICECandidate.Type.prflx);
TransportCandidate cand2 = new ICECandidate("192.168.5.1", 2, 10,
ICECandidate cand2 = new ICECandidate("192.168.5.1", 2, 10,
"password", 3469, "username", 15,ICECandidate.Type.prflx);
TransportCandidate candH = new ICECandidate("192.168.2.1", 1, 2,
ICECandidate candH = new ICECandidate("192.168.2.1", 1, 2,
"password", 3468, "username", highestPref, ICECandidate.Type.prflx);
TransportCandidate cand3 = new ICECandidate("192.168.2.10", 2, 10,
ICECandidate cand3 = new ICECandidate("192.168.2.10", 2, 10,
"password", 3469, "username", 2, ICECandidate.Type.prflx);
TransportCandidate cand4 = new ICECandidate("192.168.4.1", 3, 2,
ICECandidate cand4 = new ICECandidate("192.168.4.1", 3, 2,
"password", 3468, "username", 78, ICECandidate.Type.prflx);
ArrayList candList = new ArrayList();
ArrayList<ICECandidate> candList = new ArrayList<ICECandidate>();
candList.add(cand1);
candList.add(cand2);
candList.add(candH);