use of org.apache.jackrabbit.core.config.RepositoryConfig in project jackrabbit-oak by apache.
the class SameNodeSiblingsTest method migrate.
private DocumentNodeStore migrate(SourceDataCreator sourceDataCreator) throws RepositoryException, IOException {
RepositoryConfig config = RepositoryConfig.install(crx2RepoDir);
RepositoryImpl repository = RepositoryImpl.create(config);
try {
Session session = repository.login(CREDENTIALS);
sourceDataCreator.create(session);
session.logout();
} finally {
repository.shutdown();
}
// re-create the config
config = RepositoryConfig.install(crx2RepoDir);
RepositoryContext context = RepositoryContext.create(config);
DocumentNodeStore target = new DocumentMK.Builder().getNodeStore();
try {
RepositoryUpgrade upgrade = new RepositoryUpgrade(context, target);
upgrade.copy(null);
} finally {
context.getRepository().shutdown();
}
return target;
}
use of org.apache.jackrabbit.core.config.RepositoryConfig in project jackrabbit-oak by apache.
the class IncludeExcludeUpgradeTest method doUpgradeRepository.
@Override
protected void doUpgradeRepository(File source, NodeStore target) throws RepositoryException, IOException {
final RepositoryConfig config = RepositoryConfig.create(source);
final RepositoryContext context = RepositoryContext.create(config);
try {
final RepositoryUpgrade upgrade = new RepositoryUpgrade(context, target);
upgrade.setIncludes("/content/foo/en", "/content/assets/foo", "/content/other");
upgrade.setExcludes("/content/assets/foo/2013", "/content/assets/foo/2012", "/content/assets/foo/2011", "/content/assets/foo/2010");
upgrade.setExcludeFragments("oak-mount-libs-xyz");
upgrade.setFragmentPaths("/content/other/path");
upgrade.copy(null);
} finally {
context.getRepository().shutdown();
}
}
use of org.apache.jackrabbit.core.config.RepositoryConfig in project jackrabbit-oak by apache.
the class UpgradeFromTwoSourcesTest method doUpgradeRepository.
private void doUpgradeRepository(File source, NodeStore target, String... includes) throws RepositoryException {
final RepositoryConfig config = RepositoryConfig.create(source);
final RepositoryContext context = RepositoryContext.create(config);
try {
final RepositoryUpgrade upgrade = new RepositoryUpgrade(context, target);
upgrade.setIncludes(includes);
upgrade.copy(null);
} finally {
context.getRepository().shutdown();
}
}
use of org.apache.jackrabbit.core.config.RepositoryConfig in project jackrabbit-oak by apache.
the class RepeatedRepositoryUpgradeTest method doUpgradeRepository.
protected void doUpgradeRepository(File source, NodeStore target, boolean skipInit) throws RepositoryException, IOException {
final RepositoryConfig config = RepositoryConfig.create(source);
final RepositoryContext context = RepositoryContext.create(config);
try {
final RepositoryUpgrade repositoryUpgrade = new RepositoryUpgrade(context, target);
repositoryUpgrade.setSkipInitialization(skipInit);
repositoryUpgrade.copy(new RepositoryInitializer() {
@Override
public void initialize(@Nonnull NodeBuilder builder) {
builder.child("foo").child("bar");
}
});
} finally {
context.getRepository().shutdown();
}
}
use of org.apache.jackrabbit.core.config.RepositoryConfig in project jackrabbit-oak by apache.
the class LongNameTest method assertNoLongNamesTest.
@Test
public void assertNoLongNamesTest() throws IOException, RepositoryException {
RepositoryConfig config = createCrx2Config(crx2RepoDir);
RepositoryContext context = RepositoryContext.create(config);
try {
RepositoryUpgrade upgrade = new RepositoryUpgrade(context, new MemoryNodeStore());
try {
upgrade.assertNoLongNames();
fail("Exception should be thrown");
} catch (RepositoryException e) {
// that's fine
}
} finally {
context.getRepository().shutdown();
}
}
Aggregations