X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Factors%2FShardSnapshotActorTest.java;fp=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Factors%2FShardSnapshotActorTest.java;h=65a8ac9ce8605c1c19493fab000c865696ec8725;hb=5464f50be733df1bbbe31cf05665d542d3b7c5e7;hp=47128f026436da6822a35ea374ad3e532dc61ad1;hpb=aa77e20225cc04235315892cf148393149cbf8fc;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/actors/ShardSnapshotActorTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/actors/ShardSnapshotActorTest.java index 47128f0264..65a8ac9ce8 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/actors/ShardSnapshotActorTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/actors/ShardSnapshotActorTest.java @@ -10,14 +10,15 @@ package org.opendaylight.controller.cluster.datastore.actors; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; + import akka.actor.ActorRef; import akka.testkit.JavaTestKit; import java.util.Optional; import org.junit.Test; import org.opendaylight.controller.cluster.datastore.AbstractActorTest; -import org.opendaylight.controller.cluster.datastore.persisted.ShardDataTreeSnapshot; import org.opendaylight.controller.cluster.datastore.persisted.MetadataShardDataTreeSnapshot; import org.opendaylight.controller.cluster.datastore.persisted.PreBoronShardDataTreeSnapshot; +import org.opendaylight.controller.cluster.datastore.persisted.ShardDataTreeSnapshot; import org.opendaylight.controller.cluster.raft.base.messages.CaptureSnapshotReply; import org.opendaylight.controller.md.cluster.datastore.model.TestModel; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; @@ -28,27 +29,29 @@ public class ShardSnapshotActorTest extends AbstractActorTest { private static void testSerializeSnapshot(final String testName, final ShardDataTreeSnapshot snapshot) throws Exception { - new JavaTestKit(getSystem()) {{ + new JavaTestKit(getSystem()) { + { - final ActorRef snapshotActor = getSystem().actorOf(ShardSnapshotActor.props(), testName); - watch(snapshotActor); + final ActorRef snapshotActor = getSystem().actorOf(ShardSnapshotActor.props(), testName); + watch(snapshotActor); - final NormalizedNode expectedRoot = snapshot.getRootNode().get(); + final NormalizedNode expectedRoot = snapshot.getRootNode().get(); - ShardSnapshotActor.requestSnapshot(snapshotActor, snapshot, getRef()); + ShardSnapshotActor.requestSnapshot(snapshotActor, snapshot, getRef()); - final CaptureSnapshotReply reply = expectMsgClass(duration("3 seconds"), CaptureSnapshotReply.class); - assertNotNull("getSnapshot is null", reply.getSnapshot()); + final CaptureSnapshotReply reply = expectMsgClass(duration("3 seconds"), CaptureSnapshotReply.class); + assertNotNull("getSnapshot is null", reply.getSnapshot()); - final ShardDataTreeSnapshot actual = ShardDataTreeSnapshot.deserialize(reply.getSnapshot()); - assertNotNull(actual); - assertEquals(snapshot.getClass(), actual.getClass()); + final ShardDataTreeSnapshot actual = ShardDataTreeSnapshot.deserialize(reply.getSnapshot()); + assertNotNull(actual); + assertEquals(snapshot.getClass(), actual.getClass()); - final Optional> maybeNode = actual.getRootNode(); - assertTrue(maybeNode.isPresent()); + final Optional> maybeNode = actual.getRootNode(); + assertTrue(maybeNode.isPresent()); - assertEquals("Root node", expectedRoot, maybeNode.get()); - }}; + assertEquals("Root node", expectedRoot, maybeNode.get()); + } + }; } @Test