}
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")
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"));
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
@Test
public void testFindPrimaryShardAsyncRemotePrimaryFound() throws Exception {
- TestActorRef<MessageCollectorActor> shardManager = TestActorRef.create(getSystem(),
- Props.create(MessageCollectorActor.class));
+ ActorRef shardManager = getSystem().actorOf(MessageCollectorActor.props());
DatastoreContext dataStoreContext = DatastoreContext.newBuilder()
.logicalStoreType(LogicalDatastoreType.CONFIGURATION)
@Test
public void testFindPrimaryShardAsyncLocalPrimaryFound() throws Exception {
- TestActorRef<MessageCollectorActor> shardManager = TestActorRef.create(getSystem(),
- Props.create(MessageCollectorActor.class));
+ ActorRef shardManager = getSystem().actorOf(MessageCollectorActor.props());
DatastoreContext dataStoreContext = DatastoreContext.newBuilder()
.logicalStoreType(LogicalDatastoreType.CONFIGURATION)
@SuppressWarnings("checkstyle:IllegalCatch")
private static void testFindPrimaryExceptions(final Object expectedException) throws Exception {
- TestActorRef<MessageCollectorActor> shardManager =
- TestActorRef.create(getSystem(), Props.create(MessageCollectorActor.class));
+ ActorRef shardManager = getSystem().actorOf(MessageCollectorActor.props());
DatastoreContext dataStoreContext = DatastoreContext.newBuilder()
.logicalStoreType(LogicalDatastoreType.CONFIGURATION)
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<MockShardManager> shardManagerActorRef = TestActorRef.create(getSystem(),
MockShardManager.props());