use of org.codice.ddf.migration.ConfigurationMigratable in project ddf by codice.
the class TestMigratable method testGetOptionalMigratableInfo.
@Test
public void testGetOptionalMigratableInfo() {
DescribableBean bean1 = new DescribableBean("1.0", "ddf.platform", "Platform Migratable", "Exports platform config", "Codice");
DescribableBean bean2 = new DescribableBean("2.0", "ddf.catalog", "Catalog Migratable", "Exports catalog metacards", "Codice");
List<ConfigurationMigratable> mockConfigs = mock(List.class);
List<DataMigratable> migratables = new ArrayList<>();
migratables.add(new TestMigratable(bean1, 3));
migratables.add(new TestMigratable(bean2, 4));
ConfigurationMigrationManager manager = new ConfigurationMigrationManager(configurationAdminMigration, mBeanServer, mockConfigs, migratables);
Collection<Describable> describables = manager.getOptionalMigratableInfo();
verifyDescriptionEqual((Describable) describables.toArray()[0], bean1);
verifyDescriptionEqual((Describable) describables.toArray()[1], bean2);
}
use of org.codice.ddf.migration.ConfigurationMigratable in project ddf by codice.
the class ConfigurationMigrationManager method exportMigratables.
private Collection<MigrationWarning> exportMigratables(Path exportDirectory) throws IOException {
List<MigrationWarning> warnings = new LinkedList<>();
for (ConfigurationMigratable configMigratable : configurationMigratables) {
warnings.addAll(exportMigratable(configMigratable, exportDirectory));
}
for (DataMigratable dataMigratable : dataMigratables) {
Path dataMigratableDirectory = exportDirectory.resolve(dataMigratable.getId());
Files.createDirectories(dataMigratableDirectory);
warnings.addAll(exportMigratable(dataMigratable, exportDirectory));
}
return warnings;
}
Aggregations