public void WillReplicateToOtherSystems() { node.Stub(x => x.IsSegmentOwned(0)).Return(true); var request = new ExtendedPutRequest { Key = "test", Bytes = new byte[] { 1, 2, 4 }, Segment = 0, }; distributedHashTableStorage.Put(topologyVersion, request); node.AssertWasCalled(x => x.SendToAllOtherBackups(0, request)); }
public void WillReplicateToOtherSystems() { node.Stub(x => x.IsSegmentOwned(0)).Return(true); var request = new ExtendedRemoveRequest() { Key = "test", SpecificVersion = version, Segment = 0, }; distributedHashTableStorage.Remove(topologyVersion, request); node.AssertWasCalled(x => x.SendToAllOtherBackups(0, request)); }
public WritingValues() { node = MockRepository.GenerateStub <IDistributedHashTableNode>(); topologyVersion = 2; node.Stub(x => x.GetTopologyVersion()).Return(topologyVersion); distributedHashTableStorage = new DistributedHashTableStorage("test.esent", node); }
public OnlineSegmentReplicationCommandTest() { node = MockRepository.GenerateStub<IDistributedHashTableNode>(); replication = MockRepository.GenerateStub<IDistributedHashTableNodeReplication>(); endpoint = NodeEndpoint.ForTest(1); node.Stub(x => x.Endpoint).Return(NodeEndpoint.ForTest(2)); storage = MockRepository.GenerateStub<IDistributedHashTableStorage>(); node.Storage = storage; node.Stub(x => x.GetTopologyVersion()).Return(topologyVersion); var factory = MockRepository.GenerateStub<IDistributedHashTableNodeReplicationFactory>(); factory.Stub(x => x.Create(null)).IgnoreArguments().Return(replication); command = new OnlineSegmentReplicationCommand( endpoint, new[] { new Segment { Index = 0 }, new Segment { Index = 1 }, }, ReplicationType.Ownership, node, factory); }
public WhenThereAreNoKeysInTable() { node = MockRepository.GenerateStub <IDistributedHashTableNode>(); topologyVersion = 7; node.Stub(x => x.GetTopologyVersion()).Return(topologyVersion); distributedHashTableStorage = new DistributedHashTableStorage("test.esent", node); replication = distributedHashTableStorage.Replication; }
public OnlineSegmentReplicationCommandTest() { node = MockRepository.GenerateStub <IDistributedHashTableNode>(); replication = MockRepository.GenerateStub <IDistributedHashTableNodeReplication>(); endpoint = NodeEndpoint.ForTest(1); node.Stub(x => x.Endpoint).Return(NodeEndpoint.ForTest(2)); storage = MockRepository.GenerateStub <IDistributedHashTableStorage>(); node.Storage = storage; node.Stub(x => x.GetTopologyVersion()).Return(topologyVersion); var factory = MockRepository.GenerateStub <IDistributedHashTableNodeReplicationFactory>(); factory.Stub(x => x.Create(null)).IgnoreArguments().Return(replication); command = new OnlineSegmentReplicationCommand( endpoint, new[] { new Segment { Index = 0 }, new Segment { Index = 1 }, }, ReplicationType.Ownership, node, factory); }
public ReadingValues() { node = MockRepository.GenerateStub<IDistributedHashTableNode>(); topologyVersion = 1; node.Stub(x => x.GetTopologyVersion()).Return(topologyVersion); distributedHashTableStorage = new DistributedHashTableStorage("test.esent", node); distributedHashTableStorage.Put(topologyVersion, new ExtendedPutRequest { Key = "test", Bytes = new byte[]{1,2,4}, Segment = 0, }); }
public ReadingValues() { node = MockRepository.GenerateStub <IDistributedHashTableNode>(); topologyVersion = 1; node.Stub(x => x.GetTopologyVersion()).Return(topologyVersion); distributedHashTableStorage = new DistributedHashTableStorage("test.esent", node); distributedHashTableStorage.Put(topologyVersion, new ExtendedPutRequest { Key = "test", Bytes = new byte[] { 1, 2, 4 }, Segment = 0, }); }
public WhenThereAreKeysInTable() { node = MockRepository.GenerateStub <IDistributedHashTableNode>(); topologyVersion = 9; node.Stub(x => x.GetTopologyVersion()).Return(topologyVersion); distributedHashTableStorage = new DistributedHashTableStorage("test.esent", node); replication = distributedHashTableStorage.Replication; putResult = distributedHashTableStorage.Put(topologyVersion, new ExtendedPutRequest { Tag = 0, Bytes = new byte[] { 1 }, Key = "test", Segment = 0 })[0]; }
public WhenThereAreKeysInTable() { node = MockRepository.GenerateStub<IDistributedHashTableNode>(); topologyVersion = 9; node.Stub(x => x.GetTopologyVersion()).Return(topologyVersion); distributedHashTableStorage = new DistributedHashTableStorage("test.esent", node); replication = distributedHashTableStorage.Replication; putResult = distributedHashTableStorage.Put(topologyVersion, new ExtendedPutRequest { Tag = 0, Bytes = new byte[] {1}, Key = "test", Segment = 0 })[0]; }
public WritingValues() { node = MockRepository.GenerateStub<IDistributedHashTableNode>(); topologyVersion = 2; node.Stub(x => x.GetTopologyVersion()).Return(topologyVersion); distributedHashTableStorage = new DistributedHashTableStorage("test.esent", node); }
public WhenThereAreNoKeysInTable() { node = MockRepository.GenerateStub<IDistributedHashTableNode>(); topologyVersion = 7; node.Stub(x => x.GetTopologyVersion()).Return(topologyVersion); distributedHashTableStorage = new DistributedHashTableStorage("test.esent", node); replication = distributedHashTableStorage.Replication; }