Commit 0f90fd00 authored by apupier's avatar apupier

BS-8676: Modify package names for new EDapt release

parent b0896265
......@@ -42,9 +42,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.bonitasoft.studio.engine;bundle-version="1.0.0",
org.eclipse.emf.edapt.history;bundle-version="0.3.0",
org.bonitasoft.studio.diagram.custom,
org.eclipse.emf.compare;bundle-version="1.2.2",
org.eclipse.emf.compare.diff;bundle-version="1.2.2",
org.eclipse.emf.compare.match,
org.eclipse.emf.compare;bundle-version="3.1.1",
org.bonitasoft.studio.refactoring;bundle-version="6.3.0",
assertj-core;bundle-version="1.5.0";resolution:=optional,
org.junit;bundle-version="4.11.0";resolution:=optional,
......
......@@ -47,9 +47,9 @@ import org.eclipse.emf.ecore.xmi.XMIResource;
import org.eclipse.emf.ecore.xmi.XMLOptions;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.ecore.xmi.impl.XMLOptionsImpl;
import org.eclipse.emf.edapt.history.Release;
import org.eclipse.emf.edapt.migration.MigrationException;
import org.eclipse.emf.edapt.migration.execution.Migrator;
import org.eclipse.emf.edapt.spi.history.Release;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.swt.graphics.Image;
......
......@@ -50,10 +50,10 @@ import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
import org.eclipse.emf.edapt.history.Release;
import org.eclipse.emf.edapt.internal.migration.execution.ValidationLevel;
import org.eclipse.emf.edapt.migration.MigrationException;
import org.eclipse.emf.edapt.migration.execution.Migrator;
import org.eclipse.emf.edapt.migration.execution.ValidationLevel;
import org.eclipse.emf.edapt.spi.history.Release;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.swt.graphics.Image;
......
......@@ -37,13 +37,13 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.command.BasicCommandStack;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.edapt.history.Release;
import org.eclipse.emf.edapt.internal.migration.execution.BundleClassLoader;
import org.eclipse.emf.edapt.internal.migration.execution.ValidationLevel;
import org.eclipse.emf.edapt.migration.MigrationException;
import org.eclipse.emf.edapt.migration.ReleaseUtils;
import org.eclipse.emf.edapt.migration.execution.BundleClassLoader;
import org.eclipse.emf.edapt.migration.execution.Migrator;
import org.eclipse.emf.edapt.migration.execution.MigratorRegistry;
import org.eclipse.emf.edapt.migration.execution.ValidationLevel;
import org.eclipse.emf.edapt.spi.history.Release;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
......
......@@ -43,10 +43,10 @@ import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
import org.eclipse.emf.edapt.history.Release;
import org.eclipse.emf.edapt.internal.migration.execution.ValidationLevel;
import org.eclipse.emf.edapt.migration.MigrationException;
import org.eclipse.emf.edapt.migration.execution.Migrator;
import org.eclipse.emf.edapt.migration.execution.ValidationLevel;
import org.eclipse.emf.edapt.spi.history.Release;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.osgi.framework.Bundle;
......
......@@ -44,10 +44,10 @@ import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl;
import org.eclipse.emf.edapt.history.Release;
import org.eclipse.emf.edapt.internal.migration.execution.ValidationLevel;
import org.eclipse.emf.edapt.migration.MigrationException;
import org.eclipse.emf.edapt.migration.execution.Migrator;
import org.eclipse.emf.edapt.migration.execution.ValidationLevel;
import org.eclipse.emf.edapt.spi.history.Release;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
/**
......
......@@ -53,9 +53,9 @@ import org.eclipse.emf.ecore.xmi.XMIResource;
import org.eclipse.emf.ecore.xmi.XMLOptions;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.ecore.xmi.impl.XMLOptionsImpl;
import org.eclipse.emf.edapt.history.Release;
import org.eclipse.emf.edapt.migration.MigrationException;
import org.eclipse.emf.edapt.migration.execution.Migrator;
import org.eclipse.emf.edapt.spi.history.Release;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.swt.graphics.Image;
......
......@@ -63,9 +63,9 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.xmi.FeatureNotFoundException;
import org.eclipse.emf.edapt.history.Release;
import org.eclipse.emf.edapt.migration.MigrationException;
import org.eclipse.emf.edapt.migration.execution.Migrator;
import org.eclipse.emf.edapt.spi.history.Release;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
......
......@@ -48,9 +48,9 @@ import org.eclipse.emf.ecore.xmi.XMIResource;
import org.eclipse.emf.ecore.xmi.XMLOptions;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.ecore.xmi.impl.XMLOptionsImpl;
import org.eclipse.emf.edapt.history.Release;
import org.eclipse.emf.edapt.migration.MigrationException;
import org.eclipse.emf.edapt.migration.execution.Migrator;
import org.eclipse.emf.edapt.spi.history.Release;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.swt.graphics.Image;
......
......@@ -71,12 +71,12 @@ import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.xmi.impl.XMLResourceFactoryImpl;
import org.eclipse.emf.edapt.history.Release;
import org.eclipse.emf.edapt.internal.migration.execution.BundleClassLoader;
import org.eclipse.emf.edapt.internal.migration.execution.ValidationLevel;
import org.eclipse.emf.edapt.migration.MigrationException;
import org.eclipse.emf.edapt.migration.ReleaseUtils;
import org.eclipse.emf.edapt.migration.execution.BundleClassLoader;
import org.eclipse.emf.edapt.migration.execution.Migrator;
import org.eclipse.emf.edapt.migration.execution.ValidationLevel;
import org.eclipse.emf.edapt.spi.history.Release;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.emf.workspace.AbstractEMFOperation;
import org.eclipse.gmf.runtime.emf.core.GMFEditingDomainFactory;
......
......@@ -11,7 +11,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.bonitasoft.studio.common;bundle-version="1.0.0",
org.eclipse.emf.edapt.migration;bundle-version="0.3.0",
org.eclipse.ui,
org.eclipse.emf.edapt.history;bundle-version="0.3.0",
org.eclipse.emf.edapt.history;bundle-version="1.0.0",
org.eclipse.emf.transaction,
org.eclipse.gmf.runtime.emf.core,
org.eclipse.gmf.runtime.diagram.ui,
......@@ -24,7 +24,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.junit;bundle-version="4.11.0";resolution:=optional,
org.mockito;bundle-version="1.9.5";resolution:=optional,
org.bonitasoft.studio.tests-utils;bundle-version="6.4.0";resolution:=optional,
assertj-core;bundle-version="1.5.0"
assertj-core;bundle-version="1.5.0";resolution:=optional
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: org.bonitasoft.studio.migration,org.bonitasoft.studio.
......
......@@ -40,13 +40,14 @@ import org.eclipse.emf.edapt.common.MetamodelUtils;
import org.eclipse.emf.edapt.common.ResourceUtils;
import org.eclipse.emf.edapt.declaration.LibraryImplementation;
import org.eclipse.emf.edapt.declaration.OperationImplementation;
import org.eclipse.emf.edapt.declaration.OperationRegistry;
import org.eclipse.emf.edapt.history.Delete;
import org.eclipse.emf.edapt.history.History;
import org.eclipse.emf.edapt.history.HistoryPackage;
import org.eclipse.emf.edapt.history.Release;
import org.eclipse.emf.edapt.history.reconstruction.EcoreForwardReconstructor;
import org.eclipse.emf.edapt.history.util.HistoryUtils;
import org.eclipse.emf.edapt.internal.declaration.OperationRegistry;
import org.eclipse.emf.edapt.internal.migration.execution.ClassLoaderFacade;
import org.eclipse.emf.edapt.internal.migration.execution.IClassLoader;
import org.eclipse.emf.edapt.internal.migration.execution.MigratorCommandLine;
import org.eclipse.emf.edapt.internal.migration.execution.ValidationLevel;
import org.eclipse.emf.edapt.internal.migration.execution.WrappedMigrationException;
import org.eclipse.emf.edapt.migration.BackupUtils;
import org.eclipse.emf.edapt.migration.CustomMigration;
import org.eclipse.emf.edapt.migration.MaterializingBackwardConverter;
......@@ -56,12 +57,11 @@ import org.eclipse.emf.edapt.migration.Model;
import org.eclipse.emf.edapt.migration.Persistency;
import org.eclipse.emf.edapt.migration.PrintStreamProgressMonitor;
import org.eclipse.emf.edapt.migration.ReleaseUtils;
import org.eclipse.emf.edapt.migration.execution.ClassLoaderFacade;
import org.eclipse.emf.edapt.migration.execution.IClassLoader;
import org.eclipse.emf.edapt.migration.execution.Migrator;
import org.eclipse.emf.edapt.migration.execution.MigratorCommandLine;
import org.eclipse.emf.edapt.migration.execution.ValidationLevel;
import org.eclipse.emf.edapt.migration.execution.WrappedMigrationException;
import org.eclipse.emf.edapt.spi.history.Delete;
import org.eclipse.emf.edapt.spi.history.History;
import org.eclipse.emf.edapt.spi.history.HistoryPackage;
import org.eclipse.emf.edapt.spi.history.Release;
/**
* @author Romain Bioteau
......@@ -92,14 +92,14 @@ public class BOSMigrator {
} catch (final IOException e) {
throw new MigrationException("History could not be loaded", e);
}
this.classLoader = classLoader;
classLoader = classLoader;
init();
}
/** Constructor. */
public BOSMigrator(final History history, final IClassLoader classLoader) {
this.history = history;
this.classLoader = classLoader;
history = history;
classLoader = classLoader;
init();
}
......@@ -135,8 +135,8 @@ public class BOSMigrator {
final Map<EPackage, String> packageMap) {
for (final Iterator<EObject> i = release.eAllContents(); i.hasNext();) {
final EObject element = i.next();
if (element instanceof org.eclipse.emf.edapt.history.Set) {
final org.eclipse.emf.edapt.history.Set set = (org.eclipse.emf.edapt.history.Set) element;
if (element instanceof org.eclipse.emf.edapt.spi.history.Set) {
final org.eclipse.emf.edapt.spi.history.Set set = (org.eclipse.emf.edapt.spi.history.Set) element;
if (set.getFeature() == EcorePackage.eINSTANCE
.getEPackage_NsURI()) {
final EPackage ePackage = (EPackage) set.getElement();
......@@ -316,7 +316,7 @@ public class BOSMigrator {
/** Set the validation level. */
public void setLevel(final ValidationLevel level) {
this.level = level;
level = level;
}
/** Main method to perform migrations. */
......
......@@ -22,12 +22,12 @@ import org.bonitasoft.studio.migration.model.report.MigrationReportFactory;
import org.bonitasoft.studio.migration.model.report.Report;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.edapt.history.Change;
import org.eclipse.emf.edapt.history.MigrationChange;
import org.eclipse.emf.edapt.history.Release;
import org.eclipse.emf.edapt.internal.migration.execution.IClassLoader;
import org.eclipse.emf.edapt.internal.migration.execution.ValidationLevel;
import org.eclipse.emf.edapt.migration.MigrationException;
import org.eclipse.emf.edapt.migration.execution.IClassLoader;
import org.eclipse.emf.edapt.migration.execution.ValidationLevel;
import org.eclipse.emf.edapt.spi.history.Change;
import org.eclipse.emf.edapt.spi.history.MigrationChange;
import org.eclipse.emf.edapt.spi.history.Release;
/**
* @author Romain Bioteau
......@@ -35,17 +35,17 @@ import org.eclipse.emf.edapt.migration.execution.ValidationLevel;
*/
public class BOSReportReconstructor extends MigrationReconstructor {
private Report report;
private final Report report;
public BOSReportReconstructor(List<URI> modelURIs, Release sourceRelease,
Release targetRelease, IProgressMonitor monitor,
IClassLoader classLoader, ValidationLevel level) {
public BOSReportReconstructor(final List<URI> modelURIs, final Release sourceRelease,
final Release targetRelease, final IProgressMonitor monitor,
final IClassLoader classLoader, final ValidationLevel level) {
super(modelURIs, sourceRelease, targetRelease, monitor, classLoader, level);
this.report = MigrationReportFactory.eINSTANCE.createReport();
report = MigrationReportFactory.eINSTANCE.createReport();
}
@Override
public void endChange(Change change) {
public void endChange(final Change change) {
if (isEnabled()) {
checkResume(change);
if (isStarted()) {
......@@ -59,7 +59,7 @@ public class BOSReportReconstructor extends MigrationReconstructor {
}
monitor.worked(1);
checkConformanceIfMoreThan(ValidationLevel.CUSTOM_MIGRATION);
} catch (MigrationException e) {
} catch (final MigrationException e) {
throwWrappedMigrationException(e);
} finally {
customMigration = null;
......@@ -75,6 +75,6 @@ public class BOSReportReconstructor extends MigrationReconstructor {
public Report getReport() {
return report;
}
}
......@@ -16,6 +16,7 @@ import java.io.IOException;
import java.util.Collection;
import java.util.List;
import org.bonitasoft.studio.migration.migrator.MigrationReconstructor.MigrationReconstructorSwitch;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
......@@ -29,22 +30,15 @@ import org.eclipse.emf.edapt.common.MetamodelExtent;
import org.eclipse.emf.edapt.common.MetamodelUtils;
import org.eclipse.emf.edapt.common.ResourceUtils;
import org.eclipse.emf.edapt.declaration.OperationImplementation;
import org.eclipse.emf.edapt.history.Add;
import org.eclipse.emf.edapt.history.Change;
import org.eclipse.emf.edapt.history.Create;
import org.eclipse.emf.edapt.history.Delete;
import org.eclipse.emf.edapt.history.MigrationChange;
import org.eclipse.emf.edapt.history.Move;
import org.eclipse.emf.edapt.history.OperationChange;
import org.eclipse.emf.edapt.history.OperationInstance;
import org.eclipse.emf.edapt.history.Release;
import org.eclipse.emf.edapt.history.Remove;
import org.eclipse.emf.edapt.history.Set;
import org.eclipse.emf.edapt.history.reconstruction.EcoreReconstructorSwitchBase;
import org.eclipse.emf.edapt.history.reconstruction.FinishedException;
import org.eclipse.emf.edapt.history.reconstruction.Mapping;
import org.eclipse.emf.edapt.history.reconstruction.ReconstructorBase;
import org.eclipse.emf.edapt.history.reconstruction.ResolverBase;
import org.eclipse.emf.edapt.internal.migration.execution.IClassLoader;
import org.eclipse.emf.edapt.internal.migration.execution.OperationInstanceConverter;
import org.eclipse.emf.edapt.internal.migration.execution.ValidationLevel;
import org.eclipse.emf.edapt.internal.migration.execution.WrappedMigrationException;
import org.eclipse.emf.edapt.migration.CustomMigration;
import org.eclipse.emf.edapt.migration.Metamodel;
import org.eclipse.emf.edapt.migration.MigrationException;
......@@ -52,15 +46,22 @@ import org.eclipse.emf.edapt.migration.MigrationFactory;
import org.eclipse.emf.edapt.migration.Model;
import org.eclipse.emf.edapt.migration.Persistency;
import org.eclipse.emf.edapt.migration.Repository;
import org.eclipse.emf.edapt.migration.execution.IClassLoader;
import org.eclipse.emf.edapt.migration.execution.OperationInstanceConverter;
import org.eclipse.emf.edapt.migration.execution.ValidationLevel;
import org.eclipse.emf.edapt.migration.execution.WrappedMigrationException;
import org.eclipse.emf.edapt.spi.history.Add;
import org.eclipse.emf.edapt.spi.history.Change;
import org.eclipse.emf.edapt.spi.history.Create;
import org.eclipse.emf.edapt.spi.history.Delete;
import org.eclipse.emf.edapt.spi.history.MigrationChange;
import org.eclipse.emf.edapt.spi.history.Move;
import org.eclipse.emf.edapt.spi.history.OperationChange;
import org.eclipse.emf.edapt.spi.history.OperationInstance;
import org.eclipse.emf.edapt.spi.history.Release;
import org.eclipse.emf.edapt.spi.history.Remove;
import org.eclipse.emf.edapt.spi.history.Set;
/**
* A reconstructor that perform the migration of models from a source release to
* a target release.
*
*
* @author herrmama
* @author $Author: mherrmannsd $
* @version $Rev: 306 $
......@@ -114,20 +115,20 @@ public class MigrationReconstructor extends ReconstructorBase {
public MigrationReconstructor(List<URI> modelURIs, Release sourceRelease,
Release targetRelease, IProgressMonitor monitor,
IClassLoader classLoader, ValidationLevel level) {
this.modelURIs = modelURIs;
this.sourceRelease = sourceRelease;
this.targetRelease = targetRelease;
this.monitor = monitor;
this.classLoader = classLoader;
this.level = level;
modelURIs = modelURIs;
sourceRelease = sourceRelease;
targetRelease = targetRelease;
monitor = monitor;
classLoader = classLoader;
level = level;
}
/** {@inheritDoc} */
@Override
public void init(Mapping mapping, MetamodelExtent extent) {
migrationSwitch = new MigrationReconstructorSwitch();
this.extent = extent;
this.mapping = mapping;
extent = extent;
mapping = mapping;
}
/** {@inheritDoc} */
......@@ -159,7 +160,7 @@ public class MigrationReconstructor extends ReconstructorBase {
* level is greater or equal to a certain level.
*/
protected void checkConformanceIfMoreThan(ValidationLevel level) {
if (this.level.compareTo(level) >= 0) {
if (level.compareTo(level) >= 0) {
checkConformance();
}
}
......@@ -427,8 +428,8 @@ public class MigrationReconstructor extends ReconstructorBase {
OperationInstance operationInstance = (OperationInstance) resolver
.copyResolve(change.getOperation(), true);
OperationImplementation operation = OperationInstanceConverter
.convert(operationInstance, repository.getMetamodel());
final Metamodel metamodel = repository.getMetamodel();
OperationImplementation operation = OperationInstanceConverter.convert(operationInstance, metamodel);
if (operation == null) {
throwWrappedMigrationException("Operation could not be found: "
+ operationInstance.getName(), null);
......
......@@ -21,9 +21,9 @@ import static org.assertj.core.api.Assertions.assertThat;
import org.bonitasoft.studio.common.ModelVersion;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.edapt.common.ResourceUtils;
import org.eclipse.emf.edapt.history.History;
import org.eclipse.emf.edapt.history.HistoryPackage;
import org.eclipse.emf.edapt.history.Release;
import org.eclipse.emf.edapt.spi.history.History;
import org.eclipse.emf.edapt.spi.history.HistoryPackage;
import org.eclipse.emf.edapt.spi.history.Release;
import org.junit.Before;
import org.junit.Test;
......
......@@ -32,12 +32,8 @@ import org.bonitasoft.studio.diagram.custom.repository.DiagramFileStore;
import org.bonitasoft.studio.diagram.custom.repository.DiagramRepositoryStore;
import org.bonitasoft.studio.exporter.handler.ExportBosArchiveHandler;
import org.bonitasoft.studio.model.process.MainProcess;
import org.bonitasoft.studio.model.process.assertions.ElementAssert;
import org.bonitasoft.studio.preferences.BonitaPreferenceConstants;
import org.bonitasoft.studio.preferences.BonitaStudioPreferencesPlugin;
import org.bonitasoft.studio.swtbot.framework.application.BotApplicationWorkbenchWindow;
import org.bonitasoft.studio.swtbot.framework.diagram.BotProcessDiagramPerspective;
import org.bonitasoft.studio.swtbot.framework.draw.BotGefProcessDiagramEditor;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.emf.ecore.EObject;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment