use of org.eclipse.emf.compare.Comparison in project InformationSystem by ObeoNetwork.
the class DatabaseTransformationTestSuite method loadAndProcessInputs.
/**
* Loads the input models found at the given URIs. Then processes their
* contents and places the result in a new Resource with the given desired
* URI. That URI is the same as the URI of the expected output model, so
* that EMF Compare has no problem matching the resources. This method
* <i>does not</i> modify the input models.
*
* @param inputURI
* the URI of the input model.
* @param desiredSynchronizedInputURI
* the desired URI for the result of the processing of the inputs
* of this test suite. Should be the same as that of the expected
* output.
* @return the resource containing the result of processing the inputs of
* this test suite.
*/
public Resource loadAndProcessInputs(List<URI> inputURIs, URI desiredProcessedInputURI) {
// Load input data for the test
final Resource comparisonResource = DatabaseCompareAbstractTestSuite.loadResource(inputURIs.get(2));
EcoreUtil.resolveAll(comparisonResource);
// Transform the EMFCompare Comparison into a Dbevolution model.
final Comparison comparison = (Comparison) comparisonResource.getContents().get(0);
final Comparison dbevolution = transform(comparison);
// Store the resulting Dbevolution into an EMF Resource
final Resource dbevolutionResource = DatabaseCompareAbstractTestSuite.createResourceSet().createResource(desiredProcessedInputURI);
dbevolutionResource.getContents().add(dbevolution);
return dbevolutionResource;
}
use of org.eclipse.emf.compare.Comparison in project InformationSystem by ObeoNetwork.
the class EMFCompareUtils method compare.
/**
* Compares two {@link Notifier} using the EMF Compare engine.
*
* @param expected
* @param actual
*/
public static Comparison compare(Notifier expected, Notifier actual) {
final IComparisonScope scope = new DefaultComparisonScope(expected, actual, null);
final Comparison comparison = comparator.compare(scope);
return comparison;
}
Aggregations