import akka.actor.ActorRef;
import akka.actor.Props;
+
import com.google.common.util.concurrent.ListenableFuture;
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.common.util.concurrent.MoreExecutors;
+
import junit.framework.Assert;
+
+import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.opendaylight.controller.cluster.datastore.messages.AbortTransactionReply;
import org.opendaylight.controller.cluster.datastore.utils.MockActorContext;
import java.util.Arrays;
-import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import static org.junit.Assert.assertNotNull;
private Props props;
private ActorRef actorRef;
private MockActorContext actorContext;
- private ExecutorService executor = Executors.newSingleThreadExecutor();
+ private final ListeningExecutorService executor = MoreExecutors.listeningDecorator(
+ Executors.newSingleThreadExecutor());
@Before
public void setUp(){
}
+ @After
+ public void tearDown() {
+ executor.shutdownNow();
+ }
+
@Test
public void testCanCommit() throws Exception {
actorContext.setExecuteRemoteOperationResponse(new CanCommitTransactionReply(true).toSerializable());