@Test @FixFor( "MODE-2440" ) public void shouldRestoreLegacy450BackupWithCompressedBinaries() throws Exception { // extract the old repo backup File legacyBackupDir = extractZip("legacy_backup/repoBackups450.zip", this.backupArea); assertTrue("Zip content not extracted correctly", legacyBackupDir.exists() && legacyBackupDir.canRead() && legacyBackupDir.isDirectory()); Problems problems = session().getWorkspace().getRepositoryManager().restoreRepository(legacyBackupDir); assertNoProblems(problems); verifyBinaryContent(); }
/** * Test that a repository containing the same binary data (files) as the ones from this test backed up using ModeShape 3.8.1 * is restored correctly. */ @Test @FixFor( "MODE-2440" ) public void shouldRestoreLegacy381RepositoryWithSameName() throws Exception { // extract the old repo backup File legacyBackupDir = extractZip("legacy_backup/repoBackups381.zip", this.backupArea); assertTrue("Zip content not extracted correctly", legacyBackupDir.exists() && legacyBackupDir.canRead() && legacyBackupDir.isDirectory()); Problems problems = session().getWorkspace().getRepositoryManager().restoreRepository(legacyBackupDir); assertNoProblems(problems); verifyBinaryContent(); }
@Test @FixFor( "MODE-2440" ) public void shouldBackupRepositoryWhichIncludesBinaryValuesCompressed() throws Exception { loadBinaryContent(); makeBackup(BackupOptions.DEFAULT); wipeRepository(); restoreBackup(); verifyBinaryContent(); }
@Test @FixFor( "MODE-2559" ) public void shouldBackupRepositoryWhichIncludesBinaryValuesUncompressed() throws Exception { BackupOptions backupOptions = new BackupOptions() { @Override public boolean compress() { return false; } }; loadBinaryContent(); makeBackup(backupOptions); wipeRepository(); restoreBackup(); verifyBinaryContent(); }
@Test @FixFor( "MODE-2584" ) public void shouldPreserveBinariesFromRestoredBackup() throws Exception { loadBinaryContent(); makeBackup(BackupOptions.DEFAULT); wipeRepository(); restoreBackup(); makeBackup(BackupOptions.DEFAULT); wipeRepository(); restoreBackup(); verifyBinaryContent(); }
@Test @FixFor( "MODE-2440" ) public void shouldRestoreBinaryReferencesWhenExcludedFromBackup() throws Exception { loadBinaryContent(); verifyBinaryContent(); // Make the backup, and check that there are no problems ... BackupOptions backupOptions = new BackupOptions() { @Override public boolean includeBinaries() { return false; } }; Problems problems = session().getWorkspace().getRepositoryManager().backupRepository(backupDirectory, backupOptions); assertNoProblems(problems); // shutdown the repo and remove just the repo main store (not the binary store) assertTrue(repository().shutdown().get()); FileUtil.delete(backupRepoDir.getPath() + "/store"); // start a fresh empty repo and then restore just the data without binaries startRepositoryWithConfigurationFrom("config/backup-repo-config.json"); RestoreOptions restoreOptions = new RestoreOptions() { @Override public boolean includeBinaries() { return false; } }; problems = session().getWorkspace().getRepositoryManager().restoreRepository(backupDirectory, restoreOptions); assertNoProblems(problems); verifyBinaryContent(); }