Fix ReadyLocalTransactionSerializer
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / messages / ReadyLocalTransactionSerializerTest.java
index cc5dbff..5a585bc 100644 (file)
@@ -10,6 +10,8 @@ package org.opendaylight.controller.cluster.datastore.messages;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
+import akka.actor.ExtendedActorSystem;
+import akka.testkit.JavaTestKit;
 import java.io.NotSerializableException;
 import java.util.List;
 import org.junit.Test;
@@ -49,11 +51,15 @@ public class ReadyLocalTransactionSerializerTest extends AbstractTest {
         TransactionIdentifier txId = nextTransactionId();
         ReadyLocalTransaction readyMessage = new ReadyLocalTransaction(txId, modification, true);
 
-        ReadyLocalTransactionSerializer serializer = new ReadyLocalTransactionSerializer();
-
-        byte[] bytes = serializer.toBinary(readyMessage);
-
-        Object deserialized = serializer.fromBinary(bytes, ReadyLocalTransaction.class);
+        final ExtendedActorSystem system = (ExtendedActorSystem) ExtendedActorSystem.create("test");
+        final Object deserialized;
+        try {
+            final ReadyLocalTransactionSerializer serializer = new ReadyLocalTransactionSerializer(system);
+            final byte[] bytes = serializer.toBinary(readyMessage);
+            deserialized = serializer.fromBinary(bytes, ReadyLocalTransaction.class);
+        } finally {
+            JavaTestKit.shutdownActorSystem(system);
+        }
 
         assertNotNull("fromBinary returned null", deserialized);
         assertEquals("fromBinary return type", BatchedModifications.class, deserialized.getClass());

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.