Changeset 228bd98


Ignore:
Timestamp:
Nov 20, 2013 10:47:14 PM (7 years ago)
Author:
str4d <str4d@…>
Branches:
master
Children:
24ae66d
Parents:
f161a2d
Message:

Router JUnit tests: type arguments, unused imports

Location:
router/java/test/junit/net/i2p
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • router/java/test/junit/net/i2p/data/i2np/DateMessage.java

    rf161a2d r228bd98  
    88 *
    99 */
    10 
    11 import java.io.IOException;
    1210
    1311import net.i2p.I2PAppContext;
  • router/java/test/junit/net/i2p/data/i2np/DeliveryInstructionsTest.java

    rf161a2d r228bd98  
    1212import net.i2p.data.DataStructure;
    1313import net.i2p.data.Hash;
    14 import net.i2p.data.SessionKey;
    1514import net.i2p.data.StructureTest;
    1615import net.i2p.data.TunnelId;
  • router/java/test/junit/net/i2p/data/i2np/TunnelCreateMessage.java

    rf161a2d r228bd98  
    99 */
    1010
    11 import java.io.IOException;
    1211import java.util.Properties;
    1312
  • router/java/test/junit/net/i2p/data/i2np/TunnelCreateStatusMessage.java

    rf161a2d r228bd98  
    88 *
    99 */
    10 
    11 import java.io.IOException;
    1210
    1311import net.i2p.I2PAppContext;
  • router/java/test/junit/net/i2p/router/message/BuildTestMessageJob.java

    rf161a2d r228bd98  
    1717import net.i2p.data.RouterInfo;
    1818import net.i2p.data.SessionKey;
     19import net.i2p.data.SessionTag;
    1920import net.i2p.data.i2np.DeliveryInstructions;
    2021import net.i2p.data.i2np.DeliveryStatusMessage;
     
    8182        GarlicConfig config = buildGarlicCloveConfig();
    8283        // TODO: make the last params on this specify the correct sessionKey and tags used
    83         ReplyJob replyJob = new JobReplyJob(getContext(), _onSend, config.getRecipient().getIdentity().getPublicKey(), config.getId(), null, new HashSet());
     84        ReplyJob replyJob = new JobReplyJob(getContext(), _onSend, config.getRecipient().getIdentity().getPublicKey(), config.getId(), null, new HashSet<SessionTag>());
    8485        MessageSelector sel = buildMessageSelector();
    8586        SendGarlicJob job = new SendGarlicJob(getContext(), config, null, _onSendFailed, replyJob, _onSendFailed, _timeoutMs, _priority, sel);
     
    184185        private PublicKey _target;
    185186        private long _msgId;
    186         private Set _sessionTagsDelivered;
     187        private Set<SessionTag> _sessionTagsDelivered;
    187188        private SessionKey _keyDelivered;
    188         public JobReplyJob(RouterContext ctx, Job job, PublicKey target, long msgId, SessionKey keyUsed, Set tagsDelivered) {
     189        public JobReplyJob(RouterContext ctx, Job job, PublicKey target, long msgId, SessionKey keyUsed, Set<SessionTag> tagsDelivered) {
    189190            super(ctx);
    190191            _job = job;
  • router/java/test/junit/net/i2p/router/message/OutboundClientMessageStatus.java

    rf161a2d r228bd98  
    2121    private PayloadGarlicConfig _clove;
    2222    private LeaseSet _leaseSet;
    23     private final Set _sent;
     23    private final Set<Tunnel> _sent;
    2424    private int _numLookups;
    2525    private boolean _success;
     
    3333        _clove = null;
    3434        _leaseSet = null;
    35         _sent = new HashSet(4);
     35        _sent = new HashSet<Tunnel>(4);
    3636        _success = false;
    3737        _failure = false;
  • router/java/test/junit/net/i2p/router/message/SendGarlicJob.java

    rf161a2d r228bd98  
    5454     */
    5555    public SendGarlicJob(RouterContext ctx, GarlicConfig config, Job onSend, Job onSendFailed, ReplyJob onReply, Job onReplyFailed, long timeoutMs, int priority, MessageSelector replySelector) {
    56         this(ctx, config, onSend, onSendFailed, onReply, onReplyFailed, timeoutMs, priority, replySelector, new SessionKey(), new HashSet());
     56        this(ctx, config, onSend, onSendFailed, onReply, onReplyFailed, timeoutMs, priority, replySelector, new SessionKey(), new HashSet<SessionTag>());
    5757    }
    58     public SendGarlicJob(RouterContext ctx, GarlicConfig config, Job onSend, Job onSendFailed, ReplyJob onReply, Job onReplyFailed, long timeoutMs, int priority, MessageSelector replySelector, SessionKey wrappedKey, Set wrappedTags) {
     58    public SendGarlicJob(RouterContext ctx, GarlicConfig config, Job onSend, Job onSendFailed, ReplyJob onReply, Job onReplyFailed, long timeoutMs, int priority, MessageSelector replySelector, SessionKey wrappedKey, Set<SessionTag> wrappedTags) {
    5959        super(ctx);
    6060        _log = ctx.logManager().getLog(SendGarlicJob.class);
  • router/java/test/junit/net/i2p/router/networkdb/kademlia/RouterGenerator.java

    rf161a2d r228bd98  
    113113    }
    114114   
    115     static Set createAddresses(int num) {
    116         Set addresses = new HashSet();
     115    static Set<RouterAddress> createAddresses(int num) {
     116        Set<RouterAddress> addresses = new HashSet<RouterAddress>();
    117117        RouterAddress addr = createTCPAddress(num);
    118118        if (addr != null)
  • router/java/test/junit/net/i2p/router/transport/udp/UDPEndpointTestStandalone.java

    rf161a2d r228bd98  
    2525    private UDPEndpoint _endpoints[];
    2626    private volatile boolean _beginTest;
    27     private final List _sentNotReceived;
     27    private final List<ByteArray> _sentNotReceived;
    2828   
    2929    public UDPEndpointTestStandalone(RouterContext ctx) {
    3030        _context = ctx;
    3131        _log = ctx.logManager().getLog(UDPEndpointTestStandalone.class);
    32         _sentNotReceived = Collections.synchronizedList(new ArrayList(1000));
     32        _sentNotReceived = Collections.synchronizedList(new ArrayList<ByteArray>(1000));
    3333    }
    3434   
  • router/java/test/junit/net/i2p/router/transport/udp/UDPFlooder.java

    rf161a2d r228bd98  
    2020    // private Log _log;
    2121    private UDPTransport _transport;
    22     private final List _peers;
     22    private final List<PeerState> _peers;
    2323    private boolean _alive;
    2424    private static final byte _floodData[] = new byte[4096];
     
    2828        // _log = ctx.logManager().getLog(UDPFlooder.class);
    2929        _transport = transport;
    30         _peers = new ArrayList(4);
     30        _peers = new ArrayList<PeerState>(4);
    3131        ctx.random().nextBytes(_floodData);
    3232    }
  • router/java/test/junit/net/i2p/router/tunnel/BatchedFragmentTest.java

    rf161a2d r228bd98  
    4242    public void testBatched() {
    4343        PendingGatewayMessage pending1 = createPending(10, false, false);
    44         ArrayList messages = new ArrayList();
     44        ArrayList<PendingGatewayMessage> messages = new ArrayList<PendingGatewayMessage>();
    4545        messages.add(pending1);
    4646       
     
    7878    public void testSingle() {
    7979        PendingGatewayMessage pending = createPending(949, false, false);
    80         ArrayList messages = new ArrayList();
     80        ArrayList<PendingGatewayMessage> messages = new ArrayList<PendingGatewayMessage>();
    8181        messages.add(pending);
    8282
     
    104104    public void testMultiple() throws Exception {
    105105        PendingGatewayMessage pending = createPending(2048, false, false);
    106         ArrayList messages = new ArrayList();
     106        ArrayList<PendingGatewayMessage> messages = new ArrayList<PendingGatewayMessage>();
    107107        messages.add(pending);
    108108       
     
    177177   
    178178    private void runBatch(PendingGatewayMessage pending1, PendingGatewayMessage pending2, PendingGatewayMessage pending3) {
    179         ArrayList messages = new ArrayList();
     179        ArrayList<PendingGatewayMessage> messages = new ArrayList<PendingGatewayMessage>();
    180180        messages.add(pending1);
    181181       
  • router/java/test/junit/net/i2p/router/tunnel/FragmentTest.java

    rf161a2d r228bd98  
    5555    public void testSingle() {
    5656        PendingGatewayMessage pending = createPending(949, false, false);
    57         ArrayList messages = new ArrayList();
     57        ArrayList<PendingGatewayMessage> messages = new ArrayList<PendingGatewayMessage>();
    5858        messages.add(pending);
    5959
     
    7878    public void testMultiple() throws Exception {
    7979        PendingGatewayMessage pending = createPending(2048, false, false);
    80         ArrayList messages = new ArrayList();
     80        ArrayList<PendingGatewayMessage> messages = new ArrayList<PendingGatewayMessage>();
    8181        messages.add(pending);
    8282       
     
    101101    public void runDelayed() {
    102102        PendingGatewayMessage pending = createPending(2048, false, false);
    103         ArrayList messages = new ArrayList();
     103        ArrayList<PendingGatewayMessage> messages = new ArrayList<PendingGatewayMessage>();
    104104        messages.add(pending);
    105105        TunnelGateway.QueuePreprocessor pre = createPreprocessor(_context);
     
    127127    protected boolean runVaried(int size, boolean includeRouter, boolean includeTunnel) {
    128128        PendingGatewayMessage pending = createPending(size, includeRouter, includeTunnel);
    129         ArrayList messages = new ArrayList();
     129        ArrayList<PendingGatewayMessage> messages = new ArrayList<PendingGatewayMessage>();
    130130        messages.add(pending);
    131131       
  • router/java/test/junit/net/i2p/router/tunnel/GatewayTestBase.java

    rf161a2d r228bd98  
    4949        int runCount = 1;
    5050       
    51         List messages = new ArrayList(runCount);
     51        List<DataMessage> messages = new ArrayList<DataMessage>(runCount);
    5252        long start = _context.clock().now();
    5353   
     
    6060        Thread.sleep(1000);
    6161       
    62         List received = _receiver.clearReceived();
     62        List<I2NPMessage> received = _receiver.clearReceived();
    6363        for (int i = 0; i < messages.size(); i++) {
    6464            assertTrue(received.contains(((I2NPMessage)messages.get(i))));
     
    7070        int runCount = 1;
    7171       
    72         List messages = new ArrayList(runCount);
     72        List<DataMessage> messages = new ArrayList<DataMessage>(runCount);
    7373        long start = _context.clock().now();
    7474   
     
    8383        Thread.sleep(1000);
    8484       
    85         List received = _receiver.clearReceived();
     85        List<I2NPMessage> received = _receiver.clearReceived();
    8686        for (int i = 0; i < messages.size(); i++) {
    8787            assertTrue(received.contains(((I2NPMessage)messages.get(i))));
     
    9393        int runCount = 1;
    9494       
    95         List messages = new ArrayList(runCount);
     95        List<DataMessage> messages = new ArrayList<DataMessage>(runCount);
    9696        long start = _context.clock().now();
    9797   
     
    108108        Thread.sleep(1000);
    109109       
    110         List received = _receiver.clearReceived();
     110        List<I2NPMessage> received = _receiver.clearReceived();
    111111        for (int i = 0; i < messages.size(); i++) {
    112112            assertTrue(received.contains(((I2NPMessage)messages.get(i))));
     
    118118        int runCount = 1;
    119119       
    120         List messages = new ArrayList(runCount);
     120        List<DataMessage> messages = new ArrayList<DataMessage>(runCount);
    121121        long start = _context.clock().now();
    122122   
     
    129129        Thread.sleep(1000);
    130130       
    131         List received = _receiver.clearReceived();
     131        List<I2NPMessage> received = _receiver.clearReceived();
    132132        for (int i = 0; i < messages.size(); i++) {
    133133            assertTrue(received.contains(((I2NPMessage)messages.get(i))));
     
    149149        private TunnelCreatorConfig _config;
    150150        private FragmentHandler _handler;
    151         private volatile List _received;
     151        private volatile List<I2NPMessage> _received;
    152152        public TestReceiver(TunnelCreatorConfig config) {
    153153            _config = config;
    154154            _handler = new FragmentHandler(_context, TestReceiver.this);
    155             _received = new ArrayList(1000);
     155            _received = new ArrayList<I2NPMessage>(1000);
    156156        }
    157157        public long receiveEncrypted(byte[] encrypted) {
     
    175175            _received.add(msg);
    176176        }
    177         public List clearReceived() {
    178             List rv = _received;
    179             _received = new ArrayList();
     177        public List<I2NPMessage> clearReceived() {
     178            List<I2NPMessage> rv = _received;
     179            _received = new ArrayList<I2NPMessage>();
    180180            return rv;
    181181        }
  • router/java/test/junit/net/i2p/router/tunnel/OutboundTest.java

    rf161a2d r228bd98  
    1010
    1111import junit.framework.TestCase;
    12 import net.i2p.I2PAppContext;
    1312import net.i2p.data.DataHelper;
    1413import net.i2p.data.Hash;
Note: See TracChangeset for help on using the changeset viewer.