Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make trace accessible at runtime in the trace addon + improve EMFCompareUtil #29

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<viewpoint:DAnalysis xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style" xmi:id="_lI8gAHWaEeapWYgy_5FVBA" selectedViews="_lo2IEHWaEeapWYgy_5FVBA _lpHN0HWaEeapWYgy_5FVBA _lpQXwHWaEeapWYgy_5FVBA _lphdgHWaEeapWYgy_5FVBA" version="10.1.0.201509162000">
<semanticResources>GemocExecutionEngineTrace.ecore</semanticResources>
<semanticResources>platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore</semanticResources>
<semanticResources>platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore</semanticResources>
<semanticResources>http://www.eclipse.org/emf/2002/Ecore</semanticResources>
<semanticResources>platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore</semanticResources>
<ownedViews xmi:type="viewpoint:DRepresentationContainer" xmi:id="_lo2IEHWaEeapWYgy_5FVBA">
Expand Down Expand Up @@ -575,8 +575,8 @@
<actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='Bi-directional%20EC_EReference%20']"/>
</ownedDiagramElements>
<ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_2FYzAHWaEeapWYgy_5FVBA" name="MSEOccurrence" tooltipText="" incomingEdges="_2GHy0HWaEeapWYgy_5FVBA" width="12" height="10">
<target xmi:type="ecore:EClass" href="platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore#//MSEOccurrence"/>
<semanticElements xmi:type="ecore:EClass" href="platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore#//MSEOccurrence"/>
<target xmi:type="ecore:EClass" href="platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore#//MSEOccurrence"/>
<semanticElements xmi:type="ecore:EClass" href="platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore#//MSEOccurrence"/>
<decorations xmi:type="viewpoint:Decoration" xmi:id="_2F5wYHWaEeapWYgy_5FVBA">
<description xmi:type="description:SemanticBasedDecoration" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@decorationDescriptionsSet/@decorationDescriptions[name='External']"/>
</decorations>
Expand All @@ -588,25 +588,25 @@
</ownedStyle>
<actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/>
<ownedElements xmi:type="diagram:DNodeListElement" xmi:id="_2FzpwHWaEeapWYgy_5FVBA" name="parameters : EJavaObject" tooltipText="">
<target xmi:type="ecore:EAttribute" href="platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore#//MSEOccurrence/parameters"/>
<semanticElements xmi:type="ecore:EAttribute" href="platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore#//MSEOccurrence/parameters"/>
<target xmi:type="ecore:EAttribute" href="platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore#//MSEOccurrence/parameters"/>
<semanticElements xmi:type="ecore:EAttribute" href="platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore#//MSEOccurrence/parameters"/>
<ownedStyle xmi:type="diagram:BundledImage" xmi:id="_2F034HWaEeapWYgy_5FVBA" labelAlignment="LEFT">
<description xmi:type="style:BundledImageDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']/@style"/>
</ownedStyle>
<actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/>
</ownedElements>
<ownedElements xmi:type="diagram:DNodeListElement" xmi:id="_2F1e8HWaEeapWYgy_5FVBA" name="result : EJavaObject" tooltipText="">
<target xmi:type="ecore:EAttribute" href="platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore#//MSEOccurrence/result"/>
<semanticElements xmi:type="ecore:EAttribute" href="platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore#//MSEOccurrence/result"/>
<target xmi:type="ecore:EAttribute" href="platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore#//MSEOccurrence/result"/>
<semanticElements xmi:type="ecore:EAttribute" href="platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore#//MSEOccurrence/result"/>
<ownedStyle xmi:type="diagram:BundledImage" xmi:id="_2F2GAHWaEeapWYgy_5FVBA" labelAlignment="LEFT">
<description xmi:type="style:BundledImageDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']/@style"/>
</ownedStyle>
<actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/>
</ownedElements>
</ownedDiagramElements>
<ownedDiagramElements xmi:type="diagram:DNodeList" xmi:id="_2FbPQHWaEeapWYgy_5FVBA" name="Step" tooltipText="" outgoingEdges="_2GHy0HWaEeapWYgy_5FVBA" incomingEdges="_2GBsMHWaEeapWYgy_5FVBA _2GC6UHWaEeapWYgy_5FVBA" width="12" height="10">
<target xmi:type="ecore:EClass" href="platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore#//Step"/>
<semanticElements xmi:type="ecore:EClass" href="platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore#//Step"/>
<target xmi:type="ecore:EClass" href="platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore#//Step"/>
<semanticElements xmi:type="ecore:EClass" href="platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore#//Step"/>
<decorations xmi:type="viewpoint:Decoration" xmi:id="_2F5wYXWaEeapWYgy_5FVBA">
<description xmi:type="description:SemanticBasedDecoration" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@decorationDescriptionsSet/@decorationDescriptions[name='External']"/>
</decorations>
Expand Down Expand Up @@ -647,8 +647,8 @@
<actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
</ownedDiagramElements>
<ownedDiagramElements xmi:type="diagram:DEdge" xmi:id="_2GHy0HWaEeapWYgy_5FVBA" name="[0..1] mseoccurrence" sourceNode="_2FbPQHWaEeapWYgy_5FVBA" targetNode="_2FYzAHWaEeapWYgy_5FVBA">
<target xmi:type="ecore:EReference" href="platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore#//Step/mseoccurrence"/>
<semanticElements xmi:type="ecore:EReference" href="platform:/resource/fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore#//Step/mseoccurrence"/>
<target xmi:type="ecore:EReference" href="platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore#//Step/mseoccurrence"/>
<semanticElements xmi:type="ecore:EReference" href="platform:/resource/org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore#//Step/mseoccurrence"/>
<ownedStyle xmi:type="diagram:EdgeStyle" xmi:id="_2GMrUHWaEeapWYgy_5FVBA" description="_nw6AwHWaEeapWYgy_5FVBA" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0">
<centerLabelStyle xmi:type="diagram:CenterLabelStyle" xmi:id="_2GMrUXWaEeapWYgy_5FVBA" showIcon="false">
<customFeatures>labelSize</customFeatures>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="nextChoices" upperBound="-1"
eType="#//Choice" eOpposite="#//Choice/previousChoice"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="possibleLogicalSteps" upperBound="-1"
eType="ecore:EClass ../../fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore#//Step"
eType="ecore:EClass ../../org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore#//Step"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="chosenLogicalStep" eType="ecore:EClass ../../fr.inria.diverse.trace.commons.model/model/GenericTrace.ecore#//Step"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="chosenLogicalStep" eType="ecore:EClass ../../org.eclipse.gemoc.trace.commons.model/model/GenericTrace.ecore#//Step"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="contextState" eType="#//ContextState"
containment="true" eOpposite="#//ContextState/choice"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="previousChoice" eType="#//Choice"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.gemoc.executionframework.reflectivetrace.model/src"
modelPluginID="org.gemoc.executionframework.reflectivetrace.model" modelName="GemocExecutionEngineTrace"
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"
complianceLevel="8.0" copyrightFields="false" usedGenPackages="../../org.eclipse.emf.ecore/model/Ecore.genmodel#//ecore ../../org.eclipse.gemoc.trace.commons.model/model/GenericTrace.genmodel#//trace"
operationReflection="true" importOrganizing="true">
<foreignModel>GemocExecutionEngineTrace.ecore</foreignModel>
<genPackages prefix="Gemoc_execution_trace" basePackage="org.gemoc.executionframework.reflectivetrace"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/fr.inria.diverse.trace.commons.model/src" modelPluginID="fr.inria.diverse.trace.commons.model"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.gemoc.trace.commons.model/src" modelPluginID="org.eclipse.gemoc.trace.commons.model"
modelName="GenericTrace" 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 LaunchConfiguration.genmodel#//launchconfiguration"
operationReflection="true" importOrganizing="true">
<foreignModel>GenericTrace.ecore</foreignModel>
<genPackages prefix="Trace" basePackage="fr.inria.diverse.trace.commons.model" disposableProviderFactory="true"
<genPackages prefix="Trace" basePackage="org.eclipse.gemoc.trace.commons.model" disposableProviderFactory="true"
ecorePackage="GenericTrace.ecore#/">
<genDataTypes ecoreDataType="GenericTrace.ecore#//ISerializable"/>
<genClasses ecoreClass="GenericTrace.ecore#//MSEOccurrence">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/fr.inria.diverse.trace.commons.model/src" modelPluginID="fr.inria.diverse.trace.commons.model"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.gemoc.trace.commons.model/src" modelPluginID="org.eclipse.gemoc.trace.commons.model"
modelName="GenericTraceImpl" 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 GenericTrace.genmodel#//trace LaunchConfiguration.genmodel#//launchconfiguration"
operationReflection="true" importOrganizing="true">
<foreignModel>GenericTraceImpl.ecore</foreignModel>
<genPackages prefix="Generictrace" basePackage="fr.inria.diverse.trace.commons.model"
<genPackages prefix="Generictrace" basePackage="org.eclipse.gemoc.trace.commons.model"
disposableProviderFactory="true" ecorePackage="GenericTraceImpl.ecore#/">
<genDataTypes ecoreDataType="GenericTraceImpl.ecore#//ISerializable"/>
<genClasses ecoreClass="GenericTraceImpl.ecore#//GenericSequentialStep"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/fr.inria.diverse.trace.commons.model/src" modelPluginID="fr.inria.diverse.trace.commons.model"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.gemoc.trace.commons.model/src" modelPluginID="org.eclipse.gemoc.trace.commons.model"
modelName="LaunchConfiguration" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" copyrightFields="false"
operationReflection="true" importOrganizing="true">
<foreignModel>LaunchConfiguration.ecore</foreignModel>
<genPackages prefix="Launchconfiguration" basePackage="fr.inria.diverse.trace.commons.model"
<genPackages prefix="Launchconfiguration" basePackage="org.eclipse.gemoc.trace.commons.model"
disposableProviderFactory="true" ecorePackage="LaunchConfiguration.ecore#/">
<genDataTypes ecoreDataType="LaunchConfiguration.ecore#//ISerializable"/>
<genClasses ecoreClass="LaunchConfiguration.ecore#//LaunchConfiguration">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
*******************************************************************************/
Expand All @@ -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<Diff> 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<Diff> differences = comparison.getDifferences();
return comparison.differences

}

public def static void assertEqualsEMF(String message, EObject rootCurrent, EObject rootExpected) {
val List<Diff> 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);
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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<StepSubType extends Step<?>, StateSubType extends State<?,?>, TracedObjectSubType extends TracedObject<?>, DimensionSubType extends Dimension<?>, ValueSubType extends Value<?>> extends IEngineAddon {

Expand All @@ -35,4 +35,6 @@ public interface IMultiDimensionalTraceAddon<StepSubType extends Step<?>, StateS
void load(Resource traceResource);

boolean isAddonForTrace(EObject traceRoot);

Trace<?,?,?> getTrace();
}
Loading