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%2FAbstractShardTest.java;h=cc2e29e211ef590688fabcd876dc6bdc3be31974;hp=163c15baf6c09f23d3b11a6fc7ccf243a04f2871;hb=c796596b5c46b5203c30b143e6282662e66c5642;hpb=561058be77594a026abbdbe82616fc65c7f58f48 diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardTest.java index 163c15baf6..cc2e29e211 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/AbstractShardTest.java @@ -42,6 +42,7 @@ import org.junit.Assert; import org.junit.Before; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; +import org.opendaylight.controller.cluster.access.concepts.MemberName; import org.opendaylight.controller.cluster.datastore.DatastoreContext.Builder; import org.opendaylight.controller.cluster.datastore.identifiers.ShardIdentifier; import org.opendaylight.controller.cluster.datastore.messages.BatchedModifications; @@ -56,6 +57,7 @@ import org.opendaylight.controller.cluster.raft.utils.InMemoryJournal; import org.opendaylight.controller.cluster.raft.utils.InMemorySnapshotStore; import org.opendaylight.controller.md.cluster.datastore.model.CarsModel; import org.opendaylight.controller.md.cluster.datastore.model.TestModel; +import org.opendaylight.yangtools.concepts.Identifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; import org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild; @@ -86,8 +88,8 @@ public abstract class AbstractShardTest extends AbstractActorTest{ private static final AtomicInteger NEXT_SHARD_NUM = new AtomicInteger(); - protected final ShardIdentifier shardID = ShardIdentifier.builder().memberName("member-1") - .shardName("inventory").type("config" + NEXT_SHARD_NUM.getAndIncrement()).build(); + protected final ShardIdentifier shardID = ShardIdentifier.create("inventory", MemberName.forName("member-1"), + "config" + NEXT_SHARD_NUM.getAndIncrement()); protected final Builder dataStoreContextBuilder = DatastoreContext.newBuilder(). shardJournalRecoveryLogBatchSize(3).shardSnapshotBatchCount(5000). @@ -128,8 +130,7 @@ public abstract class AbstractShardTest extends AbstractActorTest{ final CountDownLatch recoveryComplete = new CountDownLatch(1); @SuppressWarnings("serial") - final - Creator creator = new Creator() { + final Creator creator = new Creator() { @Override public Shard create() throws Exception { return new Shard(newShardBuilder()) { @@ -313,7 +314,7 @@ public abstract class AbstractShardTest extends AbstractActorTest{ protected void setupCohortDecorator(Shard shard, final ShardDataTreeCohort cohort) { shard.getCommitCoordinator().setCohortDecorator(new ShardCommitCoordinator.CohortDecorator() { @Override - public ShardDataTreeCohort decorate(String transactionID, ShardDataTreeCohort actual) { + public ShardDataTreeCohort decorate(Identifier transactionID, ShardDataTreeCohort actual) { return cohort; } }); @@ -395,7 +396,7 @@ public abstract class AbstractShardTest extends AbstractActorTest{ writeToStore(testStore, TestModel.TEST_PATH, ImmutableNodes.containerNode(TestModel.TEST_QNAME)); - final NormalizedNode root = readStore(testStore, YangInstanceIdentifier.builder().build()); + final NormalizedNode root = readStore(testStore, YangInstanceIdentifier.EMPTY); InMemorySnapshotStore.addSnapshot(shardID.toString(), Snapshot.create( SerializationUtils.serializeNormalizedNode(root), @@ -456,7 +457,7 @@ public abstract class AbstractShardTest extends AbstractActorTest{ final DataTreeCandidateTip mockCandidate = mock(DataTreeCandidateTip.class, name); final DataTreeCandidateNode mockCandidateNode = mock(DataTreeCandidateNode.class, name + "-node"); doReturn(ModificationType.UNMODIFIED).when(mockCandidateNode).getModificationType(); - doReturn(YangInstanceIdentifier.builder().build()).when(mockCandidate).getRootPath(); + doReturn(YangInstanceIdentifier.EMPTY).when(mockCandidate).getRootPath(); doReturn(mockCandidateNode).when(mockCandidate).getRootNode(); return mockCandidate; }