X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fimplementation%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fconnector%2Fremoterpc%2FServerImplTest.java;h=7ffdf17ce761a2adb0ae763d2bcf15444e958c6f;hb=22000c97031a397b247a75ede2383f6ae792efc9;hp=886ff426c7948d4a95d778d0f5717da1f0aa582e;hpb=7eb31665534a5e8c61b4cb4ae6caf4030a3dfd36;p=controller.git diff --git a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/test/java/org/opendaylight/controller/sal/connector/remoterpc/ServerImplTest.java b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/test/java/org/opendaylight/controller/sal/connector/remoterpc/ServerImplTest.java index 886ff426c7..7ffdf17ce7 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/test/java/org/opendaylight/controller/sal/connector/remoterpc/ServerImplTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/implementation/src/test/java/org/opendaylight/controller/sal/connector/remoterpc/ServerImplTest.java @@ -8,28 +8,34 @@ package org.opendaylight.controller.sal.connector.remoterpc; -import com.google.common.base.Optional; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.ThreadPoolExecutor; + import junit.framework.Assert; -import org.junit.*; + +import org.junit.After; +import org.junit.Before; +import org.junit.Test; import org.opendaylight.controller.sal.connector.api.RpcRouter; import org.opendaylight.controller.sal.connector.remoterpc.api.RoutingTable; import org.opendaylight.controller.sal.connector.remoterpc.utils.MessagingUtil; import org.opendaylight.controller.sal.core.api.Broker; import org.opendaylight.controller.sal.core.api.RpcRegistrationListener; +import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.CompositeNode; import org.zeromq.ZMQ; + import zmq.Ctx; import zmq.SocketBase; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.ThreadPoolExecutor; - -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; +import com.google.common.base.Optional; public class ServerImplTest { @@ -68,12 +74,12 @@ public class ServerImplTest { server = new ServerImpl(port); server.setBrokerSession(brokerSession); - RoutingTable mockRoutingTable = new MockRoutingTable(); - Optional> optionalRoutingTable = Optional.fromNullable(mockRoutingTable); + RoutingTable, String> mockRoutingTable = new MockRoutingTable(); + Optional, String>> optionalRoutingTable = Optional.fromNullable(mockRoutingTable); when(routingTableProvider.getRoutingTable()).thenReturn(optionalRoutingTable); when(brokerSession.addRpcRegistrationListener(listener)).thenReturn(null); - when(brokerSession.getSupportedRpcs()).thenReturn(Collections.EMPTY_SET); + when(brokerSession.getSupportedRpcs()).thenReturn(Collections.emptySet()); when(brokerSession.rpc(null, mock(CompositeNode.class))).thenReturn(null); server.start(); Thread.sleep(5000);//wait for server to start @@ -178,7 +184,7 @@ public class ServerImplTest { Thread[] threads = new Thread[Thread.activeCount()]; Thread.enumerate(threads); - List foundThreads = new ArrayList(); + List foundThreads = new ArrayList(); for (Thread t : threads) { if (t.getName().startsWith(name)) foundThreads.add(t);