use of co.cask.cdap.api.dataset.IncompatibleUpdateException in project cdap by caskdata.
the class DatasetDefinitionRegistryWithDefaultModules method testFileSetReconfigure.
private void testFileSetReconfigure(boolean expectSuccess, DatasetDefinition def, Boolean wasExternal, String path, Boolean newExternal, String newPath, DatasetProperties extraProps) throws IncompatibleUpdateException {
Assert.assertTrue(def instanceof Reconfigurable);
DatasetProperties props = buildFileSetProps(extraProps, wasExternal, path);
DatasetProperties newProps = buildFileSetProps(extraProps, newExternal, newPath);
DatasetSpecification spec = def.configure("fs", props);
if (expectSuccess) {
((Reconfigurable) def).reconfigure("fs", newProps, spec);
} else {
try {
((Reconfigurable) def).reconfigure("fs", newProps, spec);
Assert.fail("reconfigure should have thrown exception");
} catch (IncompatibleUpdateException e) {
// expected
}
}
}
Aggregations