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%2FShardTest.java;h=7ac18e61dc146a6b27430c884864c39ffe8620d5;hp=f396eae9605dc61f8d05a4992833a704bfa1be22;hb=30eb37d8cde5a8d35e36aa38e0bab1232b242de2;hpb=abaef4a5ae37f27542155457fe7306a4662b1eeb diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java index f396eae960..7ac18e61dc 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/ShardTest.java @@ -239,8 +239,8 @@ public class ShardTest extends AbstractShardTest { CreateTransactionReply.class); final String path = reply.getTransactionPath().toString(); - assertTrue("Unexpected transaction path " + path, path.startsWith(String.format( - "akka://test/user/testCreateTransaction/shard-%s-%s:ShardTransactionTest@0:", + assertTrue("Unexpected transaction path " + path, path.contains(String.format( + "/user/testCreateTransaction/shard-%s-%s:ShardTransactionTest@0:", shardID.getShardName(), shardID.getMemberName().getName()))); } @@ -258,8 +258,8 @@ public class ShardTest extends AbstractShardTest { CreateTransactionReply.class); final String path = reply.getTransactionPath().toString(); - assertTrue("Unexpected transaction path " + path, path.startsWith(String.format( - "akka://test/user/testCreateTransactionOnChain/shard-%s-%s:ShardTransactionTest@0:", + assertTrue("Unexpected transaction path " + path, path.contains(String.format( + "/user/testCreateTransactionOnChain/shard-%s-%s:ShardTransactionTest@0:", shardID.getShardName(), shardID.getMemberName().getName()))); } @@ -372,7 +372,7 @@ public class ShardTest extends AbstractShardTest { // Add some ModificationPayload entries for (int i = 1; i <= nListEntries; i++) { - listEntryKeys.add(Integer.valueOf(i)); + listEntryKeys.add(i); final YangInstanceIdentifier path = YangInstanceIdentifier.builder(TestModel.OUTER_LIST_PATH) .nodeWithKey(TestModel.OUTER_LIST_QNAME, TestModel.ID_QNAME, i).build(); @@ -388,7 +388,7 @@ public class ShardTest extends AbstractShardTest { InMemoryJournal.addEntry(shardID.toString(), nListEntries + 2, new ApplyJournalEntries(nListEntries)); - testRecovery(listEntryKeys); + testRecovery(listEntryKeys, true); } @Test @@ -478,7 +478,9 @@ public class ShardTest extends AbstractShardTest { ImmutableNodes.containerNode(TestModel.TEST_QNAME), false), testKit.getRef()); final ReadyTransactionReply readyReply = ReadyTransactionReply .fromSerializable(testKit.expectMsgClass(duration, ReadyTransactionReply.class)); - assertEquals("Cohort path", shard.path().toString(), readyReply.getCohortPath()); + + String pathSuffix = shard.path().toString().replaceFirst("akka://test", ""); + assertTrue("Cohort path", readyReply.getCohortPath().endsWith(pathSuffix)); // Send the CanCommitTransaction message for the first Tx. shard.tell(new CanCommitTransaction(transactionID1, CURRENT_VERSION).toSerializable(), testKit.getRef()); @@ -1704,9 +1706,9 @@ public class ShardTest extends AbstractShardTest { dataStoreContextBuilder.persistent(persistent); - class TestShard extends Shard { + final class TestShard extends Shard { - protected TestShard(final AbstractBuilder builder) { + TestShard(final AbstractBuilder builder) { super(builder); setPersistence(new TestPersistentDataProvider(super.persistence())); }