@@ -0,0 +1,2616 @@
+/*%0A * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.%0A *%0A * This program and the accompanying materials are made available under the%0A * terms of the Eclipse Public License v1.0 which accompanies this distribution,%0A * and is available at http://www.eclipse.org/legal/epl-v10.html%0A */%0Apackage org.opendaylight.controller.cluster.common.actor;%0A%0Aimport static org.mockito.Mockito.never;%0Aimport static org.mockito.Mockito.timeout;%0Aimport static org.mockito.Mockito.verify;%0A%0Aimport akka.actor.ActorRef;%0Aimport akka.actor.ActorSystem;%0Aimport akka.actor.Address;%0Aimport akka.event.Logging;%0Aimport akka.japi.Effect;%0Aimport akka.remote.AssociationErrorEvent;%0Aimport akka.remote.InvalidAssociation;%0Aimport akka.testkit.JavaTestKit;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.Mock;%0Aimport org.mockito.MockitoAnnotations;%0Aimport scala.Option;%0A%0Apublic class QuarantinedMonitorActorTest %7B%0A%0A    private static final Address LOCAL = Address.apply(%22http%22, %22local%22);%0A    private static final Address REMOTE = Address.apply(%22http%22, %22remote%22);%0A%0A    @Mock%0A    private Effect callback;%0A    private ActorSystem system;%0A    private ActorRef actor;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        MockitoAnnotations.initMocks(this);%0A        system = ActorSystem.apply();%0A        actor = system.actorOf(QuarantinedMonitorActor.props(callback));%0A    %7D%0A%0A    @After%0A    public void tearDown() throws Exception %7B%0A        JavaTestKit.shutdownActorSystem(system);%0A    %7D%0A%0A    @Test%0A    public void testOnReceiveQuarantined() throws Exception %7B%0A        final Throwable t = new RuntimeException(%22Remote has quarantined this system%22);%0A        final InvalidAssociation cause = InvalidAssociation.apply(LOCAL, REMOTE, t, Option.apply(null));%0A        final AssociationErrorEvent event = new AssociationErrorEvent(cause, LOCAL, REMOTE, true, Logging.ErrorLevel());%0A        actor.tell(event, ActorRef.noSender());%0A        verify(callback, timeout(1000)).apply();%0A    %7D%0A%0A    @Test%0A    public void testOnReceiveAnother() throws Exception %7B%0A        final Address local = Address.apply(%22http%22, %22local%22);%0A        final Address remote = Address.apply(%22http%22, %22remote%22);%0A        final Throwable t = new RuntimeException(%22Another exception%22);%0A        final InvalidAssociation cause = InvalidAssociation.apply(local, remote, t, Option.apply(null));%0A        final AssociationErrorEvent event = new AssociationErrorEvent(cause, local, remote, true, Logging.ErrorLevel());%0A        actor.tell(event, ActorRef.noSender());%0A        verify(callback, never()).apply();%0A    %7D%0A%0A%7D

Add QuarantinedMonitorActor unit test