-
- static ActorSystem system;
-
- @BeforeClass
- public static void setup() throws InterruptedException {
- system = ActorSystem.create("opendaylight-rpc", ConfigFactory.load().getConfig("odl-cluster-rpc"));
- }
-
- @AfterClass
- public static void teardown() {
- JavaTestKit.shutdownActorSystem(system);
- system = null;
- }
-
- @Test
- public void testRoutingLogic() {
- List<Pair<ActorRef, Long>> pairList = new ArrayList<>();
- TestProbe probe1 = new TestProbe(system);
- TestProbe probe2 = new TestProbe(system);
- TestProbe probe3 = new TestProbe(system);
- ActorRef actor1 = probe1.ref();
- ActorRef actor2 = probe2.ref();
- ActorRef actor3 = probe3.ref();
- pairList.add(new Pair<ActorRef, Long>(actor1, 1000L));
- pairList.add(new Pair<ActorRef, Long>(actor2, 3000L));
- pairList.add(new Pair<ActorRef, Long>(actor3, 2000L));
- RoutingLogic logic = new LatestEntryRoutingLogic(pairList);
- assertTrue(logic.select().equals(actor2));
- }
+ static ActorSystem system;
+
+ @BeforeClass
+ public static void setup() {
+ system = ActorSystem.create("opendaylight-rpc", ConfigFactory.load().getConfig("odl-cluster-rpc"));
+ }
+
+ @AfterClass
+ public static void teardown() {
+ TestKit.shutdownActorSystem(system);
+ system = null;
+ }
+
+ @Test
+ public void testRoutingLogic() {
+ List<Pair<ActorRef, Long>> pairList = new ArrayList<>();
+ TestProbe probe1 = new TestProbe(system);
+ TestProbe probe2 = new TestProbe(system);
+ TestProbe probe3 = new TestProbe(system);
+ ActorRef actor1 = probe1.ref();
+ ActorRef actor2 = probe2.ref();
+ ActorRef actor3 = probe3.ref();
+ pairList.add(new Pair<>(actor1, 1000L));
+ pairList.add(new Pair<>(actor2, 3000L));
+ pairList.add(new Pair<>(actor3, 2000L));
+ RoutingLogic logic = new LatestEntryRoutingLogic(pairList);
+ assertTrue(logic.select().equals(actor2));
+ }