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=8c8e329e14df9c4e8e27eb9f217260f331cb08b2;hb=fc9b4841afb419e386ecd330050503324095dd36;hpb=95c296a7c1e8e186a88a0a0dc82e080b2185db33 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 8c8e329e14..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 @@ -76,7 +76,7 @@ public class DatastoreSnapshotListTest { assertEquals("DatastoreSnapshotList size", 2, cloned.size()); assertDatastoreSnapshotEquals(legacyConfigSnapshot, cloned.get(0), new org.opendaylight.controller.cluster.datastore.persisted.ShardManagerSnapshot( - legacyShardManagerSnapshot.getShardList()), + legacyShardManagerSnapshot.getShardList(), Collections.emptyMap()), Optional.of(legacyConfigRoot1), Optional.of(legacyConfigRoot2)); assertDatastoreSnapshotEquals(legacyOperSnapshot, cloned.get(1), (org.opendaylight.controller.cluster.datastore.persisted.ShardManagerSnapshot)null, @@ -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());