Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-05-05 07:19:02 -0400
committerEd Willink2016-05-05 09:32:30 -0400
commite9a59119a22ce40e958081d746756eaa721ef65d (patch)
tree833784907a225f44355432f3bd0f05b7e9b54781
parent78c58796eddfc13366773734ce702dd48b021bac (diff)
downloadorg.eclipse.qvtd-e9a59119a22ce40e958081d746756eaa721ef65d.tar.gz
org.eclipse.qvtd-e9a59119a22ce40e958081d746756eaa721ef65d.tar.xz
org.eclipse.qvtd-e9a59119a22ce40e958081d746756eaa721ef65d.zip
[486722] Rel2Core trace classes work
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/QVTrCompilerTests.java2
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/rel2core/RelToCore.qvtr64
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/rel2core/samples/Rel2Core_expected.oclas73
3 files changed, 121 insertions, 18 deletions
diff --git a/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/QVTrCompilerTests.java b/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/QVTrCompilerTests.java
index cc1b1b675..9b89b018c 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/QVTrCompilerTests.java
+++ b/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/QVTrCompilerTests.java
@@ -395,6 +395,8 @@ public class QVTrCompilerTests extends LoadTestCase
String projectTestName = PROJECT_NAME + ".rel2core";
myQVT.addUsedGenPackage("org.eclipse.ocl.pivot/model/Pivot.genmodel", "//pivot");
myQVT.addUsedGenPackage("org.eclipse.qvtd.pivot.qvtbase/model/QVTbase.genmodel", "//qvtbase");
+ myQVT.addUsedGenPackage("org.eclipse.qvtd.pivot.qvtcore/model/QVTcore.genmodel", "//qvtcore");
+ myQVT.addUsedGenPackage("org.eclipse.qvtd.pivot.qvtcorebase/model/QVTcoreBase.genmodel", "//qvtcorebase");
myQVT.addUsedGenPackage("org.eclipse.qvtd.pivot.qvtrelation/model/QVTrelation.genmodel", "//qvtrelation");
myQVT.addUsedGenPackage("org.eclipse.qvtd.pivot.qvttemplate/model/QVTtemplate.genmodel", "//qvttemplate");
Transformation asTransformation = myQVT.compileTransformation("RelToCore.qvtr", "core", projectTestName, "http://www.eclipse.org/qvtd/xtext/qvtrelation/tests/rel2core/RelToCore");
diff --git a/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/rel2core/RelToCore.qvtr b/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/rel2core/RelToCore.qvtr
index 0df3d3986..4c6fc6e88 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/rel2core/RelToCore.qvtr
+++ b/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/rel2core/RelToCore.qvtr
@@ -26,6 +26,22 @@ transformation org::eclipse::qvtd::xtext::qvtrelation2::tests::rel2core::relToCo
-- The trace class contains a property corresponding to each object node in the
-- pattern of each domain of the relation.
--
+ top relation ModelToTraceModel
+ {
+ modelName:String;
+ modelURI:String;
+ domain relations
+ relationsModel:RelationModel {
+ name = modelName,
+ externalURI = modelURI
+ };
+ enforce domain core
+ traceModel:Model {
+ name = modelName,
+ externalURI = modelURI
+ };
+ }
+
top relation PackageToTracePackage
{
packageName:String;
@@ -39,9 +55,24 @@ transformation org::eclipse::qvtd::xtext::qvtrelation2::tests::rel2core::relToCo
};
}
- top relation NestedPackageToTracePackage
+ top relation PackageToTraceModelOwnership
+ {
+ domain relations
+ relationsParent:RelationModel {
+ ownedPackages = relationsChild:Package {}
+ };
+ enforce domain core
+ traceParent:Model {
+ ownedPackages = traceChild:Package {}
+ };
+ when {
+ ModelToTraceModel(relationsParent, traceParent);
+ PackageToTracePackage(relationsChild, traceChild);
+ }
+ }
+
+ top relation PackageToTracePackageOwnership
{
- packageName:String;
domain relations
relationsParent:Package {
ownedPackages = relationsChild:Package {}
@@ -56,20 +87,31 @@ transformation org::eclipse::qvtd::xtext::qvtrelation2::tests::rel2core::relToCo
}
}
-/* top relation TransformationToTracePackage
+ top relation TransformationToTracePackage
{
domain relations
- rTransformation:Transformation {
- name = transformationName:String{},
- owningPackage = rParent:Package{}
+ rTransformation:RelationalTransformation {
+ name = transformationName:String{}
};
enforce domain core
tracePackage:Package {
- name = 'T'+transformationName,
- owningPackage = traceParent:Package{}
+ name = 'T'+transformationName
+ };
+ }
+
+ top relation TransformationToTracePackageOwnership
+ {
+ domain relations
+ relationsParent:Package {
+ ownedClasses = relationsChild:RelationalTransformation {}
+ };
+ enforce domain core
+ traceParent:Package {
+ ownedPackages = traceChild:Package {}
};
when {
- PackageToTracePackage(rParent, traceParent);
+ PackageToTracePackage(relationsParent, traceParent);
+ TransformationToTracePackage(relationsChild, traceChild);
}
}
@@ -78,7 +120,7 @@ transformation org::eclipse::qvtd::xtext::qvtrelation2::tests::rel2core::relToCo
domain relations
rRelation: Relation {
name = relationName:String{},
- _'transformation' = rParent:Transformation{}
+ _'transformation' = rParent:RelationalTransformation{}
};
enforce domain
core traceClass:Class {
@@ -90,7 +132,7 @@ transformation org::eclipse::qvtd::xtext::qvtrelation2::tests::rel2core::relToCo
}
}
- relation RootVariableToTraceClassProperty
+/* relation RootVariableToTraceClassProperty
{
domain relations
rRelation: Relation {
diff --git a/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/rel2core/samples/Rel2Core_expected.oclas b/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/rel2core/samples/Rel2Core_expected.oclas
index 3acab41ac..d73d5150f 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/rel2core/samples/Rel2Core_expected.oclas
+++ b/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/rel2core/samples/Rel2Core_expected.oclas
@@ -1,14 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pivot="http://www.eclipse.org/ocl/2015/Pivot"
- xsi:schemaLocation="http://www.eclipse.org/ocl/2015/Pivot java://org.eclipse.ocl.pivot.PivotPackage">
- <pivot:Package xmi:id="P.$$" name="$$"/>
- <pivot:Package xmi:id="P.org" name="org">
+<pivot:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pivot="http://www.eclipse.org/ocl/2015/Pivot"
+ xsi:schemaLocation="http://www.eclipse.org/ocl/2015/Pivot java://org.eclipse.ocl.pivot.PivotPackage" externalURI="platform:/resource/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtr2qvtc/qvtrsrc/SimplerRelToCorePivotizedBeautyfied.qvtr"
+ name="SimplerRelToCorePivotizedBeautyfied.qvtr">
+ <ownedPackages xmi:id="P.org" name="org">
<ownedPackages xmi:id="P.org.eclipse" name="eclipse">
<ownedPackages xmi:id="P.org.eclipse.qvtd" name="qvtd">
<ownedPackages xmi:id="P.org.eclipse.qvtd.compiler" name="compiler">
- <ownedPackages xmi:id="P.org.eclipse.qvtd.compiler.qvtr" name="qvtr"/>
+ <ownedPackages xmi:id="P.org.eclipse.qvtd.compiler.qvtr" name="qvtr">
+ <ownedPackages xmi:id="P.org.eclipse.qvtd.compiler.qvtr.TrelToCore" name="TrelToCore">
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TDomainBottomUnSharedVarsToDbVars" name="TDomainBottomUnSharedVarsToDbVars"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TDomainVarsSharedWithWhenToDgVars" name="TDomainVarsSharedWithWhenToDgVars"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TIROppositeDomainsToMappingForEnforcement" name="TIROppositeDomainsToMappingForEnforcement"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TInvokedRelationToMappingForChecking" name="TInvokedRelationToMappingForChecking"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TInvokedRelationToMappingForEnforcement" name="TInvokedRelationToMappingForEnforcement"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainPatternExprToMappingBottomVarAssignment" name="TRDomainPatternExprToMappingBottomVarAssignment"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainPatternExprToMappingDomainAssignment" name="TRDomainPatternExprToMappingDomainAssignment"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainPatternExprToMappingDomainTemplateVarAssignment"
+ name="TRDomainPatternExprToMappingDomainTemplateVarAssignment"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainPatternExprToMappingDomainVarAssignment" name="TRDomainPatternExprToMappingDomainVarAssignment"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainPatternToMDBottomPattern" name="TRDomainPatternToMDBottomPattern"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainPatternToMDBottomPatternComposite" name="TRDomainPatternToMDBottomPatternComposite"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainPatternToMDBottomPatternSimpleNonVarExpr" name="TRDomainPatternToMDBottomPatternSimpleNonVarExpr"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainPatternToMDBottomPatternSimpleSharedVarExpr" name="TRDomainPatternToMDBottomPatternSimpleSharedVarExpr"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainPatternToMDBottomPatternSimpleUnSharedVarExpr"
+ name="TRDomainPatternToMDBottomPatternSimpleUnSharedVarExpr"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainToMBottomPredicateForEnforcement" name="TRDomainToMBottomPredicateForEnforcement"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainToMComposedMappingGuard" name="TRDomainToMComposedMappingGuard"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainToMDBottomForEnforcement" name="TRDomainToMDBottomForEnforcement"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainToMDBottomForEnforcementOfIdentityProp" name="TRDomainToMDBottomForEnforcementOfIdentityProp"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainToMDBottomForEnforcementOfIdentityPropObject"
+ name="TRDomainToMDBottomForEnforcementOfIdentityPropObject"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainToMDBottomForEnforcementOfNonIdentityPropObject"
+ name="TRDomainToMDBottomForEnforcementOfNonIdentityPropObject"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainToMDBottomForEnforcementOfNonIdentityPropPrimitive"
+ name="TRDomainToMDBottomForEnforcementOfNonIdentityPropPrimitive"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainToMDomainForChecking" name="TRDomainToMDomainForChecking"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainVarToMDBottomAssignmnetForEnforcement" name="TRDomainVarToMDBottomAssignmnetForEnforcement"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRDomainVarsToTraceClassProps" name="TRDomainVarsToTraceClassProps"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRExpToMExp" name="TRExpToMExp"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRInvokerToMGuard" name="TRInvokerToMGuard"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRInvokerToMGuardPredicate" name="TRInvokerToMGuardPredicate"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TROppositeDomainVarsToTraceClassProps" name="TROppositeDomainVarsToTraceClassProps"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRPredicateSetToMBPredicateSet" name="TRPredicateSetToMBPredicateSet"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRRelDomainsToMOpCallArg" name="TRRelDomainsToMOpCallArg"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRRelImplToMBottomEnforcementOperation" name="TRRelImplToMBottomEnforcementOperation"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRSimplePatternToMPattern" name="TRSimplePatternToMPattern"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRVarSetToDGVarSet" name="TRVarSetToDGVarSet"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRVarSetToMBVarSet" name="TRVarSetToMBVarSet"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRVarSetToMVarSet" name="TRVarSetToMVarSet"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRVarToMRealizedVar" name="TRVarToMRealizedVar"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRVarToMVar" name="TRVarToMVar"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRWhenPatternToMGuardPattern" name="TRWhenPatternToMGuardPattern"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRWhenRelCallArgToMGuardPredicate" name="TRWhenRelCallArgToMGuardPredicate"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRWhenRelCallToMGuard" name="TRWhenRelCallToMGuard"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRWherePatternToMPattern" name="TRWherePatternToMPattern"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRelationDomainToTraceClassVar" name="TRelationDomainToTraceClassVar"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRelationToTraceClass" name="TRelationToTraceClass"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRelationToTraceClassVar" name="TRelationToTraceClassVar"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TRelationalTransformationToMappingTransformation" name="TRelationalTransformationToMappingTransformation"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TSubTemplateToTraceClassProps" name="TSubTemplateToTraceClassProps"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TTROppositeDomainsToMappingForEnforcement" name="TTROppositeDomainsToMappingForEnforcement"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TTopLevelRelationToMappingForChecking" name="TTopLevelRelationToMappingForChecking"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TTopLevelRelationToMappingForEnforcement" name="TTopLevelRelationToMappingForEnforcement"/>
+ <ownedClasses xmi:id="T.org.eclipse.qvtd.compiler.qvtr.TrelToCore.TUnsharedWhenVarsToMgVars" name="TUnsharedWhenVarsToMgVars"/>
+ </ownedPackages>
+ </ownedPackages>
</ownedPackages>
</ownedPackages>
</ownedPackages>
- </pivot:Package>
-</xmi:XMI>
+ </ownedPackages>
+ <ownedPackages xmi:id="P.$$" name="$$"/>
+</pivot:Model>

Back to the top