diff --git a/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.aird b/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.aird index 8ff0c774d..40338cfa6 100644 --- a/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.aird +++ b/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.aird @@ -1,7 +1,7 @@ GemocExecutionEngineTrace.ecore - platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore + platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore http://www.eclipse.org/emf/2002/Ecore platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore @@ -575,8 +575,8 @@ - - + + @@ -588,16 +588,16 @@ - - + + - - + + @@ -605,8 +605,8 @@ - - + + @@ -647,8 +647,8 @@ - - + + labelSize diff --git a/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.ecore b/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.ecore index 1e4ddcc54..618a3c0cd 100644 --- a/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.ecore +++ b/framework/framework_commons/plugins/org.eclipse.gemoc.executionframework.reflectivetrace.model/model/GemocExecutionEngineTrace.ecore @@ -6,9 +6,9 @@ - + GemocExecutionEngineTrace.ecore - + diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel index 42c7c957b..c0e605f5b 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel @@ -1,12 +1,12 @@ GenericTrace.ecore - diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTraceImpl.genmodel b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTraceImpl.genmodel index 0872efdde..e07d2f170 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTraceImpl.genmodel +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/GenericTraceImpl.genmodel @@ -1,12 +1,12 @@ GenericTraceImpl.ecore - diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.genmodel b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.genmodel index d05c54c03..129920f1e 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.genmodel +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.genmodel @@ -1,11 +1,11 @@ LaunchConfiguration.ecore - diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.commons/src/org/eclipse/gemoc/trace/commons/EMFCompareUtil.xtend b/trace/commons/plugins/org.eclipse.gemoc.trace.commons/src/org/eclipse/gemoc/trace/commons/EMFCompareUtil.xtend index 9ddb86b00..68b1bfd8f 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.commons/src/org/eclipse/gemoc/trace/commons/EMFCompareUtil.xtend +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.commons/src/org/eclipse/gemoc/trace/commons/EMFCompareUtil.xtend @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Inria - initial API and implementation *******************************************************************************/ @@ -22,22 +22,27 @@ import static org.junit.Assert.* class EMFCompareUtil { - public def static void assertEqualsEMF(String message, EObject rootCurrent, EObject rootExpected) { - val DefaultComparisonScope _defaultComparisonScope = new DefaultComparisonScope(rootCurrent, rootExpected, null); + public def static List compare(EObject rootCurrent, EObject rootExpected) { + val DefaultComparisonScope _defaultComparisonScope = new DefaultComparisonScope(rootCurrent, rootExpected, + null); val IComparisonScope scope = _defaultComparisonScope; val _builder = EMFCompare.builder(); val EMFCompare _build = _builder.build(); val Comparison comparison = _build.compare(scope); - val List differences = comparison.getDifferences(); + return comparison.differences + + } + + public def static void assertEqualsEMF(String message, EObject rootCurrent, EObject rootExpected) { + val List differences = compare(rootCurrent, rootExpected); for (d : differences) { val String _string = d.toString(); val String _plus = ("Checking:[" + _string); val String _plus_1 = (_plus + "]"); val DifferenceKind _kind = d.getKind(); println(_plus_1) - assertEquals(message+" - "+_plus_1, DifferenceKind.MOVE, _kind); + assertEquals(message + " - " + _plus_1, DifferenceKind.MOVE, _kind); } - } } diff --git a/trace/commons/plugins/org.eclipse.gemoc.trace.gemoc.api/src/org/eclipse/gemoc/trace/gemoc/api/IMultiDimensionalTraceAddon.java b/trace/commons/plugins/org.eclipse.gemoc.trace.gemoc.api/src/org/eclipse/gemoc/trace/gemoc/api/IMultiDimensionalTraceAddon.java index f57c905a1..1e8b97b17 100644 --- a/trace/commons/plugins/org.eclipse.gemoc.trace.gemoc.api/src/org/eclipse/gemoc/trace/gemoc/api/IMultiDimensionalTraceAddon.java +++ b/trace/commons/plugins/org.eclipse.gemoc.trace.gemoc.api/src/org/eclipse/gemoc/trace/gemoc/api/IMultiDimensionalTraceAddon.java @@ -12,13 +12,13 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; - import org.eclipse.gemoc.trace.commons.model.trace.Dimension; import org.eclipse.gemoc.trace.commons.model.trace.State; import org.eclipse.gemoc.trace.commons.model.trace.Step; +import org.eclipse.gemoc.trace.commons.model.trace.Trace; import org.eclipse.gemoc.trace.commons.model.trace.TracedObject; import org.eclipse.gemoc.trace.commons.model.trace.Value; +import org.eclipse.gemoc.xdsmlframework.api.engine_addon.IEngineAddon; public interface IMultiDimensionalTraceAddon, StateSubType extends State, TracedObjectSubType extends TracedObject, DimensionSubType extends Dimension, ValueSubType extends Value> extends IEngineAddon { @@ -35,4 +35,6 @@ public interface IMultiDimensionalTraceAddon, StateS void load(Resource traceResource); boolean isAddonForTrace(EObject traceRoot); + + Trace getTrace(); } diff --git a/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc/src/org/eclipse/gemoc/trace/gemoc/traceaddon/AbstractTraceAddon.xtend b/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc/src/org/eclipse/gemoc/trace/gemoc/traceaddon/AbstractTraceAddon.xtend index 978c44d8f..9f77868d3 100644 --- a/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc/src/org/eclipse/gemoc/trace/gemoc/traceaddon/AbstractTraceAddon.xtend +++ b/trace/generator/plugins/org.eclipse.gemoc.trace.gemoc/src/org/eclipse/gemoc/trace/gemoc/traceaddon/AbstractTraceAddon.xtend @@ -4,7 +4,7 @@ * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * Inria - initial API and implementation *******************************************************************************/ @@ -46,21 +46,23 @@ import org.eclipse.gemoc.xdsmlframework.api.engine_addon.IEngineAddon import org.eclipse.gemoc.xdsmlframework.api.engine_addon.modelchangelistener.BatchModelChangeListener import org.eclipse.gemoc.xdsmlframework.api.extensions.engine_addon.EngineAddonSpecificationExtensionPoint -abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDimensionalTraceAddon, State, TracedObject, Dimension, Value> { +abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDimensionalTraceAddon, State, TracedObject, Dimension, Value> { private IExecutionContext _executionContext - private ITraceExplorer, State, TracedObject, Dimension, Value> traceExplorer - private ITraceExtractor, State, TracedObject, Dimension, Value> traceExtractor + private ITraceExplorer, State, TracedObject, Dimension, Value> traceExplorer + private ITraceExtractor, State, TracedObject, Dimension, Value> traceExtractor private ITraceConstructor traceConstructor private ITraceNotifier traceNotifier private BatchModelChangeListener traceListener - private boolean shouldSave = true private var boolean needTransaction = true private BatchModelChangeListener listenerAddon - - protected abstract def ITraceConstructor constructTraceConstructor(Resource modelResource, Resource traceResource, Map> exeToTraced) - - protected abstract def IStateManager> constructStateManager(Resource modelResource, Map, EObject> tracedToExe) + private Trace, TracedObject, State> trace + + protected abstract def ITraceConstructor constructTraceConstructor(Resource modelResource, Resource traceResource, + Map> exeToTraced) + + protected abstract def IStateManager> constructStateManager(Resource modelResource, + Map, EObject> tracedToExe) override getTraceExplorer() { return traceExplorer @@ -73,15 +75,15 @@ abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDi override getTraceExtractor() { return traceExtractor } - + override getTraceNotifier() { return traceNotifier } - + public override void load(Resource traceResource) { val root = traceResource.contents.head - if (root instanceof Trace) { - val trace = root as Trace,TracedObject,State> + if (root instanceof Trace) { + trace = root as Trace, TracedObject, State> traceExplorer = new GenericTraceExplorer(trace) traceExtractor = new GenericTraceExtractor(trace) } else { @@ -111,13 +113,13 @@ abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDi if (step != null) { modifyTrace([ traceConstructor.addState(listenerAddon.getChanges(this)) - + if (add) { traceConstructor.addStep(step) } else { traceConstructor.endStep(step) } - + // Updating the trace extractor and explorer with the last changes traceNotifier.notifyListener(traceExtractor) traceNotifier.notifyListener(traceExplorer) @@ -127,9 +129,10 @@ abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDi traceExplorer.updateCallStack(step) ]) - if (shouldSave) { -// traceConstructor.save() - } + /*try { + traceConstructor.save() + } catch (Throwable t) { + }*/ } } @@ -155,7 +158,8 @@ abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDi val Resource traceResource = rs.createResource(traceModelURI) // We construct a new listener addon if required - this.listenerAddon = new BatchModelChangeListener(EMFResource.getRelatedResources(engine.executionContext.resourceModel)) + this.listenerAddon = new BatchModelChangeListener( + EMFResource.getRelatedResources(engine.executionContext.resourceModel)) listenerAddon.registerObserver(this) val launchConfiguration = engine.extractLaunchConfiguration @@ -170,8 +174,8 @@ abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDi // And we enable trace exploration by loading it in a new trace explorer val root = traceResource.contents.head - if (root instanceof Trace) { - val trace = root as Trace,TracedObject,State> + if (root instanceof Trace) { + trace = root as Trace, TracedObject, State> val stateManager = constructStateManager(modelResource, exeToTraced.inverse) traceExplorer = new GenericTraceExplorer(trace, stateManager) traceExtractor = new GenericTraceExtractor(trace) @@ -235,4 +239,11 @@ abstract class AbstractTraceAddon extends DefaultEngineAddon implements IMultiDi return errors } + override getTrace() { + return trace + } + + override engineStopped(IExecutionEngine engine) { + } + } diff --git a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.aird b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.aird index 7e151f9c2..18625232f 100644 --- a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.aird +++ b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.aird @@ -2,10 +2,10 @@ base.ecore - platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore + platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore http://www.eclipse.org/emf/2002/Ecore - platform:/resource/fr.inria.diverse.trace.commons.model/model/LaunchConfiguration.ecore + platform:/resource/org.eclipse.gemoc.trace.commons.model/model/LaunchConfiguration.ecore @@ -799,14 +799,14 @@ - - + + - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -816,8 +816,8 @@ - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -827,8 +827,8 @@ - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -846,8 +846,8 @@ - - + + bold @@ -855,8 +855,8 @@ - - + + labelSize @@ -869,8 +869,8 @@ - - + + @@ -878,8 +878,8 @@ - - + + labelSize @@ -907,14 +907,14 @@ - - + + - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -932,8 +932,8 @@ - - + + @@ -941,8 +941,8 @@ - - + + @@ -967,14 +967,14 @@ - - + + - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -993,8 +993,8 @@ - - + + labelSize @@ -1023,14 +1023,14 @@ - - + + - - + + @@ -1046,14 +1046,14 @@ - - + + - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -1063,8 +1063,8 @@ - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -1163,14 +1163,14 @@ - - + + - - + + KEEP_LOCATION KEEP_SIZE KEEP_RATIO @@ -1188,8 +1188,8 @@ - - + + @@ -1242,8 +1242,8 @@ - - + + italic @@ -1282,9 +1282,9 @@ - - - + + + routingStyle @@ -1294,9 +1294,9 @@ - - - + + + @@ -1305,9 +1305,9 @@ - - - + + + diff --git a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.ecore b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.ecore index c09a76ff7..2cf771b85 100644 --- a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.ecore +++ b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.ecore @@ -2,8 +2,8 @@ - - + + @@ -25,17 +25,17 @@ - + - + - + @@ -44,7 +44,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -67,7 +67,7 @@ - + @@ -76,7 +76,7 @@ - + diff --git a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.genmodel b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.genmodel index 6092c9546..cfcc145cb 100644 --- a/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.genmodel +++ b/trace/generator/plugins/org.eclipse.gemoc.trace.metamodel.generator/model/base.genmodel @@ -3,7 +3,7 @@ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/fr.inria.diverse.trace.metamodel.generator/src" modelPluginID="fr.inria.diverse.trace.metamodel.generator" modelName="Base" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" copyrightFields="false" - usedGenPackages="../../org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore ../../fr.inria.diverse.trace.commons.model/model/GenericTrace.genmodel#//trace" + usedGenPackages="../../org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore ../../org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel#//trace" operationReflection="true" importOrganizing="true"> base.ecore