Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RavenDB-1716 StartRestore/StartBackup location in Client API
- Loading branch information
Showing
13 changed files
with
84 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// ----------------------------------------------------------------------- | ||
// <copyright file="RavenDB_1716.cs" company="Hibernating Rhinos LTD"> | ||
// Copyright (c) Hibernating Rhinos LTD. All rights reserved. | ||
// </copyright> | ||
// ----------------------------------------------------------------------- | ||
using System.Threading.Tasks; | ||
using Raven.Abstractions.Data; | ||
using Raven.Json.Linq; | ||
using Xunit; | ||
using Xunit.Extensions; | ||
|
||
namespace Raven.Tests.Issues | ||
{ | ||
public class RavenDB_1716 : RavenTest | ||
{ | ||
[Theory] | ||
[InlineData("esent")] | ||
[InlineData("voron")] | ||
public async Task Restore_operation_works_async(string storage) | ||
{ | ||
var backupDir = NewDataPath("BackupDatabase"); | ||
var restoreDir = NewDataPath("RestoredDatabase"); | ||
|
||
using (var store = NewRemoteDocumentStore(runInMemory: false, requestedStorage: storage, databaseName: Constants.SystemDatabase)) | ||
{ | ||
store.DatabaseCommands.Put("keys/1", null, new RavenJObject { { "Key", 1 } }, new RavenJObject()); | ||
|
||
await store.AsyncDatabaseCommands.GlobalAdmin.StartBackupAsync(backupDir, new DatabaseDocument(), Constants.SystemDatabase); | ||
|
||
WaitForBackup(store.DatabaseCommands, true); | ||
|
||
// restore as a new database | ||
await store.AsyncDatabaseCommands.GlobalAdmin.StartRestoreAsync(backupDir, restoreDir, "db1"); | ||
|
||
// get restore status and wait for finish | ||
WaitForRestore(store.DatabaseCommands); | ||
WaitForDocument(store.DatabaseCommands, "Raven/Databases/db1"); | ||
|
||
Assert.Equal(1, store.DatabaseCommands.ForDatabase("db1").Get("keys/1").DataAsJson.Value<int>("Key")); | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters