Search in sources :

Example 6 with ProjectTransformationEnvironment

use of eu.esdihumboldt.hale.common.headless.impl.ProjectTransformationEnvironment in project hale by halestudio.

the class AbstractMergeCellMigratorTest method mergeWithMigrator.

/**
 * Perform merging using a specific merge migrator.
 *
 * @param migrator the migrator to test, <code>null</code> if the migrator
 *            configured in the system should be used
 * @param cellId the ID of the cell to migrate
 * @param projectToMigrate the location of the project containing the cell
 *            (Mapping from B to C)
 * @param matchingProject the location of the project providing the matching
 *            (Mapping from A to B) information
 * @return the merge result
 * @throws Exception if preparing or running the test fails
 */
public List<MutableCell> mergeWithMigrator(MergeCellMigrator migrator, String cellId, URL projectToMigrate, URL matchingProject) throws Exception {
    ProjectTransformationEnvironment projectToMigrateEnv = projectCache.get(projectToMigrate.toURI());
    Alignment migrateAlignment = projectToMigrateEnv.getAlignment();
    Cell cellToMigrate = migrateAlignment.getCell(cellId);
    assertNotNull(MessageFormat.format("Cell with ID {0} not found in alignment to migrate", cellId), cellToMigrate);
    ProjectTransformationEnvironment matchingProjectEnv = projectCache.get(matchingProject.toURI());
    return mergeWithMigrator(migrator, cellToMigrate, matchingProjectEnv);
}
Also used : Alignment(eu.esdihumboldt.hale.common.align.model.Alignment) ProjectTransformationEnvironment(eu.esdihumboldt.hale.common.headless.impl.ProjectTransformationEnvironment) Cell(eu.esdihumboldt.hale.common.align.model.Cell) MutableCell(eu.esdihumboldt.hale.common.align.model.MutableCell)

Aggregations

ProjectTransformationEnvironment (eu.esdihumboldt.hale.common.headless.impl.ProjectTransformationEnvironment)6 DefaultInputSupplier (eu.esdihumboldt.hale.common.core.io.supplier.DefaultInputSupplier)3 ReportHandler (eu.esdihumboldt.hale.common.core.report.ReportHandler)2 IOException (java.io.IOException)2 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)2 Alignment (eu.esdihumboldt.hale.common.align.model.Alignment)1 Cell (eu.esdihumboldt.hale.common.align.model.Cell)1 MutableCell (eu.esdihumboldt.hale.common.align.model.MutableCell)1 AbstractIOAdvisor (eu.esdihumboldt.hale.common.core.io.impl.AbstractIOAdvisor)1 FileIOSupplier (eu.esdihumboldt.hale.common.core.io.supplier.FileIOSupplier)1 Message (eu.esdihumboldt.hale.common.core.report.Message)1 Reporter (eu.esdihumboldt.hale.common.core.report.Reporter)1 DefaultReporter (eu.esdihumboldt.hale.common.core.report.impl.DefaultReporter)1 MessageImpl (eu.esdihumboldt.hale.common.core.report.impl.MessageImpl)1 DefaultTransformedInstanceValidator (eu.esdihumboldt.hale.common.headless.transform.validate.impl.DefaultTransformedInstanceValidator)1 InstanceReader (eu.esdihumboldt.hale.common.instance.io.InstanceReader)1 InstanceWriter (eu.esdihumboldt.hale.common.instance.io.InstanceWriter)1 InstanceCollection (eu.esdihumboldt.hale.common.instance.model.InstanceCollection)1 FilteredInstanceCollection (eu.esdihumboldt.hale.common.instance.model.impl.FilteredInstanceCollection)1 MultiInstanceCollection (eu.esdihumboldt.hale.common.instance.model.impl.MultiInstanceCollection)1