sort by descending number of suspected transaction leaks in trace output
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / ShardTest.java
index 54183ae0ff1b54160bfe4ceba639d6817b81b4d8..76745a442ca0e9d09100e447e7c6a25ce54d6162 100644 (file)
@@ -113,10 +113,9 @@ import org.opendaylight.yangtools.yang.data.api.schema.MapNode;
 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTree;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeCandidate;
+import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeConfiguration;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataTreeModification;
 import org.opendaylight.yangtools.yang.data.api.schema.tree.DataValidationFailedException;
-import org.opendaylight.yangtools.yang.data.api.schema.tree.TipProducingDataTree;
-import org.opendaylight.yangtools.yang.data.api.schema.tree.TreeType;
 import org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes;
 import org.opendaylight.yangtools.yang.data.impl.schema.builder.impl.ImmutableContainerNodeBuilder;
 import org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTreeFactory;
@@ -425,8 +424,8 @@ public class ShardTest extends AbstractShardTest {
 
         ShardTestKit.waitUntilLeader(shard);
 
-        final DataTree store = InMemoryDataTreeFactory.getInstance().create(TreeType.OPERATIONAL);
-        store.setSchemaContext(SCHEMA_CONTEXT);
+        final DataTree store = new InMemoryDataTreeFactory().create(DataTreeConfiguration.DEFAULT_OPERATIONAL,
+            SCHEMA_CONTEXT);
 
         final ContainerNode container = ImmutableContainerNodeBuilder.create().withNodeIdentifier(
                 new YangInstanceIdentifier.NodeIdentifier(TestModel.TEST_QNAME))
@@ -466,8 +465,8 @@ public class ShardTest extends AbstractShardTest {
 
         ShardTestKit.waitUntilLeader(shard);
 
-        final DataTree store = InMemoryDataTreeFactory.getInstance().create(TreeType.OPERATIONAL);
-        store.setSchemaContext(SCHEMA_CONTEXT);
+        final DataTree store = new InMemoryDataTreeFactory().create(DataTreeConfiguration.DEFAULT_OPERATIONAL,
+            SCHEMA_CONTEXT);
 
         final DataTreeModification writeMod = store.takeSnapshot().newModification();
         final ContainerNode node = ImmutableNodes.containerNode(TestModel.TEST_QNAME);
@@ -1151,7 +1150,7 @@ public class ShardTest extends AbstractShardTest {
     private void testCommitWhenTransactionHasModifications(final boolean readWrite) throws Exception {
         new ShardTestKit(getSystem()) {
             {
-                final TipProducingDataTree dataTree = createDelegatingMockDataTree();
+                final DataTree dataTree = createDelegatingMockDataTree();
                 final TestActorRef<Shard> shard = actorFactory.createTestActor(
                         newShardBuilder().dataTree(dataTree).props().withDispatcher(Dispatchers.DefaultDispatcherId()),
                         "testCommitWhenTransactionHasModifications-" + readWrite);
@@ -1208,7 +1207,7 @@ public class ShardTest extends AbstractShardTest {
     public void testCommitPhaseFailure() throws Exception {
         new ShardTestKit(getSystem()) {
             {
-                final TipProducingDataTree dataTree = createDelegatingMockDataTree();
+                final DataTree dataTree = createDelegatingMockDataTree();
                 final TestActorRef<Shard> shard = actorFactory.createTestActor(
                         newShardBuilder().dataTree(dataTree).props().withDispatcher(Dispatchers.DefaultDispatcherId()),
                         "testCommitPhaseFailure");
@@ -1285,7 +1284,7 @@ public class ShardTest extends AbstractShardTest {
     public void testPreCommitPhaseFailure() throws Exception {
         new ShardTestKit(getSystem()) {
             {
-                final TipProducingDataTree dataTree = createDelegatingMockDataTree();
+                final DataTree dataTree = createDelegatingMockDataTree();
                 final TestActorRef<Shard> shard = actorFactory.createTestActor(
                         newShardBuilder().dataTree(dataTree).props().withDispatcher(Dispatchers.DefaultDispatcherId()),
                         "testPreCommitPhaseFailure");
@@ -1353,7 +1352,7 @@ public class ShardTest extends AbstractShardTest {
     public void testCanCommitPhaseFailure() throws Exception {
         new ShardTestKit(getSystem()) {
             {
-                final TipProducingDataTree dataTree = createDelegatingMockDataTree();
+                final DataTree dataTree = createDelegatingMockDataTree();
                 final TestActorRef<Shard> shard = actorFactory.createTestActor(
                         newShardBuilder().dataTree(dataTree).props().withDispatcher(Dispatchers.DefaultDispatcherId()),
                         "testCanCommitPhaseFailure");
@@ -1400,7 +1399,7 @@ public class ShardTest extends AbstractShardTest {
     private void testImmediateCommitWithCanCommitPhaseFailure(final boolean readWrite) throws Exception {
         new ShardTestKit(getSystem()) {
             {
-                final TipProducingDataTree dataTree = createDelegatingMockDataTree();
+                final DataTree dataTree = createDelegatingMockDataTree();
                 final TestActorRef<Shard> shard = actorFactory.createTestActor(
                         newShardBuilder().dataTree(dataTree).props().withDispatcher(Dispatchers.DefaultDispatcherId()),
                         "testImmediateCommitWithCanCommitPhaseFailure-" + readWrite);
@@ -1988,8 +1987,8 @@ public class ShardTest extends AbstractShardTest {
      */
     @Test
     public void testInMemoryDataTreeRestore() throws ReadFailedException, DataValidationFailedException {
-        final DataTree store = InMemoryDataTreeFactory.getInstance().create(TreeType.OPERATIONAL);
-        store.setSchemaContext(SCHEMA_CONTEXT);
+        final DataTree store = new InMemoryDataTreeFactory().create(DataTreeConfiguration.DEFAULT_OPERATIONAL,
+            SCHEMA_CONTEXT);
 
         final DataTreeModification putTransaction = store.takeSnapshot().newModification();
         putTransaction.write(TestModel.TEST_PATH,
@@ -2076,8 +2075,7 @@ public class ShardTest extends AbstractShardTest {
 
                 waitUntilLeader(shard);
 
-                final TestActorRef<MessageCollectorActor> listener =
-                        TestActorRef.create(getSystem(), Props.create(MessageCollectorActor.class));
+                final ActorRef listener = getSystem().actorOf(MessageCollectorActor.props());
 
                 shard.tell(new RegisterRoleChangeListener(), listener);
 
@@ -2324,7 +2322,8 @@ public class ShardTest extends AbstractShardTest {
 
     @Test
     public void testServerRemoved() throws Exception {
-        final TestActorRef<MessageCollectorActor> parent = actorFactory.createTestActor(MessageCollectorActor.props());
+        final TestActorRef<MessageCollectorActor> parent = actorFactory.createTestActor(MessageCollectorActor.props()
+                .withDispatcher(Dispatchers.DefaultDispatcherId()));
 
         final ActorRef shard = parent.underlyingActor().context().actorOf(
                 newShardBuilder().props().withDispatcher(Dispatchers.DefaultDispatcherId()),