use of org.apache.jackrabbit.oak.backup.impl.FileStoreBackupImpl in project jackrabbit-oak by apache.
the class FileStoreBackupTest method testBackup.
@Test
public void testBackup() throws Exception {
FileStore source = newFileStore(src);
SegmentNodeStore store = SegmentNodeStoreBuilders.builder(source).build();
FileStoreBackup fsb = new FileStoreBackupImpl();
try {
init(store);
source.flush();
fsb.backup(source.getReader(), source.getRevisions(), destination);
compare(source, destination);
addTestContent(store);
source.flush();
fsb.backup(source.getReader(), source.getRevisions(), destination);
compare(source, destination);
source.compact();
fsb.cleanup(source);
fsb.backup(source.getReader(), source.getRevisions(), destination);
compare(source, destination);
} finally {
source.close();
}
}
use of org.apache.jackrabbit.oak.backup.impl.FileStoreBackupImpl in project jackrabbit-oak by apache.
the class FileStoreBackupTest method testRestore.
@Test
public void testRestore() throws Exception {
FileStore source = newFileStore(src);
SegmentNodeStore store = SegmentNodeStoreBuilders.builder(source).build();
FileStoreBackup fsb = new FileStoreBackupImpl();
FileStoreRestore fsr = new FileStoreRestoreImpl();
init(store);
source.flush();
fsb.backup(source.getReader(), source.getRevisions(), destination);
source.close();
fsr.restore(destination, src);
source = newFileStore(src);
compare(source, destination);
source.close();
}
Aggregations