X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Futils%2FActorContextTest.java;h=405fe5221b64255e086db7b37eb1af1679e4da18;hb=b14856a01f6515e6063f82e5fb448f7e9a57029b;hp=a2794bde9cbfdcbe28ffd63819b193aef2db97ab;hpb=88f763ec4ec2bcc1e0fd414ccb2f105f7490b8e9;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ActorContextTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ActorContextTest.java index a2794bde9c..405fe5221b 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ActorContextTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/utils/ActorContextTest.java @@ -35,6 +35,7 @@ import com.typesafe.config.ConfigFactory; import java.util.Arrays; import java.util.Map; import java.util.concurrent.TimeUnit; +import java.util.function.Function; import org.junit.Assert; import org.junit.Test; import org.mockito.Mockito; @@ -292,53 +293,6 @@ public class ActorContextTest extends AbstractActorTest{ assertEquals(false, actorContext.isPathLocal("akka.tcp://system@127.0.0.1:2551/")); } - @Test - public void testResolvePathForRemoteActor() { - ActorContext actorContext = - new ActorContext(getSystem(), mock(ActorRef.class), mock( - ClusterWrapper.class), - mock(Configuration.class)); - - String actual = actorContext.resolvePath( - "akka.tcp://system@127.0.0.1:2550/user/shardmanager/shard", - "akka://system/user/shardmanager/shard/transaction"); - - String expected = "akka.tcp://system@127.0.0.1:2550/user/shardmanager/shard/transaction"; - - assertEquals(expected, actual); - } - - @Test - public void testResolvePathForLocalActor() { - ActorContext actorContext = - new ActorContext(getSystem(), mock(ActorRef.class), mock(ClusterWrapper.class), - mock(Configuration.class)); - - String actual = actorContext.resolvePath( - "akka://system/user/shardmanager/shard", - "akka://system/user/shardmanager/shard/transaction"); - - String expected = "akka://system/user/shardmanager/shard/transaction"; - - assertEquals(expected, actual); - } - - @Test - public void testResolvePathForRemoteActorWithProperRemoteAddress() { - ActorContext actorContext = - new ActorContext(getSystem(), mock(ActorRef.class), mock(ClusterWrapper.class), - mock(Configuration.class)); - - String actual = actorContext.resolvePath( - "akka.tcp://system@7.0.0.1:2550/user/shardmanager/shard", - "akka.tcp://system@7.0.0.1:2550/user/shardmanager/shard/transaction"); - - String expected = "akka.tcp://system@7.0.0.1:2550/user/shardmanager/shard/transaction"; - - assertEquals(expected, actual); - } - - @Test public void testClientDispatcherIsGlobalDispatcher(){ ActorContext actorContext = @@ -544,7 +498,12 @@ public class ActorContextTest extends AbstractActorTest{ mock(ClusterWrapper.class), mockConfig, DatastoreContext.newBuilder().shardInitializationTimeout(200, TimeUnit.MILLISECONDS).build(), new PrimaryShardInfoFutureCache()); - actorContext.broadcast(new TestMessage()); + actorContext.broadcast(new Function() { + @Override + public Object apply(Short v) { + return new TestMessage(); + } + }); MessageCollectorActor.expectFirstMatching(shardActorRef1, TestMessage.class); MessageCollectorActor.expectFirstMatching(shardActorRef2, TestMessage.class);