Bug 8380: Fix unhandled messages in ShardManager
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / datastore / shardmanager / ShardManagerTest.java
index 5efd0947026d6cc51aa9d59bb1cb2ef3b5ef57d4..6e37a975ed6aafaa84849a9b1b0289d8f2d60065 100644 (file)
@@ -40,7 +40,6 @@ import akka.util.Timeout;
 import com.google.common.base.Function;
 import com.google.common.base.Stopwatch;
 import com.google.common.collect.ImmutableMap;
-import com.google.common.collect.ImmutableSet;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
 import com.google.common.util.concurrent.Uninterruptibles;
@@ -68,7 +67,6 @@ import org.opendaylight.controller.cluster.datastore.DatastoreContext;
 import org.opendaylight.controller.cluster.datastore.DatastoreContextFactory;
 import org.opendaylight.controller.cluster.datastore.DistributedDataStore;
 import org.opendaylight.controller.cluster.datastore.Shard;
-import org.opendaylight.controller.cluster.datastore.ShardManager.SchemaContextModules;
 import org.opendaylight.controller.cluster.datastore.config.ConfigurationImpl;
 import org.opendaylight.controller.cluster.datastore.config.EmptyModuleShardConfigProvider;
 import org.opendaylight.controller.cluster.datastore.config.ModuleShardConfiguration;
@@ -118,7 +116,6 @@ import org.opendaylight.controller.cluster.raft.messages.ServerChangeReply;
 import org.opendaylight.controller.cluster.raft.messages.ServerChangeStatus;
 import org.opendaylight.controller.cluster.raft.messages.ServerRemoved;
 import org.opendaylight.controller.cluster.raft.policy.DisableElectionsRaftPolicy;
-import org.opendaylight.controller.cluster.raft.utils.InMemoryJournal;
 import org.opendaylight.controller.cluster.raft.utils.InMemorySnapshotStore;
 import org.opendaylight.controller.cluster.raft.utils.MessageCollectorActor;
 import org.opendaylight.controller.md.cluster.datastore.model.TestModel;
@@ -989,24 +986,6 @@ public class ShardManagerTest extends AbstractShardManagerTest {
         LOG.info("testOnReceiveFindLocalShardWaitForShardInitialized starting");
     }
 
-    @Test
-    public void testOnRecoveryJournalIsCleaned() {
-        String persistenceID = "shard-manager-" + shardMrgIDSuffix;
-        InMemoryJournal.addEntry(persistenceID, 1L, new SchemaContextModules(ImmutableSet.of("foo")));
-        InMemoryJournal.addEntry(persistenceID, 2L, new SchemaContextModules(ImmutableSet.of("bar")));
-        InMemoryJournal.addDeleteMessagesCompleteLatch(persistenceID);
-
-        newTestShardManager();
-
-        InMemoryJournal.waitForDeleteMessagesComplete(persistenceID);
-
-        // Journal entries up to the last one should've been deleted
-        Map<Long, Object> journal = InMemoryJournal.get(persistenceID);
-        synchronized (journal) {
-            assertEquals("Journal size", 0, journal.size());
-        }
-    }
-
     @Test
     public void testRoleChangeNotificationAndShardLeaderStateChangedReleaseReady() throws Exception {
         TestShardManager shardManager = newTestShardManager();