public async Task When_storing_index_replicate_to_all_stores_async() { var store1 = CreateStore(); var store2 = CreateStore(); var store3 = CreateStore(); SetupReplication(store1.DatabaseCommands, store2, store3); var index = new IndexSample(); await index.ExecuteAsync(store1.AsyncDatabaseCommands, new DocumentConvention()); Assert.True(store2.DatabaseCommands.GetIndexNames(0, 10).ToList().Contains(index.IndexName)); Assert.True(store3.DatabaseCommands.GetIndexNames(0, 10).ToList().Contains(index.IndexName)); }
public void When_storeing_index_replicate_to_all_stores_async() { var store1 = CreateStore(); var store2 = CreateStore(); var store3 = CreateStore(); SetupReplication(store1.DatabaseCommands, store2.Url, store3.Url); var index = new IndexSample(); index.ExecuteAsync(store1.AsyncDatabaseCommands, new DocumentConvention()).ContinueWith(task => { Assert.True(store2.DatabaseCommands.GetIndexNames(0, 10).ToList().Contains(index.IndexName)); Assert.True(store3.DatabaseCommands.GetIndexNames(0, 10).ToList().Contains(index.IndexName)); }).Wait(); }
public void When_storing_index_replicate_to_all_stores_in_respective_databases_async() { var store1 = CreateStore(configureStore: store => store.DefaultDatabase = "MasterDb"); var store2 = CreateStore(configureStore: store => store.DefaultDatabase = "Slave1Db"); var store3 = CreateStore(configureStore: store => store.DefaultDatabase = "Slave2Db"); SetupReplication(store1.DatabaseCommands, new[] { new RavenJObject { { "Url", store2.Url }, { "Database", "Slave1Db" } }, new RavenJObject { { "Url", store3.Url }, { "Database", "Slave2Db" } } }); var index = new IndexSample(); index.ExecuteAsync(store1.AsyncDatabaseCommands, new DocumentConvention()).ContinueWith(task => { Assert.True(store2.DatabaseCommands.GetIndexNames(0, 10).ToList().Contains(index.IndexName)); Assert.True(store3.DatabaseCommands.GetIndexNames(0, 10).ToList().Contains(index.IndexName)); }).Wait(); }
public async Task When_storing_index_replicate_to_all_stores_in_respective_databases_async() { var store1 = CreateStore(configureStore: store => store.DefaultDatabase = "MasterDb"); var store2 = CreateStore(configureStore: store => store.DefaultDatabase = "Slave1Db"); var store3 = CreateStore(configureStore: store => store.DefaultDatabase = "Slave2Db"); SetupReplication(store1.DatabaseCommands, new[] { new RavenJObject { { "Url", store2.Url }, { "Database", "Slave1Db" } }, new RavenJObject { { "Url", store3.Url }, { "Database", "Slave2Db" } } }); var index = new IndexSample(); await index.ExecuteAsync(store1.AsyncDatabaseCommands, new DocumentConvention()); Assert.True(WaitForIndexToReplicate(store2.DatabaseCommands, index.IndexName)); Assert.True(WaitForIndexToReplicate(store3.DatabaseCommands, index.IndexName)); }