use of org.apache.jackrabbit.oak.upgrade.cli.parser.MigrationOptions in project jackrabbit-oak by apache.
the class CopyBinariesTest 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);
assertEquals(blobMigrationCase, datastores.getBlobMigrationCase());
} catch (CliArgumentException e) {
if (blobMigrationCase == DatastoreArguments.BlobMigrationCase.UNSUPPORTED) {
return;
} else {
throw e;
}
}
createSession();
}
use of org.apache.jackrabbit.oak.upgrade.cli.parser.MigrationOptions in project jackrabbit-oak by apache.
the class OakUpgrade method migrate.
public static void migrate(MigrationCliArguments argumentParser) throws IOException, CliArgumentException {
MigrationOptions options = new MigrationOptions(argumentParser);
options.logOptions();
StoreArguments stores = new StoreArguments(options, argumentParser.getArguments());
stores.logOptions();
boolean srcEmbedded = stores.srcUsesEmbeddedDatastore();
DatastoreArguments datastores = new DatastoreArguments(options, stores, srcEmbedded);
migrate(options, stores, datastores);
}
use of org.apache.jackrabbit.oak.upgrade.cli.parser.MigrationOptions 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();
}
Aggregations