Search in sources :

Example 1 with FileStoreRestoreImpl

use of org.apache.jackrabbit.oak.backup.impl.FileStoreRestoreImpl 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();
}
Also used : FileStore(org.apache.jackrabbit.oak.segment.file.FileStore) FileStoreRestoreImpl(org.apache.jackrabbit.oak.backup.impl.FileStoreRestoreImpl) SegmentNodeStore(org.apache.jackrabbit.oak.segment.SegmentNodeStore) FileStoreBackupImpl(org.apache.jackrabbit.oak.backup.impl.FileStoreBackupImpl) Test(org.junit.Test)

Aggregations

FileStoreBackupImpl (org.apache.jackrabbit.oak.backup.impl.FileStoreBackupImpl)1 FileStoreRestoreImpl (org.apache.jackrabbit.oak.backup.impl.FileStoreRestoreImpl)1 SegmentNodeStore (org.apache.jackrabbit.oak.segment.SegmentNodeStore)1 FileStore (org.apache.jackrabbit.oak.segment.file.FileStore)1 Test (org.junit.Test)1