Serialization/Deserialization and a host of other fixes
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / utils / ActorContextTest.java
1 package org.opendaylight.controller.cluster.datastore.utils;
2
3 import akka.actor.ActorRef;
4 import akka.actor.ActorSystem;
5 import org.junit.Test;
6 import org.opendaylight.controller.cluster.datastore.AbstractActorTest;
7 import org.opendaylight.controller.cluster.datastore.ClusterWrapper;
8 import org.opendaylight.controller.cluster.datastore.Configuration;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.mockito.Mockito.mock;
12
13 public class ActorContextTest extends AbstractActorTest{
14     @Test
15     public void testResolvePathForRemoteActor(){
16         ActorContext actorContext =
17             new ActorContext(mock(ActorSystem.class), mock(ActorRef.class),mock(
18                 ClusterWrapper.class),
19                 mock(Configuration.class));
20
21         String actual = actorContext.resolvePath(
22             "akka.tcp://system@127.0.0.1:2550/user/shardmanager/shard",
23             "akka://system/user/shardmanager/shard/transaction");
24
25         String expected = "akka.tcp://system@127.0.0.1:2550/user/shardmanager/shard/transaction";
26
27         assertEquals(expected, actual);
28     }
29
30     @Test
31     public void testResolvePathForLocalActor(){
32         ActorContext actorContext =
33             new ActorContext(getSystem(), mock(ActorRef.class), mock(ClusterWrapper.class),
34                 mock(Configuration.class));
35
36         String actual = actorContext.resolvePath(
37             "akka://system/user/shardmanager/shard",
38             "akka://system/user/shardmanager/shard/transaction");
39
40         String expected = "akka://system/user/shardmanager/shard/transaction";
41
42         assertEquals(expected, actual);
43
44         System.out.println(actorContext
45             .actorFor("akka://system/user/shardmanager/shard/transaction"));
46     }
47 }