Search in sources :

Example 1 with DummyActorGateway

use of org.apache.flink.runtime.instance.DummyActorGateway in project flink by apache.

the class HandlerRedirectUtilsTest method testGetRedirectAddressWithLocalAkkaPath.

@Test
public void testGetRedirectAddressWithLocalAkkaPath() throws Exception {
    ActorGateway leaderGateway = new DummyActorGateway("akka://flink/user/foobar");
    Tuple2<ActorGateway, Integer> leader = new Tuple2<>(leaderGateway, 1235);
    String redirectingAddress = HandlerRedirectUtils.getRedirectAddress(localJobManagerAddress, leader);
    Assert.assertNull(redirectingAddress);
}
Also used : Tuple2(scala.Tuple2) DummyActorGateway(org.apache.flink.runtime.instance.DummyActorGateway) ActorGateway(org.apache.flink.runtime.instance.ActorGateway) DummyActorGateway(org.apache.flink.runtime.instance.DummyActorGateway) Test(org.junit.Test)

Example 2 with DummyActorGateway

use of org.apache.flink.runtime.instance.DummyActorGateway in project flink by apache.

the class HandlerRedirectUtilsTest method testGetRedirectAddressWithRemoteAkkaPath.

@Test
public void testGetRedirectAddressWithRemoteAkkaPath() throws Exception {
    ActorGateway leaderGateway = new DummyActorGateway(remotePath);
    Tuple2<ActorGateway, Integer> leader = new Tuple2<>(leaderGateway, 1235);
    String redirectingAddress = HandlerRedirectUtils.getRedirectAddress(localJobManagerAddress, leader);
    Assert.assertEquals(remoteURL, redirectingAddress);
}
Also used : Tuple2(scala.Tuple2) DummyActorGateway(org.apache.flink.runtime.instance.DummyActorGateway) ActorGateway(org.apache.flink.runtime.instance.ActorGateway) DummyActorGateway(org.apache.flink.runtime.instance.DummyActorGateway) Test(org.junit.Test)

Aggregations

ActorGateway (org.apache.flink.runtime.instance.ActorGateway)2 DummyActorGateway (org.apache.flink.runtime.instance.DummyActorGateway)2 Test (org.junit.Test)2 Tuple2 (scala.Tuple2)2