X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fmd-sal%2Fsal-remoterpc-connector%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fremote%2Frpc%2Fregistry%2Fmbeans%2FRemoteRpcRegistryMXBeanImplTest.java;h=4d719a2a662e20643ac5c070cfce5c740b15d917;hb=66e553f2098ea61426c4a441be57395673535c2f;hp=4210437a0bb468be83a12f427b8853d6d5c1bc79;hpb=12fcdfe39aa26dcba7fd3bb4d4c68e3d02e65c51;p=controller.git diff --git a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/mbeans/RemoteRpcRegistryMXBeanImplTest.java b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/mbeans/RemoteRpcRegistryMXBeanImplTest.java index 4210437a0b..4d719a2a66 100644 --- a/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/mbeans/RemoteRpcRegistryMXBeanImplTest.java +++ b/opendaylight/md-sal/sal-remoterpc-connector/src/test/java/org/opendaylight/controller/remote/rpc/registry/mbeans/RemoteRpcRegistryMXBeanImplTest.java @@ -7,6 +7,10 @@ */ package org.opendaylight.controller.remote.rpc.registry.mbeans; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + import akka.actor.ActorRef; import akka.actor.ActorSystem; import akka.actor.Props; @@ -21,13 +25,12 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; import org.junit.After; -import org.junit.Assert; import org.junit.Before; import org.junit.Test; -import org.opendaylight.controller.md.sal.dom.api.DOMRpcIdentifier; -import org.opendaylight.controller.remote.rpc.RemoteRpcProviderConfig; +import org.opendaylight.controller.remote.rpc.RemoteOpsProviderConfig; import org.opendaylight.controller.remote.rpc.registry.RpcRegistry; import org.opendaylight.controller.remote.rpc.registry.gossip.BucketStoreAccess; +import org.opendaylight.mdsal.dom.api.DOMRpcIdentifier; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.model.api.SchemaPath; @@ -48,13 +51,13 @@ public class RemoteRpcRegistryMXBeanImplTest { system = ActorSystem.create("test"); final DOMRpcIdentifier emptyRpcIdentifier = DOMRpcIdentifier.create( - EMPTY_SCHEMA_PATH, YangInstanceIdentifier.EMPTY); + EMPTY_SCHEMA_PATH, YangInstanceIdentifier.empty()); final DOMRpcIdentifier localRpcIdentifier = DOMRpcIdentifier.create( LOCAL_SCHEMA_PATH, YangInstanceIdentifier.of(LOCAL_QNAME)); buckets = Lists.newArrayList(emptyRpcIdentifier, localRpcIdentifier); - final RemoteRpcProviderConfig config = new RemoteRpcProviderConfig.Builder("system").build(); + final RemoteOpsProviderConfig config = new RemoteOpsProviderConfig.Builder("system").build(); final TestKit invoker = new TestKit(system); final TestKit registrar = new TestKit(system); final TestKit supervisor = new TestKit(system); @@ -76,8 +79,8 @@ public class RemoteRpcRegistryMXBeanImplTest { public void testGetGlobalRpcEmptyBuckets() { final Set globalRpc = mxBean.getGlobalRpc(); - Assert.assertNotNull(globalRpc); - Assert.assertTrue(globalRpc.isEmpty()); + assertNotNull(globalRpc); + assertTrue(globalRpc.isEmpty()); } @Test @@ -85,19 +88,19 @@ public class RemoteRpcRegistryMXBeanImplTest { testActor.tell(new RpcRegistry.Messages.AddOrUpdateRoutes(Lists.newArrayList(buckets)), ActorRef.noSender()); final Set globalRpc = mxBean.getGlobalRpc(); - Assert.assertNotNull(globalRpc); - Assert.assertEquals(1, globalRpc.size()); + assertNotNull(globalRpc); + assertEquals(1, globalRpc.size()); final String rpc = globalRpc.iterator().next(); - Assert.assertEquals(EMPTY_SCHEMA_PATH.toString(), rpc); + assertEquals(EMPTY_SCHEMA_PATH.toString(), rpc); } @Test public void testGetLocalRegisteredRoutedRpcEmptyBuckets() { final Set localRegisteredRoutedRpc = mxBean.getLocalRegisteredRoutedRpc(); - Assert.assertNotNull(localRegisteredRoutedRpc); - Assert.assertTrue(localRegisteredRoutedRpc.isEmpty()); + assertNotNull(localRegisteredRoutedRpc); + assertTrue(localRegisteredRoutedRpc.isEmpty()); } @Test @@ -105,20 +108,20 @@ public class RemoteRpcRegistryMXBeanImplTest { testActor.tell(new RpcRegistry.Messages.AddOrUpdateRoutes(Lists.newArrayList(buckets)), ActorRef.noSender()); final Set localRegisteredRoutedRpc = mxBean.getLocalRegisteredRoutedRpc(); - Assert.assertNotNull(localRegisteredRoutedRpc); - Assert.assertEquals(1, localRegisteredRoutedRpc.size()); + assertNotNull(localRegisteredRoutedRpc); + assertEquals(1, localRegisteredRoutedRpc.size()); final String localRpc = localRegisteredRoutedRpc.iterator().next(); - Assert.assertTrue(localRpc.contains(LOCAL_QNAME.toString())); - Assert.assertTrue(localRpc.contains(LOCAL_SCHEMA_PATH.toString())); + assertTrue(localRpc.contains(LOCAL_QNAME.toString())); + assertTrue(localRpc.contains(LOCAL_SCHEMA_PATH.toString())); } @Test public void testFindRpcByNameEmptyBuckets() { final Map rpcByName = mxBean.findRpcByName(""); - Assert.assertNotNull(rpcByName); - Assert.assertTrue(rpcByName.isEmpty()); + assertNotNull(rpcByName); + assertTrue(rpcByName.isEmpty()); } @Test @@ -126,17 +129,17 @@ public class RemoteRpcRegistryMXBeanImplTest { testActor.tell(new RpcRegistry.Messages.AddOrUpdateRoutes(Lists.newArrayList(buckets)), ActorRef.noSender()); final Map rpcByName = mxBean.findRpcByName(""); - Assert.assertNotNull(rpcByName); - Assert.assertEquals(1, rpcByName.size()); - Assert.assertTrue(rpcByName.containsValue(LOCAL_QNAME.getLocalName())); + assertNotNull(rpcByName); + assertEquals(1, rpcByName.size()); + assertTrue(rpcByName.containsValue(LOCAL_QNAME.getLocalName())); } @Test public void testFindRpcByRouteEmptyBuckets() { final Map rpcByRoute = mxBean.findRpcByRoute(""); - Assert.assertNotNull(rpcByRoute); - Assert.assertTrue(rpcByRoute.isEmpty()); + assertNotNull(rpcByRoute); + assertTrue(rpcByRoute.isEmpty()); } @Test @@ -144,15 +147,15 @@ public class RemoteRpcRegistryMXBeanImplTest { testActor.tell(new RpcRegistry.Messages.AddOrUpdateRoutes(Lists.newArrayList(buckets)), ActorRef.noSender()); final Map rpcByRoute = mxBean.findRpcByRoute(""); - Assert.assertNotNull(rpcByRoute); - Assert.assertEquals(1, rpcByRoute.size()); - Assert.assertTrue(rpcByRoute.containsValue(LOCAL_QNAME.getLocalName())); + assertNotNull(rpcByRoute); + assertEquals(1, rpcByRoute.size()); + assertTrue(rpcByRoute.containsValue(LOCAL_QNAME.getLocalName())); } @Test public void testGetBucketVersionsEmptyBuckets() { final String bucketVersions = mxBean.getBucketVersions(); - Assert.assertEquals(Collections.EMPTY_MAP.toString(), bucketVersions); + assertEquals(Collections.emptyMap().toString(), bucketVersions); } @Test @@ -160,6 +163,6 @@ public class RemoteRpcRegistryMXBeanImplTest { testActor.tell(new RpcRegistry.Messages.AddOrUpdateRoutes(Lists.newArrayList(buckets)), ActorRef.noSender()); final String bucketVersions = mxBean.getBucketVersions(); - Assert.assertTrue(bucketVersions.contains(testActor.provider().getDefaultAddress().toString())); + assertTrue(bucketVersions.contains(testActor.provider().getDefaultAddress().toString())); } }