X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Ftest%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmessages%2FDatastoreSnapshotListTest.java;h=021a60fbaf80411df0b94dde63c21395814b6297;hp=f344815a873b083f64a09171427ae3c289ce0441;hb=fc9b4841afb419e386ecd330050503324095dd36;hpb=c1336f9b497bc6867536a24f629c3f0b002ccb2f diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/DatastoreSnapshotListTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/DatastoreSnapshotListTest.java index f344815a87..021a60fbaf 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/DatastoreSnapshotListTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/messages/DatastoreSnapshotListTest.java @@ -84,10 +84,10 @@ public class DatastoreSnapshotListTest { } @SuppressWarnings("unchecked") - private void assertDatastoreSnapshotEquals(DatastoreSnapshot legacy, - org.opendaylight.controller.cluster.datastore.persisted.DatastoreSnapshot actual, - org.opendaylight.controller.cluster.datastore.persisted.ShardManagerSnapshot expShardMgrSnapshot, - Optional>... shardRoots) throws IOException { + private static void assertDatastoreSnapshotEquals(final DatastoreSnapshot legacy, + final org.opendaylight.controller.cluster.datastore.persisted.DatastoreSnapshot actual, + final org.opendaylight.controller.cluster.datastore.persisted.ShardManagerSnapshot expShardMgrSnapshot, + final Optional>... shardRoots) throws IOException { assertEquals("Type", legacy.getType(), actual.getType()); if (legacy.getShardManagerSnapshot() == null) { @@ -112,8 +112,8 @@ public class DatastoreSnapshotListTest { } } - private static void assertSnapshotEquals(Snapshot expected, Optional> expRoot, - org.opendaylight.controller.cluster.raft.persisted.Snapshot actual) throws IOException { + private static void assertSnapshotEquals(final Snapshot expected, final Optional> expRoot, + final org.opendaylight.controller.cluster.raft.persisted.Snapshot actual) throws IOException { assertEquals("lastIndex", expected.getLastIndex(), actual.getLastIndex()); assertEquals("lastTerm", expected.getLastTerm(), actual.getLastTerm()); assertEquals("lastAppliedIndex", expected.getLastAppliedIndex(), actual.getLastAppliedIndex()); @@ -132,21 +132,21 @@ public class DatastoreSnapshotListTest { } } - private static ShardManagerSnapshot newLegacyShardManagerSnapshot(String... shards) { + private static ShardManagerSnapshot newLegacyShardManagerSnapshot(final String... shards) { return ShardManagerSnapshot.forShardList(Arrays.asList(shards)); } - private static DatastoreSnapshot.ShardSnapshot newLegacyShardSnapshot(String name, - org.opendaylight.controller.cluster.raft.Snapshot snapshot) { + private static DatastoreSnapshot.ShardSnapshot newLegacyShardSnapshot(final String name, + final org.opendaylight.controller.cluster.raft.Snapshot snapshot) { return new DatastoreSnapshot.ShardSnapshot(name, SerializationUtils.serialize(snapshot)); } - private static Snapshot newLegacySnapshot(NormalizedNode root) + private static Snapshot newLegacySnapshot(final NormalizedNode root) throws Exception { final ByteArrayOutputStream bos = new ByteArrayOutputStream(); if (root != null) { MetadataShardDataTreeSnapshot snapshot = new MetadataShardDataTreeSnapshot(root); - try (final DataOutputStream dos = new DataOutputStream(bos)) { + try (DataOutputStream dos = new DataOutputStream(bos)) { PayloadVersion.BORON.writeTo(dos); try (ObjectOutputStream oos = new ObjectOutputStream(dos)) { oos.writeObject(snapshot); @@ -158,7 +158,7 @@ public class DatastoreSnapshotListTest { "member-1", null); } - private static NormalizedNode toRootNode(YangInstanceIdentifier path, NormalizedNode node) + private static NormalizedNode toRootNode(final YangInstanceIdentifier path, final NormalizedNode node) throws DataValidationFailedException { DataTree dataTree = InMemoryDataTreeFactory.getInstance().create(TreeType.OPERATIONAL); dataTree.setSchemaContext(SchemaContextHelper.full());