Search in sources :

Example 1 with InvalidAssociation

use of akka.remote.InvalidAssociation in project controller by opendaylight.

the class QuarantinedMonitorActorTest method testOnReceiveQuarantined.

@Test
public void testOnReceiveQuarantined() throws Exception {
    final Throwable t = new RuntimeException("Remote has quarantined this system");
    final InvalidAssociation cause = InvalidAssociation.apply(LOCAL, REMOTE, t, Option.apply(null));
    final ThisActorSystemQuarantinedEvent event = new ThisActorSystemQuarantinedEvent(LOCAL, REMOTE);
    actor.tell(event, ActorRef.noSender());
    verify(callback, timeout(1000)).apply();
}
Also used : InvalidAssociation(akka.remote.InvalidAssociation) ThisActorSystemQuarantinedEvent(akka.remote.ThisActorSystemQuarantinedEvent) Test(org.junit.Test)

Example 2 with InvalidAssociation

use of akka.remote.InvalidAssociation in project controller by opendaylight.

the class QuarantinedMonitorActorTest method testOnReceiveAnother.

@Test
public void testOnReceiveAnother() throws Exception {
    final Address local = Address.apply("http", "local");
    final Address remote = Address.apply("http", "remote");
    final Throwable t = new RuntimeException("Another exception");
    final InvalidAssociation cause = InvalidAssociation.apply(local, remote, t, Option.apply(null));
    final AssociationErrorEvent event = new AssociationErrorEvent(cause, local, remote, true, Logging.ErrorLevel());
    actor.tell(event, ActorRef.noSender());
    verify(callback, never()).apply();
}
Also used : Address(akka.actor.Address) InvalidAssociation(akka.remote.InvalidAssociation) AssociationErrorEvent(akka.remote.AssociationErrorEvent) Test(org.junit.Test)

Aggregations

InvalidAssociation (akka.remote.InvalidAssociation)2 Test (org.junit.Test)2 Address (akka.actor.Address)1 AssociationErrorEvent (akka.remote.AssociationErrorEvent)1 ThisActorSystemQuarantinedEvent (akka.remote.ThisActorSystemQuarantinedEvent)1