X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Futils%2FActorContextTest.java;h=960e0328d6cab5142d59540df7cbcdafffff49eb;hp=78a00fb00ea169a75314940a7294f8b8437eda0a;hb=c32a09739f0f7a008fe203b7b4ca172755136307;hpb=5464f50be733df1bbbe31cf05665d542d3b7c5e7;ds=sidebyside 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 78a00fb00e..960e0328d6 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 @@ -110,11 +110,11 @@ public class ActorContextTest extends AbstractActorTest { } private static Props props(final boolean found, final ActorRef actorRef) { - return Props.create(new MockShardManagerCreator(found, actorRef) ); + return Props.create(new MockShardManagerCreator(found, actorRef)); } private static Props props() { - return Props.create(new MockShardManagerCreator() ); + return Props.create(new MockShardManagerCreator()); } @SuppressWarnings("serial") @@ -256,13 +256,13 @@ public class ActorContextTest extends AbstractActorTest { assertEquals(true, actorContext.isPathLocal("akka://test/user/token2/token3/$a")); // self address of remote format,but Tx path local format. - clusterWrapper.setSelfAddress(new Address("akka.tcp", "system", "127.0.0.1", 2550)); + clusterWrapper.setSelfAddress(new Address("akka", "system", "127.0.0.1", 2550)); actorContext = new ActorContext(getSystem(), null, clusterWrapper, mock(Configuration.class)); assertEquals(true, actorContext.isPathLocal( "akka://system/user/shardmanager/shard/transaction")); // self address of local format,but Tx path remote format. - clusterWrapper.setSelfAddress(new Address("akka.tcp", "system")); + clusterWrapper.setSelfAddress(new Address("akka", "system")); actorContext = new ActorContext(getSystem(), null, clusterWrapper, mock(Configuration.class)); assertEquals(false, actorContext.isPathLocal( "akka://system@127.0.0.1:2550/user/shardmanager/shard/transaction")); @@ -273,24 +273,24 @@ public class ActorContextTest extends AbstractActorTest { assertEquals(true, actorContext.isPathLocal("akka://test1/user/$a")); //ip and port same - clusterWrapper.setSelfAddress(new Address("akka.tcp", "system", "127.0.0.1", 2550)); + clusterWrapper.setSelfAddress(new Address("akka", "system", "127.0.0.1", 2550)); actorContext = new ActorContext(getSystem(), null, clusterWrapper, mock(Configuration.class)); - assertEquals(true, actorContext.isPathLocal("akka.tcp://system@127.0.0.1:2550/")); + assertEquals(true, actorContext.isPathLocal("akka://system@127.0.0.1:2550/")); // forward-slash missing in address - clusterWrapper.setSelfAddress(new Address("akka.tcp", "system", "127.0.0.1", 2550)); + clusterWrapper.setSelfAddress(new Address("akka", "system", "127.0.0.1", 2550)); actorContext = new ActorContext(getSystem(), null, clusterWrapper, mock(Configuration.class)); - assertEquals(false, actorContext.isPathLocal("akka.tcp://system@127.0.0.1:2550")); + assertEquals(false, actorContext.isPathLocal("akka://system@127.0.0.1:2550")); //ips differ - clusterWrapper.setSelfAddress(new Address("akka.tcp", "system", "127.0.0.1", 2550)); + clusterWrapper.setSelfAddress(new Address("akka", "system", "127.0.0.1", 2550)); actorContext = new ActorContext(getSystem(), null, clusterWrapper, mock(Configuration.class)); - assertEquals(false, actorContext.isPathLocal("akka.tcp://system@127.1.0.1:2550/")); + assertEquals(false, actorContext.isPathLocal("akka://system@127.1.0.1:2550/")); //ports differ - clusterWrapper.setSelfAddress(new Address("akka.tcp", "system", "127.0.0.1", 2550)); + clusterWrapper.setSelfAddress(new Address("akka", "system", "127.0.0.1", 2550)); actorContext = new ActorContext(getSystem(), null, clusterWrapper, mock(Configuration.class)); - assertEquals(false, actorContext.isPathLocal("akka.tcp://system@127.0.0.1:2551/")); + assertEquals(false, actorContext.isPathLocal("akka://system@127.0.0.1:2551/")); } @Test @@ -349,8 +349,7 @@ public class ActorContextTest extends AbstractActorTest { @Test public void testFindPrimaryShardAsyncRemotePrimaryFound() throws Exception { - TestActorRef shardManager = TestActorRef.create(getSystem(), - Props.create(MessageCollectorActor.class)); + ActorRef shardManager = getSystem().actorOf(MessageCollectorActor.props()); DatastoreContext dataStoreContext = DatastoreContext.newBuilder() .logicalStoreType(LogicalDatastoreType.CONFIGURATION) @@ -391,8 +390,7 @@ public class ActorContextTest extends AbstractActorTest { @Test public void testFindPrimaryShardAsyncLocalPrimaryFound() throws Exception { - TestActorRef shardManager = TestActorRef.create(getSystem(), - Props.create(MessageCollectorActor.class)); + ActorRef shardManager = getSystem().actorOf(MessageCollectorActor.props()); DatastoreContext dataStoreContext = DatastoreContext.newBuilder() .logicalStoreType(LogicalDatastoreType.CONFIGURATION) @@ -443,8 +441,7 @@ public class ActorContextTest extends AbstractActorTest { @SuppressWarnings("checkstyle:IllegalCatch") private static void testFindPrimaryExceptions(final Object expectedException) throws Exception { - TestActorRef shardManager = - TestActorRef.create(getSystem(), Props.create(MessageCollectorActor.class)); + ActorRef shardManager = getSystem().actorOf(MessageCollectorActor.props()); DatastoreContext dataStoreContext = DatastoreContext.newBuilder() .logicalStoreType(LogicalDatastoreType.CONFIGURATION) @@ -479,8 +476,8 @@ public class ActorContextTest extends AbstractActorTest { public void testBroadcast() { new JavaTestKit(getSystem()) { { - ActorRef shardActorRef1 = getSystem().actorOf(Props.create(MessageCollectorActor.class)); - ActorRef shardActorRef2 = getSystem().actorOf(Props.create(MessageCollectorActor.class)); + ActorRef shardActorRef1 = getSystem().actorOf(MessageCollectorActor.props()); + ActorRef shardActorRef2 = getSystem().actorOf(MessageCollectorActor.props()); TestActorRef shardManagerActorRef = TestActorRef.create(getSystem(), MockShardManager.props());