use of org.apache.jackrabbit.oak.spi.state.NodeStore in project jackrabbit-oak by apache.
the class CopyCheckpointsTest method prepare.
@Before
@Override
public void prepare() throws Exception {
NodeStore source = getSourceContainer().open();
try {
initContent(source);
} finally {
getSourceContainer().close();
}
String[] args = getArgs();
log.info("oak2oak {}", Joiner.on(' ').join(args));
try {
MigrationCliArguments cliArgs = new MigrationCliArguments(OptionParserFactory.create().parse(args));
MigrationOptions options = new MigrationOptions(cliArgs);
StoreArguments stores = new StoreArguments(options, cliArgs.getArguments());
DatastoreArguments datastores = new DatastoreArguments(options, stores, stores.srcUsesEmbeddedDatastore());
OakUpgrade.migrate(options, stores, datastores);
} catch (RuntimeException e) {
if (expectedResult == Result.EXCEPTION) {
return;
} else {
throw e;
}
}
if (expectedResult == Result.EXCEPTION) {
fail("Migration should fail");
}
createSession();
}
use of org.apache.jackrabbit.oak.spi.state.NodeStore in project jackrabbit-oak by apache.
the class CopyVersionHistorySidegradeTest method performCopy.
@Override
protected Session performCopy(VersionCopySetup setup) throws RepositoryException, IOException {
final NodeStore targetNodeStore = new MemoryNodeStore();
final RepositorySidegrade sidegrade = new RepositorySidegrade(sourceNodeStore, targetNodeStore);
setup.setup(sidegrade.versionCopyConfiguration);
sidegrade.copy();
repository = (RepositoryImpl) new Jcr(new Oak(targetNodeStore)).createRepository();
Session s = repository.login(AbstractRepositoryUpgradeTest.CREDENTIALS);
sessions.add(s);
return s;
}
use of org.apache.jackrabbit.oak.spi.state.NodeStore in project jackrabbit-oak by apache.
the class IgnoreMissingBinariesTest method prepare.
@Before
public void prepare() throws Exception {
NodeStore source = getSourceContainer().open();
try {
initContent(source);
} finally {
getSourceContainer().close();
}
assertTrue(new File(blob.getDirectory(), "0c/07/02/0c0702b43bfcc7c0bb1329a10bbc6d5c5ef15856afd714c1331495b95f65b292").delete());
String[] args = getArgs();
log.info("oak2oak {}", Joiner.on(' ').join(args));
OakUpgrade.main(args);
createSession();
}
use of org.apache.jackrabbit.oak.spi.state.NodeStore in project jackrabbit-oak by apache.
the class IncludeExcludeSidegradeTest method upgradeRepository.
@Before
public synchronized void upgradeRepository() throws Exception {
if (targetNodeStore == null) {
File directory = getTestDirectory();
File source = new File(directory, "source");
source.mkdirs();
FileStore fileStore = fileStoreBuilder(source).build();
SegmentNodeStore segmentNodeStore = SegmentNodeStoreBuilders.builder(fileStore).build();
RepositoryImpl repository = (RepositoryImpl) new Jcr(new Oak(segmentNodeStore)).createRepository();
Session session = repository.login(CREDENTIALS);
try {
createSourceContent(session);
} finally {
session.save();
session.logout();
repository.shutdown();
fileStore.close();
}
final NodeStore target = getTargetNodeStore();
doUpgradeRepository(source, target);
targetNodeStore = target;
}
}
use of org.apache.jackrabbit.oak.spi.state.NodeStore in project jackrabbit-oak by apache.
the class AbstractRepositoryUpgradeTest method upgradeRepository.
@Before
public synchronized void upgradeRepository() throws Exception {
if (targetNodeStore == null) {
File directory = getTestDirectory();
File source = new File(directory, "source");
source.mkdirs();
RepositoryImpl repository = createSourceRepository(source);
Session session = repository.login(CREDENTIALS);
try {
createSourceContent(session);
} finally {
session.save();
session.logout();
repository.shutdown();
}
final NodeStore target = getTargetNodeStore();
doUpgradeRepository(source, target);
targetNodeStore = target;
}
}
Aggregations