2 * Copyright (c) 2014 Pantheon Technologies s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.openflowjava.protocol.impl.core.connection;
11 import io.netty.util.concurrent.Future;
12 import io.netty.util.concurrent.GenericFutureListener;
14 import java.net.InetSocketAddress;
16 import org.junit.Assert;
17 import org.junit.Before;
18 import org.junit.Test;
19 import org.mockito.Mock;
20 import org.mockito.MockitoAnnotations;
21 import org.opendaylight.openflowjava.protocol.impl.core.connection.UdpMessageListenerWrapper;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader;
29 public class UdpMessageListenerWrapperTest {
31 @Mock GenericFutureListener<Future<Void>> listener;
35 public void startUp(){
36 MockitoAnnotations.initMocks(this);
44 String host ="localhost";
45 InetSocketAddress inetSockAddr = InetSocketAddress.createUnresolved(host, port);
46 UdpMessageListenerWrapper wrapper = new UdpMessageListenerWrapper(msg,listener,inetSockAddr);
48 Assert.assertEquals("Wrong getAddress", inetSockAddr, wrapper.getAddress());
49 Assert.assertEquals("Wrong getListener", listener, wrapper.getListener());
50 Assert.assertEquals("Wrong getMsg", msg, wrapper.getMsg());