diff --git a/org.framed.iorm.ui/META-INF/MANIFEST.MF b/org.framed.iorm.ui/META-INF/MANIFEST.MF index b01f8b3a5ef53649a6ea4b7913dfbfef06ea4162..17c6190cb349199d873401f541fcc5e6aeef58f5 100644 --- a/org.framed.iorm.ui/META-INF/MANIFEST.MF +++ b/org.framed.iorm.ui/META-INF/MANIFEST.MF @@ -31,3 +31,5 @@ Import-Package: org.eclipse.graphiti.features;version="0.13.2", org.framed.iorm.model, org.framed.iorm.model.provider, org.framed.orm.transformation +Export-Package: org.framed.iorm.ui.exceptions, + org.framed.iorm.ui.literals diff --git a/org.framed.orm.transformation.test/.classpath b/org.framed.orm.transformation.test/.classpath new file mode 100644 index 0000000000000000000000000000000000000000..e8ea977a6942946fa7df26530dbfae32c3c6450f --- /dev/null +++ b/org.framed.orm.transformation.test/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/org.framed.orm.transformation.test/.gitignore b/org.framed.orm.transformation.test/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..ae3c1726048cd06b9a143e0376ed46dd9b9a8d53 --- /dev/null +++ b/org.framed.orm.transformation.test/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/org.framed.orm.transformation.test/.project b/org.framed.orm.transformation.test/.project new file mode 100644 index 0000000000000000000000000000000000000000..d34fa380d7bc1b6ae59338180021bdc84df46497 --- /dev/null +++ b/org.framed.orm.transformation.test/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.framed.orm.transformation.test</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.ManifestBuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.pde.SchemaBuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/org.framed.orm.transformation.test/.settings/org.eclipse.jdt.core.prefs b/org.framed.orm.transformation.test/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000000000000000000000000000000000000..f42de363afaae68bbd968318f1d331877f5514fc --- /dev/null +++ b/org.framed.orm.transformation.test/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/org.framed.orm.transformation.test/META-INF/MANIFEST.MF b/org.framed.orm.transformation.test/META-INF/MANIFEST.MF new file mode 100644 index 0000000000000000000000000000000000000000..9c76958e09622517e4ed7515743d1244c485816b --- /dev/null +++ b/org.framed.orm.transformation.test/META-INF/MANIFEST.MF @@ -0,0 +1,31 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.framed.orm.transformation.test;singleton:=true +Bundle-Version: 2.0.3 +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.emf.ecore;visibility:=reexport, + org.framed.orm.transformation;bundle-version="1.0.0", + org.junit, + org.rosi.crom.metamodel;visibility:=reexport, + org.framed.iorm.model;bundle-version="0.1.0";visibility:=reexport, + org.eclipse.emf.ecore.xmi, + org.eclipse.compare;bundle-version="3.5.501", + org.eclipse.emf.compare;bundle-version="3.1.0", + de.ovgu.featureide.fm.core +Bundle-RequiredExecutionEnvironment: JavaSE-1.7 +Export-Package: org.framed.orm.transformation.test.model.test, + org.framed.orm.transformation.test.model.test.impl, + org.framed.orm.transformation.test.model.test.testgeneration, + org.framed.orm.transformation.test.model.test.util +Bundle-ActivationPolicy: lazy +Import-Package: de.ovgu.featureide.fm.core, + de.ovgu.featureide.fm.core.configuration, + de.ovgu.featureide.fm.core.io, + de.ovgu.featureide.fm.core.io.xml, + org.eclipse.core.resources, + org.framed.iorm.ui.exceptions, + org.framed.iorm.ui.literals diff --git a/org.framed.orm.transformation.test/build.properties b/org.framed.orm.transformation.test/build.properties new file mode 100644 index 0000000000000000000000000000000000000000..b855b2445ce7f2f8149b0857a2eee3f4d82f1edb --- /dev/null +++ b/org.framed.orm.transformation.test/build.properties @@ -0,0 +1,12 @@ +# + +bin.includes = .,\ + model/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties,\ + testcases1/ +jars.compile.order = . +source.. = src/ +output.. = bin/ +src.includes = testcases1/ diff --git a/org.framed.orm.transformation.test/model/baseTest.crom_dia b/org.framed.orm.transformation.test/model/baseTest.crom_dia new file mode 100644 index 0000000000000000000000000000000000000000..fbde76e6b8306d105931b29b07cfa7ab13f6b262 --- /dev/null +++ b/org.framed.orm.transformation.test/model/baseTest.crom_dia @@ -0,0 +1,417 @@ +<?xml version="1.0" encoding="UTF-8"?> +<org.framed.orm.model:Model xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:org.framed.orm.model="http://orm/1.0"> + <elements xsi:type="org.framed.orm.model:Shape" name="CompartmentA" incomingRelations="//@elements.10 //@elements.11 //@elements.12 //@elements.13" outgoingRelations="//@elements.12"> + <firstSegment> + <elements name="AttributeCompartmentA : String"/> + </firstSegment> + <secondSegment> + <elements name="OperationCompartmentA(input : Boolean)"/> + </secondSegment> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleF" outgoingRelations="//@elements.0/@model/@elements.3" type="RoleType"> + <firstSegment/> + <secondSegment> + <elements name="OperationRoleE(input : Integer) : String"/> + </secondSegment> + <description name="1..*"/> + <boundaries> + <topLeft x="824" y="345"/> + <bottomRight x="1061" y="500"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleE" incomingRelations="//@elements.0/@model/@elements.3" type="RoleType"> + <firstSegment> + <elements name="AttributeRoleE : Integer"/> + </firstSegment> + <secondSegment> + <elements name="OperationRoleE(input : Integer) : String"/> + </secondSegment> + <description name="0..1"/> + <boundaries> + <topLeft x="824" y="71"/> + <bottomRight x="1059" y="224"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleGroupA (1..*)" type="RoleGroup"> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleG" incomingRelations="//@elements.0/@model/@elements.2/@model/@elements.3" outgoingRelations="//@elements.0/@model/@elements.2/@model/@elements.4" type="RoleType"> + <firstSegment/> + <secondSegment/> + <description name="*"/> + <boundaries> + <topLeft x="38" y="22"/> + <bottomRight x="241" y="175"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleH" outgoingRelations="//@elements.0/@model/@elements.2/@model/@elements.3 //@elements.0/@model/@elements.2/@model/@elements.7" type="RoleType"> + <firstSegment/> + <secondSegment/> + <description name="*"/> + <boundaries> + <topLeft x="437" y="22"/> + <bottomRight x="641" y="176"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleJ" incomingRelations="//@elements.0/@model/@elements.2/@model/@elements.4 //@elements.0/@model/@elements.2/@model/@elements.9" type="RoleType"> + <firstSegment/> + <secondSegment/> + <description name="*"/> + <boundaries> + <topLeft x="37" y="237"/> + <bottomRight x="244" y="394"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="RoleImplication" target="//@elements.0/@model/@elements.2/@model/@elements.0" source="//@elements.0/@model/@elements.2/@model/@elements.1"/> + <elements xsi:type="org.framed.orm.model:Relation" type="RoleProhibition" target="//@elements.0/@model/@elements.2/@model/@elements.2" source="//@elements.0/@model/@elements.2/@model/@elements.0"/> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleK" incomingRelations="//@elements.0/@model/@elements.2/@model/@elements.7" outgoingRelations="//@elements.0/@model/@elements.2/@model/@elements.9" type="RoleType"> + <firstSegment/> + <secondSegment/> + <description name="*"/> + <boundaries> + <topLeft x="435" y="238"/> + <bottomRight x="644" y="397"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="RelF" type="Relationship" target="//@elements.0/@model/@elements.2/@model/@elements.5" source="//@elements.0/@model/@elements.2/@model/@elements.1" connectionAnchor="//@elements.0/@model/@elements.2/@model/@elements.6"> + <sourceLabel name="0..1"/> + <targetLabel name="1..*"/> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="RoleEquivalence" target="//@elements.0/@model/@elements.2/@model/@elements.2" source="//@elements.0/@model/@elements.2/@model/@elements.5"/> + </model> + <description name="1..1"/> + <boundaries> + <topLeft x="59" y="68"/> + <bottomRight x="752" y="518"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Inheritance" target="//@elements.0/@model/@elements.1" source="//@elements.0/@model/@elements.0"/> + </model> + <boundaries> + <topLeft x="848" y="158"/> + <bottomRight x="1102" y="312"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="SubDataA" outgoingRelations="//@elements.6" type="DataType"> + <firstSegment/> + <secondSegment> + <elements name="validateData() : Boolean"/> + </secondSegment> + <boundaries> + <topLeft x="88" y="86"/> + <bottomRight x="289" y="237"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="DataA" incomingRelations="//@elements.6" outgoingRelations="//@elements.10" type="DataType"> + <firstSegment> + <elements name="Data1 : String"/> + <elements name="Data2 : Integer"/> + </firstSegment> + <secondSegment> + <elements name="validateData() : Boolean"/> + </secondSegment> + <boundaries> + <topLeft x="426" y="84"/> + <bottomRight x="629" y="237"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="SubNaturalA" outgoingRelations="//@elements.5" type="NaturalType"> + <firstSegment> + <elements name="AttributeSubNatA : String"/> + </firstSegment> + <secondSegment/> + <boundaries> + <topLeft x="84" y="255"/> + <bottomRight x="300" y="421"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="NaturalA" incomingRelations="//@elements.5" outgoingRelations="//@elements.9 //@elements.11 //@elements.15" type="NaturalType"> + <firstSegment> + <elements name="AttributeNatA : String"/> + </firstSegment> + <secondSegment> + <elements name="OperationNatA()"/> + </secondSegment> + <boundaries> + <topLeft x="425" y="264"/> + <bottomRight x="625" y="414"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Inheritance" target="//@elements.4" source="//@elements.3"/> + <elements xsi:type="org.framed.orm.model:Relation" type="Inheritance" target="//@elements.2" source="//@elements.1"/> + <elements xsi:type="org.framed.orm.model:Shape" name="GroupA" type="Group"> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="NaturalB" type="NaturalType"> + <firstSegment> + <elements name="AttributeNatB : String"/> + </firstSegment> + <secondSegment> + <elements name="OperationNatB() : Integer"/> + </secondSegment> + <boundaries> + <topLeft x="215" y="184"/> + <bottomRight x="415" y="334"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="DataB" type="DataType"> + <firstSegment> + <elements name="value : Float"/> + </firstSegment> + <secondSegment/> + <boundaries> + <topLeft x="548" y="183"/> + <bottomRight x="750" y="335"/> + </boundaries> + </elements> + </model> + <boundaries> + <topLeft x="90" y="441"/> + <bottomRight x="290" y="591"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CompartmentB" incomingRelations="//@elements.9 //@elements.16" outgoingRelations="//@elements.13"> + <firstSegment/> + <secondSegment/> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleA" outgoingRelations="//@elements.8/@model/@elements.5 //@elements.8/@model/@elements.11 //@elements.8/@model/@elements.14 //@elements.8/@model/@elements.16 //@elements.8/@model/@elements.19 //@elements.8/@model/@elements.20" type="RoleType"> + <firstSegment> + <elements name="AttributeRoleA : Boolean"/> + </firstSegment> + <secondSegment/> + <description name="0..1"/> + <boundaries> + <topLeft x="234" y="116"/> + <bottomRight x="437" y="269"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleB" incomingRelations="//@elements.8/@model/@elements.5 //@elements.8/@model/@elements.16" outgoingRelations="//@elements.8/@model/@elements.7 //@elements.8/@model/@elements.17" type="RoleType"> + <firstSegment> + <elements name="AttributeRoleB : String"/> + </firstSegment> + <secondSegment> + <elements name="OperationRoleB()"/> + </secondSegment> + <description name="1..1"/> + <boundaries> + <topLeft x="639" y="116"/> + <bottomRight x="845" y="272"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleC" incomingRelations="//@elements.8/@model/@elements.9 //@elements.8/@model/@elements.11 //@elements.8/@model/@elements.18 //@elements.8/@model/@elements.20" type="RoleType"> + <firstSegment/> + <secondSegment/> + <description name="1..*"/> + <boundaries> + <topLeft x="234" y="374"/> + <bottomRight x="436" y="526"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleD" incomingRelations="//@elements.8/@model/@elements.7 //@elements.8/@model/@elements.14 //@elements.8/@model/@elements.17 //@elements.8/@model/@elements.19" outgoingRelations="//@elements.8/@model/@elements.9 //@elements.8/@model/@elements.18" type="RoleType"> + <firstSegment> + <elements name="AttributeRoleD : Integer"/> + </firstSegment> + <secondSegment/> + <description name="*"/> + <boundaries> + <topLeft x="642" y="374"/> + <bottomRight x="845" y="527"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" outgoingRelations="//@elements.8/@model/@elements.21" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="RelA" type="Relationship" target="//@elements.8/@model/@elements.1" source="//@elements.8/@model/@elements.0" referencedRelation="//@elements.8/@model/@elements.16" connectionAnchor="//@elements.8/@model/@elements.4"> + <sourceLabel name="1..1"/> + <targetLabel name="*"/> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="RelB" type="Relationship" target="//@elements.8/@model/@elements.3" source="//@elements.8/@model/@elements.1" referencedRelation="//@elements.8/@model/@elements.17" connectionAnchor="//@elements.8/@model/@elements.6"> + <sourceLabel name="0..1"/> + <targetLabel name="1..*"/> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" incomingRelations="//@elements.8/@model/@elements.22" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="RelC" type="Relationship" target="//@elements.8/@model/@elements.2" source="//@elements.8/@model/@elements.3" referencedRelation="//@elements.8/@model/@elements.18" connectionAnchor="//@elements.8/@model/@elements.8"> + <sourceLabel name="1..*"/> + <targetLabel name="1..1"/> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" outgoingRelations="//@elements.8/@model/@elements.22" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="RelD" type="Relationship" target="//@elements.8/@model/@elements.2" source="//@elements.8/@model/@elements.0" referencedRelation="//@elements.8/@model/@elements.20" connectionAnchor="//@elements.8/@model/@elements.10"> + <sourceLabel name="*"/> + <targetLabel name="*"/> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" incomingRelations="//@elements.8/@model/@elements.21" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="RelE" type="Relationship" target="//@elements.8/@model/@elements.3" source="//@elements.8/@model/@elements.0" referencedRelation="//@elements.8/@model/@elements.19" connectionAnchor="//@elements.8/@model/@elements.13"> + <sourceLabel name="*"/> + <targetLabel name="*"/> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Reflexive" type="Reflexive" target="//@elements.8/@model/@elements.1" source="//@elements.8/@model/@elements.0" referencedRelation="//@elements.8/@model/@elements.5"> + <bendpoints> + <referencePoints x="438" y="193"/> + <referencePoints x="639" y="194"/> + <distances x="-121" y="1"/> + <distances/> + </bendpoints> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Irreflexive" type="Irreflexive" target="//@elements.8/@model/@elements.3" source="//@elements.8/@model/@elements.1" referencedRelation="//@elements.8/@model/@elements.7"> + <bendpoints> + <referencePoints x="742" y="273"/> + <referencePoints x="744" y="374"/> + <distances x="-21" y="51"/> + <distances/> + </bendpoints> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Total" type="Total" target="//@elements.8/@model/@elements.2" source="//@elements.8/@model/@elements.3" referencedRelation="//@elements.8/@model/@elements.9"> + <bendpoints> + <referencePoints x="642" y="451"/> + <referencePoints x="437" y="450"/> + <distances x="-122"/> + <distances/> + </bendpoints> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Cyclic" type="Cyclic" target="//@elements.8/@model/@elements.3" source="//@elements.8/@model/@elements.0" referencedRelation="//@elements.8/@model/@elements.14"> + <bendpoints> + <referencePoints x="336" y="270"/> + <referencePoints x="744" y="374"/> + <distances x="-224" y="52"/> + <distances/> + </bendpoints> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Acyclic" type="Acyclic" target="//@elements.8/@model/@elements.2" source="//@elements.8/@model/@elements.0" referencedRelation="//@elements.8/@model/@elements.11"> + <bendpoints> + <referencePoints x="336" y="270"/> + <referencePoints x="335" y="374"/> + <distances x="-20" y="52"/> + <distances/> + </bendpoints> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="RelationshipImplication" target="//@elements.8/@model/@elements.13" source="//@elements.8/@model/@elements.4"/> + <elements xsi:type="org.framed.orm.model:Relation" type="RelationshipExclusion" target="//@elements.8/@model/@elements.8" source="//@elements.8/@model/@elements.10"/> + </model> + <boundaries> + <topLeft x="850" y="363"/> + <bottomRight x="1052" y="515"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" target="//@elements.8" source="//@elements.4" referencedRoles="//@elements.8/@model/@elements.0 //@elements.8/@model/@elements.1 //@elements.8/@model/@elements.2 //@elements.8/@model/@elements.3"/> + <elements xsi:type="org.framed.orm.model:Relation" name="" type="Fulfillment" target="//@elements.0" source="//@elements.2" referencedRoles="//@elements.0/@model/@elements.1 //@elements.0/@model/@elements.0"/> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" target="//@elements.0" source="//@elements.4" referencedRoles="//@elements.0/@model/@elements.2"/> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" target="//@elements.0" source="//@elements.0" referencedRoles="//@elements.0/@model/@elements.2/@model/@elements.5"> + <bendpoints> + <referencePoints x="848" y="158"/> + <referencePoints x="848" y="158"/> + <distances y="183"/> + <distances/> + </bendpoints> + <bendpoints> + <referencePoints x="848" y="158"/> + <referencePoints x="848" y="158"/> + <distances x="166" y="92"/> + <distances x="166" y="92"/> + </bendpoints> + <bendpoints> + <referencePoints x="848" y="158"/> + <referencePoints x="848" y="158"/> + <distances x="164" y="2"/> + <distances x="164" y="2"/> + </bendpoints> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" target="//@elements.0" source="//@elements.8" referencedRoles="//@elements.0/@model/@elements.2/@model/@elements.1"/> + <elements xsi:type="org.framed.orm.model:Shape" name="CompartmentC" incomingRelations="//@elements.15" outgoingRelations="//@elements.16"> + <firstSegment/> + <secondSegment> + <elements name="OperationCompartmentC(input : Boolean)"/> + </secondSegment> + <model/> + <boundaries> + <topLeft x="380" y="432"/> + <bottomRight x="666" y="608"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" target="//@elements.14" source="//@elements.4" referencedRoles="//@elements.8/@model/@elements.0 //@elements.8/@model/@elements.1 //@elements.8/@model/@elements.2 //@elements.8/@model/@elements.3"/> + <elements xsi:type="org.framed.orm.model:Relation" type="Inheritance" target="//@elements.8" source="//@elements.14"/> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties"/> + <features name="Role_Behavior" manuallySelected="true"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> +</org.framed.orm.model:Model> diff --git a/org.framed.orm.transformation.test/model/testmodel.ecore b/org.framed.orm.transformation.test/model/testmodel.ecore new file mode 100644 index 0000000000000000000000000000000000000000..1cc873ef11c65286c6839354d4f399c2bb45ce54 --- /dev/null +++ b/org.framed.orm.transformation.test/model/testmodel.ecore @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="test" nsURI="http://org.framed/testmodel" nsPrefix="ts"> + <eClassifiers xsi:type="ecore:EClass" name="TestCase"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="title" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="framedModel" eType="ecore:EClass ../../org.framed.orm.model/model/ORM.ecore#//Model" + containment="true"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="cromModel" eType="ecore:EClass ../../org.rosi.crom.metamodel/src-gen/crom_l1_composed.ecore#//Model" + containment="true"/> + </eClassifiers> +</ecore:EPackage> diff --git a/org.framed.orm.transformation.test/model/testmodel.genmodel b/org.framed.orm.transformation.test/model/testmodel.genmodel new file mode 100644 index 0000000000000000000000000000000000000000..5e0d03da3e7deab8a46e04605db28cceaaf8b97f --- /dev/null +++ b/org.framed.orm.transformation.test/model/testmodel.genmodel @@ -0,0 +1,18 @@ +<?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="/org.framed.orm.transformation.test/src" modelPluginID="org.framed.orm.transformation.test" + modelName="Testmodel" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" + importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" copyrightFields="false" + usedGenPackages="../../org.rosi.crom.metamodel/src-gen/crom_l1_composed.genmodel#//crom_l1_composed ../../org.framed.orm.model/model/ORM.genmodel#//orm" + operationReflection="true" importOrganizing="true"> + <foreignModel>testmodel.ecore</foreignModel> + <genPackages prefix="Test" basePackage="org.framed.orm.transformation.test.model" + disposableProviderFactory="true" ecorePackage="testmodel.ecore#/"> + <genClasses ecoreClass="testmodel.ecore#//TestCase"> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute testmodel.ecore#//TestCase/title"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute testmodel.ecore#//TestCase/description"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference testmodel.ecore#//TestCase/framedModel"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference testmodel.ecore#//TestCase/cromModel"/> + </genClasses> + </genPackages> +</genmodel:GenModel> diff --git a/org.framed.orm.transformation.test/plugin.properties b/org.framed.orm.transformation.test/plugin.properties new file mode 100644 index 0000000000000000000000000000000000000000..7fec06f496a196f1b7b95424ea703e72fc6fe633 --- /dev/null +++ b/org.framed.orm.transformation.test/plugin.properties @@ -0,0 +1,4 @@ +# + +pluginName = Testmodel Model +providerName = www.example.org diff --git a/org.framed.orm.transformation.test/plugin.xml b/org.framed.orm.transformation.test/plugin.xml new file mode 100644 index 0000000000000000000000000000000000000000..38b5e7336ce167a942e87fec56f65c892fae0034 --- /dev/null +++ b/org.framed.orm.transformation.test/plugin.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.0"?> + +<!-- +--> + +<plugin> + + <extension point="org.eclipse.emf.ecore.generated_package"> + <!-- @generated testmodel --> + <package + uri="http://org.framed/testmodel" + class="org.framed.orm.transformation.test.model.test.TestPackage" + genModel="model/testmodel.genmodel"/> + </extension> + +</plugin> diff --git a/org.framed.orm.transformation.test/pom.xml b/org.framed.orm.transformation.test/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..af3208f4ef58752fe017c1a417f3a4f8ec069861 --- /dev/null +++ b/org.framed.orm.transformation.test/pom.xml @@ -0,0 +1,32 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>org.framed.orm</groupId> + <artifactId>org.framed.orm.transformation.test</artifactId> + <packaging>eclipse-test-plugin</packaging> + + <parent> + <relativePath>../org.framed.orm.build/pom.xml</relativePath> + <groupId>org.framed</groupId> + <artifactId>parent</artifactId> + <version>2.0.3</version> + </parent> + + + + <build> + <plugins> + <plugin> + <groupId>org.eclipse.tycho</groupId> + <artifactId>tycho-surefire-plugin</artifactId> + <version>${tycho.version}</version> + <!-- This configuration was necessary because tycho-surefire is a dumb + buggy idiot and does not recognize parameterized tests by itself right now. --> + <configuration> + <testSuite>org.framed.orm.transformation.test</testSuite> + <testClass>org.framed.orm.transformation.test.TransformationTestSuite</testClass> + </configuration> + </plugin> + </plugins> + </build> +</project> \ No newline at end of file diff --git a/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/TransformationTestSuite.java b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/TransformationTestSuite.java new file mode 100644 index 0000000000000000000000000000000000000000..f5a975bfe269f007c31ac565d734725d63b30216 --- /dev/null +++ b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/TransformationTestSuite.java @@ -0,0 +1,336 @@ +package org.framed.orm.transformation.test; + +import static org.junit.Assert.fail; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Platform; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.compare.Comparison; +import org.eclipse.emf.compare.EMFCompare; +import org.eclipse.emf.compare.match.DefaultComparisonFactory; +import org.eclipse.emf.compare.match.DefaultEqualityHelperFactory; +import org.eclipse.emf.compare.match.DefaultMatchEngine; +import org.eclipse.emf.compare.match.IComparisonFactory; +import org.eclipse.emf.compare.match.IMatchEngine; +import org.eclipse.emf.compare.match.eobject.IEObjectMatcher; +import org.eclipse.emf.compare.match.impl.MatchEngineFactoryImpl; +import org.eclipse.emf.compare.match.impl.MatchEngineFactoryRegistryImpl; +import org.eclipse.emf.compare.scope.DefaultComparisonScope; +import org.eclipse.emf.compare.scope.IComparisonScope; +import org.eclipse.emf.compare.utils.UseIdentifiers; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl; +import org.framed.orm.transformation.TransformationExecutor; +import org.framed.orm.transformation.test.model.test.TestCase; +import org.framed.orm.transformation.test.model.test.testgeneration.TestGenerator; +import org.junit.After; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.Parameterized; +import org.osgi.framework.Bundle; + +import crom_l1_composed.Model; + +/** + * Parameterized test to run all test cases inside "testcases" directory + * + * @author Johannes Tandler + * + */ +@RunWith(Parameterized.class) +public class TransformationTestSuite { + + /** + * File uri of crom model. This file is created during tests and delete afterwards. + */ + private static final URI CROM_FILE_URI = URI.createFileURI("crom_model.xmi"); + + /** + * File uri of crom model. This file is created during tests and delete afterwards. + */ + private static final URI FRAMED_FILE_URI = URI.createFileURI("framed_model.xmi"); + + /** + * Object that creates the generated test cases + */ + private static TestGenerator TEST_GENERATOR = new TestGenerator(); + + /** + * Loads all {@link TestCase}s from the "testcases" directory of this plugin. + * + * @return {@link List} of {@link TestCase} + * @throws Exception + */ + @Parameterized.Parameters(name = "{index} : file={1}") + public static Collection<Object[]> getTestCases() throws Exception { + List<Object[]> list = new LinkedList<Object[]>(); + File file = null; + + TEST_GENERATOR.generateTestCases(); + // if bundle is available this test runs as plugin junit test + Bundle bundle = Platform.getBundle("org.framed.orm.transformation.test"); + if (bundle != null) { + // get dir out of bundle + URL fileURL = bundle.getEntry("testcases"); + file = new File(FileLocator.resolve(fileURL).toURI()); + } else { + // otherwise just load it from the working directory + file = new File("testcases"); + } + // load all test cases in this directory + loadDirectory(list, file); + return list; + } + + /** + * Loads all {@link TestCase} of the given directory + * + * @param list + * List of {@link TestCase} + * @param file + * Current directory + */ + private static void loadDirectory(List<Object[]> list, File file) throws IOException { + for (File testFile : file.listFiles()) { + // if entry is directory load it recursively + if (testFile.isDirectory()) { + loadDirectory(list, testFile); + } else if (testFile.getName().endsWith("xmi")) { + // if entry is file try to load test file + TestCase testCase = loadTestCase(testFile); + if (testCase != null) { + list.add(new Object[] { testCase, testFile.getName() }); + } + } + } + } + + + /** + * loads the {@link TestCase} of the specified {@link File}. + * + * @param list List of {@link TestCase} + * @param testFile + */ + private static TestCase loadTestCase(File testFile) { + try { + // load each testcase + ResourceSet set = new ResourceSetImpl(); + Resource res = set.createResource(URI.createFileURI(testFile.toString())); + res.load(Collections.EMPTY_MAP); + // if there are file contents in this directory + if (res.getContents().size() > 0 + && res.getContents().get(0) instanceof TestCase) { + // load test file and add it to test list + return (TestCase) res.getContents().get(0); + } + } catch (Exception e) { + System.err.println("Was not able to load testcase \"" + + testFile.toString() + "\" due : " + e.toString()); + for (StackTraceElement el: e.getStackTrace()) System.err.println(el.toString()); + } + return null; + } + + /** + * current {@link TestCase} + */ + private TestCase testCase; + + /** + * default constructor + * + * @param testCase current {@link TestCase} + * @param _bla JUnit needs this, but we dont use it. + * @throws Exception + */ + public TransformationTestSuite(TestCase testCase, String _bla) throws Exception { + this.testCase = testCase; + } + + /** + * test method + * @throws IOException + * @throws Exception + */ + @Test + public void doTest() throws IOException { + TransformationExecutor exe = new TransformationExecutor(); + + // setup tmp resource + Resource[] resources = initResources(testCase); + exe.setSourceModelFile(resources[0]); + exe.setTargetModelFile(resources[1]); + + // get expected model + EObject expectedModel = EcoreUtil.copy(testCase.getCromModel()); + + // execute transformation + try { + exe.execute(); + } catch (Exception e) { + fail("Error in transformation execution of test case \"" + + testCase.eResource().getURI().toFileString() + "\":\n" + e.toString()); + } + // reload all resources + for (Resource res : resources) { + res.load(Collections.EMPTY_MAP); + } + + // get transformed model + EObject toCompare = resources[1].getContents().get(0); + + // create emf comparator + IComparisonScope scope = new DefaultComparisonScope(expectedModel, toCompare, null); + EMFCompare comparator = setupComparator(); + + // compare both models + Comparison comp = comparator.compare(scope); + + int diffs = comp.getDifferences().size(); + + // if there are diffs this test failed + if (diffs > 0) { + // build error message + StringBuilder builder = new StringBuilder(); + builder.append("Test \""); + builder.append(testCase.getTitle()); + builder.append("\" failed :\n"); + builder.append("\tDescription: "); + builder.append(testCase.getDescription()); + builder.append("\n\n"); + + builder.append("Expected model:\n"); + builder.append(getModelXML(expectedModel)); + + builder.append("\n\n"); + builder.append("Current model:\n"); + builder.append(getModelXML(toCompare)); + + builder.append("\n\n"); + builder.append("\tDifferences: "); + builder.append(comp.getDifferences()); + + // some empty lines + for (int i = 0; i < 3; i++) { + builder.append("\n"); + } + + // Fail it! + fail(builder.toString()); + } + } + + private String getModelXML(EObject toCompare) { + try { + ByteArrayOutputStream oStream = new ByteArrayOutputStream(); + Resource res = new XMLResourceImpl(URI.createURI("dummyfile.xml")); + res.getContents().add(EcoreUtil.copy(toCompare)); + res.save(oStream, null); + oStream.flush(); + oStream.close(); + String file = new String(oStream.toByteArray()); + return file; + } catch (IOException e) { + e.printStackTrace(); + } + return null; + } + + /** + * setups a default emf comparator. This is just copy & paste from the EMFCompare tutorial. + * + * @return default emf comparator. + */ + private EMFCompare setupComparator() { + IEObjectMatcher matcher = DefaultMatchEngine.createDefaultEObjectMatcher(UseIdentifiers.NEVER); + IComparisonFactory comparisonFactory = + new DefaultComparisonFactory(new DefaultEqualityHelperFactory()); + IMatchEngine.Factory matchEngineFactory = + new MatchEngineFactoryImpl(matcher, comparisonFactory); + matchEngineFactory.setRanking(20); + IMatchEngine.Factory.Registry matchEngineRegistry = new MatchEngineFactoryRegistryImpl(); + matchEngineRegistry.add(matchEngineFactory); + EMFCompare comparator = + EMFCompare.builder().setMatchEngineFactoryRegistry(matchEngineRegistry).build(); + + return comparator; + } + + /** + * Initializes all {@link Resource}s which are necessary for this {@link TestCase} + * + * @param testCase current {@link TestCase} + * @return Array of {@link Resource}s which were created. First contains {@link Model} and second + * {@link org.framed.orm.model.Model}. + */ + private Resource[] initResources(TestCase testCase) { + Resource res2 = saveEObject(null, CROM_FILE_URI); + Resource res1 = saveEObject(testCase.getFramedModel(), FRAMED_FILE_URI); + + return new Resource[] {res1, res2}; + } + + /** + * Stores the given {@link EObject} inside the specified {@link URI} + * + * @param object {@link EObject} to be stored + * @param file {@link URI} of destination file + * @return created {@link Resource} + */ + private Resource saveEObject(EObject object, URI file) { + ResourceSet set1 = new ResourceSetImpl(); + Resource res1 = set1.createResource(file); + + if (object != null) + res1.getContents().add(EcoreUtil.copy(object)); + + try { + res1.save(Collections.EMPTY_MAP); + } catch (IOException e) { + e.printStackTrace(); + } + + return res1; + } + + @After + public void deleteFiles() throws Exception { + // delete created files after test + Files.delete(Paths.get(CROM_FILE_URI.toFileString())); + Files.delete(Paths.get(FRAMED_FILE_URI.toFileString())); + if(testCase.getTitle().startsWith("Generated test")) deleteGeneratedTestCase(); + } + + /** + * Deletes the test case file corresponding to the test case that was just executed + */ + public void deleteGeneratedTestCase() { + String filename = testCase.getTitle().substring(15); + Bundle bundle = Platform.getBundle("org.framed.orm.transformation.test"); + URL fileURL = bundle.getEntry("testcases/Generated/" + filename + ".xmi"); + try { + File file = new File(FileLocator.resolve(fileURL).toURI()); + Files.delete(Paths.get(file.getPath())); + } catch (URISyntaxException | IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/TestCase.java b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/TestCase.java new file mode 100644 index 0000000000000000000000000000000000000000..125bd8dc2616ed09550aa5889c9b67288423bfd4 --- /dev/null +++ b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/TestCase.java @@ -0,0 +1,140 @@ +/** + */ +package org.framed.orm.transformation.test.model.test; + +import org.eclipse.emf.ecore.EObject; + +import org.framed.iorm.model.Model; + +/** + * <!-- begin-user-doc --> A representation of the model object '<em><b>Case</b></em>'. <!-- + * end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.framed.orm.transformation.test.model.test.TestCase#getTitle <em>Title</em>}</li> + * <li>{@link org.framed.orm.transformation.test.model.test.TestCase#getDescription <em>Description + * </em>}</li> + * <li>{@link org.framed.orm.transformation.test.model.test.TestCase#getFramedModel <em>Framed Model + * </em>}</li> + * <li>{@link org.framed.orm.transformation.test.model.test.TestCase#getCromModel <em>Crom Model + * </em>}</li> + * </ul> + * </p> + * + * @see org.framed.orm.transformation.test.model.test.TestPackage#getTestCase() + * @model + * @generated + */ +public interface TestCase extends EObject { + /** + * Returns the value of the '<em><b>Title</b></em>' attribute. <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Title</em>' attribute isn't clear, there really should be more of a + * description here... + * </p> + * <!-- end-user-doc --> + * + * @return the value of the '<em>Title</em>' attribute. + * @see #setTitle(String) + * @see org.framed.orm.transformation.test.model.test.TestPackage#getTestCase_Title() + * @model + * @generated + */ + String getTitle(); + + /** + * Sets the value of the '{@link org.framed.orm.transformation.test.model.test.TestCase#getTitle + * <em>Title</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @param value the new value of the '<em>Title</em>' attribute. + * @see #getTitle() + * @generated + */ + void setTitle(String value); + + /** + * Returns the value of the '<em><b>Description</b></em>' attribute. <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Description</em>' attribute isn't clear, there really should be more + * of a description here... + * </p> + * <!-- end-user-doc --> + * + * @return the value of the '<em>Description</em>' attribute. + * @see #setDescription(String) + * @see org.framed.orm.transformation.test.model.test.TestPackage#getTestCase_Description() + * @model + * @generated + */ + String getDescription(); + + /** + * Sets the value of the ' + * {@link org.framed.orm.transformation.test.model.test.TestCase#getDescription + * <em>Description</em>}' attribute. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @param value the new value of the '<em>Description</em>' attribute. + * @see #getDescription() + * @generated + */ + void setDescription(String value); + + /** + * Returns the value of the '<em><b>Framed Model</b></em>' containment reference. <!-- + * begin-user-doc --> + * <p> + * If the meaning of the '<em>Framed Model</em>' containment reference isn't clear, there really + * should be more of a description here... + * </p> + * <!-- end-user-doc --> + * + * @return the value of the '<em>Framed Model</em>' containment reference. + * @see #setFramedModel(Model) + * @see org.framed.orm.transformation.test.model.test.TestPackage#getTestCase_FramedModel() + * @model containment="true" + * @generated + */ + Model getFramedModel(); + + /** + * Sets the value of the ' + * {@link org.framed.orm.transformation.test.model.test.TestCase#getFramedModel + * <em>Framed Model</em>}' containment reference. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @param value the new value of the '<em>Framed Model</em>' containment reference. + * @see #getFramedModel() + * @generated + */ + void setFramedModel(Model value); + + /** + * Returns the value of the '<em><b>Crom Model</b></em>' containment reference. <!-- + * begin-user-doc --> + * <p> + * If the meaning of the '<em>Crom Model</em>' containment reference isn't clear, there really + * should be more of a description here... + * </p> + * <!-- end-user-doc --> + * + * @return the value of the '<em>Crom Model</em>' containment reference. + * @see #setCromModel(crom_l1_composed.Model) + * @see org.framed.orm.transformation.test.model.test.TestPackage#getTestCase_CromModel() + * @model containment="true" + * @generated + */ + crom_l1_composed.Model getCromModel(); + + /** + * Sets the value of the ' + * {@link org.framed.orm.transformation.test.model.test.TestCase#getCromModel <em>Crom Model</em>} + * ' containment reference. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @param value the new value of the '<em>Crom Model</em>' containment reference. + * @see #getCromModel() + * @generated + */ + void setCromModel(crom_l1_composed.Model value); + +} // TestCase diff --git a/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/TestFactory.java b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/TestFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..1010036172d1c19ea01bd3c0182020c5fb21e6ed --- /dev/null +++ b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/TestFactory.java @@ -0,0 +1,38 @@ +/** + */ +package org.framed.orm.transformation.test.model.test; + +import org.eclipse.emf.ecore.EFactory; + +/** + * <!-- begin-user-doc --> The <b>Factory</b> for the model. It provides a create method for each + * non-abstract class of the model. <!-- end-user-doc --> + * + * @see org.framed.orm.transformation.test.model.test.TestPackage + * @generated + */ +public interface TestFactory extends EFactory { + /** + * The singleton instance of the factory. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + TestFactory eINSTANCE = org.framed.orm.transformation.test.model.test.impl.TestFactoryImpl.init(); + + /** + * Returns a new object of class '<em>Case</em>'. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @return a new object of class '<em>Case</em>'. + * @generated + */ + TestCase createTestCase(); + + /** + * Returns the package supported by this factory. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @return the package supported by this factory. + * @generated + */ + TestPackage getTestPackage(); + +} // TestFactory diff --git a/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/TestPackage.java b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/TestPackage.java new file mode 100644 index 0000000000000000000000000000000000000000..ae153829673bc5747ca19f103b086087922c658d --- /dev/null +++ b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/TestPackage.java @@ -0,0 +1,248 @@ +/** + */ +package org.framed.orm.transformation.test.model.test; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * <!-- begin-user-doc --> The <b>Package</b> for the model. It contains accessors for the meta + * objects to represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each operation of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * + * @see org.framed.orm.transformation.test.model.test.TestFactory + * @model kind="package" + * @generated + */ +public interface TestPackage extends EPackage { + /** + * The package name. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + String eNAME = "test"; + + /** + * The package namespace URI. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + String eNS_URI = "http://org.framed/testmodel"; + + /** + * The package namespace name. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + String eNS_PREFIX = "ts"; + + /** + * The singleton instance of the package. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + TestPackage eINSTANCE = org.framed.orm.transformation.test.model.test.impl.TestPackageImpl.init(); + + /** + * The meta object id for the ' + * {@link org.framed.orm.transformation.test.model.test.impl.TestCaseImpl <em>Case</em>}' class. + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @see org.framed.orm.transformation.test.model.test.impl.TestCaseImpl + * @see org.framed.orm.transformation.test.model.test.impl.TestPackageImpl#getTestCase() + * @generated + */ + int TEST_CASE = 0; + + /** + * The feature id for the '<em><b>Title</b></em>' attribute. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @generated + * @ordered + */ + int TEST_CASE__TITLE = 0; + + /** + * The feature id for the '<em><b>Description</b></em>' attribute. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @generated + * @ordered + */ + int TEST_CASE__DESCRIPTION = 1; + + /** + * The feature id for the '<em><b>Framed Model</b></em>' containment reference. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int TEST_CASE__FRAMED_MODEL = 2; + + /** + * The feature id for the '<em><b>Crom Model</b></em>' containment reference. <!-- begin-user-doc + * --> <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int TEST_CASE__CROM_MODEL = 3; + + /** + * The number of structural features of the '<em>Case</em>' class. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @generated + * @ordered + */ + int TEST_CASE_FEATURE_COUNT = 4; + + /** + * The number of operations of the '<em>Case</em>' class. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @generated + * @ordered + */ + int TEST_CASE_OPERATION_COUNT = 0; + + + /** + * Returns the meta object for class ' + * {@link org.framed.orm.transformation.test.model.test.TestCase <em>Case</em>}'. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * + * @return the meta object for class '<em>Case</em>'. + * @see org.framed.orm.transformation.test.model.test.TestCase + * @generated + */ + EClass getTestCase(); + + /** + * Returns the meta object for the attribute ' + * {@link org.framed.orm.transformation.test.model.test.TestCase#getTitle <em>Title</em>}'. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * + * @return the meta object for the attribute '<em>Title</em>'. + * @see org.framed.orm.transformation.test.model.test.TestCase#getTitle() + * @see #getTestCase() + * @generated + */ + EAttribute getTestCase_Title(); + + /** + * Returns the meta object for the attribute ' + * {@link org.framed.orm.transformation.test.model.test.TestCase#getDescription + * <em>Description</em>}'. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @return the meta object for the attribute '<em>Description</em>'. + * @see org.framed.orm.transformation.test.model.test.TestCase#getDescription() + * @see #getTestCase() + * @generated + */ + EAttribute getTestCase_Description(); + + /** + * Returns the meta object for the containment reference ' + * {@link org.framed.orm.transformation.test.model.test.TestCase#getFramedModel + * <em>Framed Model</em>}'. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @return the meta object for the containment reference '<em>Framed Model</em>'. + * @see org.framed.orm.transformation.test.model.test.TestCase#getFramedModel() + * @see #getTestCase() + * @generated + */ + EReference getTestCase_FramedModel(); + + /** + * Returns the meta object for the containment reference ' + * {@link org.framed.orm.transformation.test.model.test.TestCase#getCromModel <em>Crom Model</em>} + * '. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @return the meta object for the containment reference '<em>Crom Model</em>'. + * @see org.framed.orm.transformation.test.model.test.TestCase#getCromModel() + * @see #getTestCase() + * @generated + */ + EReference getTestCase_CromModel(); + + /** + * Returns the factory that creates the instances of the model. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @return the factory that creates the instances of the model. + * @generated + */ + TestFactory getTestFactory(); + + /** + * <!-- begin-user-doc --> Defines literals for the meta objects that represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each operation of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * + * @generated + */ + interface Literals { + /** + * The meta object literal for the ' + * {@link org.framed.orm.transformation.test.model.test.impl.TestCaseImpl <em>Case</em>}' class. + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @see org.framed.orm.transformation.test.model.test.impl.TestCaseImpl + * @see org.framed.orm.transformation.test.model.test.impl.TestPackageImpl#getTestCase() + * @generated + */ + EClass TEST_CASE = eINSTANCE.getTestCase(); + + /** + * The meta object literal for the '<em><b>Title</b></em>' attribute feature. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + EAttribute TEST_CASE__TITLE = eINSTANCE.getTestCase_Title(); + + /** + * The meta object literal for the '<em><b>Description</b></em>' attribute feature. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + EAttribute TEST_CASE__DESCRIPTION = eINSTANCE.getTestCase_Description(); + + /** + * The meta object literal for the '<em><b>Framed Model</b></em>' containment reference feature. + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + EReference TEST_CASE__FRAMED_MODEL = eINSTANCE.getTestCase_FramedModel(); + + /** + * The meta object literal for the '<em><b>Crom Model</b></em>' containment reference feature. + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + EReference TEST_CASE__CROM_MODEL = eINSTANCE.getTestCase_CromModel(); + + } + +} // TestPackage diff --git a/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/impl/TestCaseImpl.java b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/impl/TestCaseImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..02a78623450aeb96693904c7146cead8c6666ff4 --- /dev/null +++ b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/impl/TestCaseImpl.java @@ -0,0 +1,394 @@ +/** + */ +package org.framed.orm.transformation.test.model.test.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.framed.iorm.model.Model; + +import org.framed.orm.transformation.test.model.test.TestCase; +import org.framed.orm.transformation.test.model.test.TestPackage; + +/** + * <!-- begin-user-doc --> An implementation of the model object '<em><b>Case</b></em>'. <!-- + * end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.framed.orm.transformation.test.model.test.impl.TestCaseImpl#getTitle <em>Title + * </em>}</li> + * <li>{@link org.framed.orm.transformation.test.model.test.impl.TestCaseImpl#getDescription <em> + * Description</em>}</li> + * <li>{@link org.framed.orm.transformation.test.model.test.impl.TestCaseImpl#getFramedModel <em> + * Framed Model</em>}</li> + * <li>{@link org.framed.orm.transformation.test.model.test.impl.TestCaseImpl#getCromModel <em>Crom + * Model</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class TestCaseImpl extends MinimalEObjectImpl.Container implements TestCase { + /** + * The default value of the '{@link #getTitle() <em>Title</em>}' attribute. <!-- begin-user-doc + * --> <!-- end-user-doc --> + * + * @see #getTitle() + * @generated + * @ordered + */ + protected static final String TITLE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getTitle() <em>Title</em>}' attribute. <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see #getTitle() + * @generated + * @ordered + */ + protected String title = TITLE_EDEFAULT; + + /** + * The default value of the '{@link #getDescription() <em>Description</em>}' attribute. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * + * @see #getDescription() + * @generated + * @ordered + */ + protected static final String DESCRIPTION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * + * @see #getDescription() + * @generated + * @ordered + */ + protected String description = DESCRIPTION_EDEFAULT; + + /** + * The cached value of the '{@link #getFramedModel() <em>Framed Model</em>}' containment + * reference. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @see #getFramedModel() + * @generated + * @ordered + */ + protected Model framedModel; + + /** + * The cached value of the '{@link #getCromModel() <em>Crom Model</em>}' containment reference. + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @see #getCromModel() + * @generated + * @ordered + */ + protected crom_l1_composed.Model cromModel; + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + protected TestCaseImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return TestPackage.Literals.TEST_CASE; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public String getTitle() { + return title; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public void setTitle(String newTitle) { + String oldTitle = title; + title = newTitle; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.TEST_CASE__TITLE, oldTitle, + title)); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public String getDescription() { + return description; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public void setDescription(String newDescription) { + String oldDescription = description; + description = newDescription; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.TEST_CASE__DESCRIPTION, + oldDescription, description)); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public Model getFramedModel() { + return framedModel; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public NotificationChain basicSetFramedModel(Model newFramedModel, NotificationChain msgs) { + Model oldFramedModel = framedModel; + framedModel = newFramedModel; + if (eNotificationRequired()) { + ENotificationImpl notification = + new ENotificationImpl(this, Notification.SET, TestPackage.TEST_CASE__FRAMED_MODEL, + oldFramedModel, newFramedModel); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public void setFramedModel(Model newFramedModel) { + if (newFramedModel != framedModel) { + NotificationChain msgs = null; + if (framedModel != null) + msgs = + ((InternalEObject) framedModel).eInverseRemove(this, EOPPOSITE_FEATURE_BASE + - TestPackage.TEST_CASE__FRAMED_MODEL, null, msgs); + if (newFramedModel != null) + msgs = + ((InternalEObject) newFramedModel).eInverseAdd(this, EOPPOSITE_FEATURE_BASE + - TestPackage.TEST_CASE__FRAMED_MODEL, null, msgs); + msgs = basicSetFramedModel(newFramedModel, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.TEST_CASE__FRAMED_MODEL, + newFramedModel, newFramedModel)); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public crom_l1_composed.Model getCromModel() { + return cromModel; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public NotificationChain basicSetCromModel(crom_l1_composed.Model newCromModel, + NotificationChain msgs) { + crom_l1_composed.Model oldCromModel = cromModel; + cromModel = newCromModel; + if (eNotificationRequired()) { + ENotificationImpl notification = + new ENotificationImpl(this, Notification.SET, TestPackage.TEST_CASE__CROM_MODEL, + oldCromModel, newCromModel); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public void setCromModel(crom_l1_composed.Model newCromModel) { + if (newCromModel != cromModel) { + NotificationChain msgs = null; + if (cromModel != null) + msgs = + ((InternalEObject) cromModel).eInverseRemove(this, EOPPOSITE_FEATURE_BASE + - TestPackage.TEST_CASE__CROM_MODEL, null, msgs); + if (newCromModel != null) + msgs = + ((InternalEObject) newCromModel).eInverseAdd(this, EOPPOSITE_FEATURE_BASE + - TestPackage.TEST_CASE__CROM_MODEL, null, msgs); + msgs = basicSetCromModel(newCromModel, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, TestPackage.TEST_CASE__CROM_MODEL, + newCromModel, newCromModel)); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, + NotificationChain msgs) { + switch (featureID) { + case TestPackage.TEST_CASE__FRAMED_MODEL: + return basicSetFramedModel(null, msgs); + case TestPackage.TEST_CASE__CROM_MODEL: + return basicSetCromModel(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case TestPackage.TEST_CASE__TITLE: + return getTitle(); + case TestPackage.TEST_CASE__DESCRIPTION: + return getDescription(); + case TestPackage.TEST_CASE__FRAMED_MODEL: + return getFramedModel(); + case TestPackage.TEST_CASE__CROM_MODEL: + return getCromModel(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case TestPackage.TEST_CASE__TITLE: + setTitle((String) newValue); + return; + case TestPackage.TEST_CASE__DESCRIPTION: + setDescription((String) newValue); + return; + case TestPackage.TEST_CASE__FRAMED_MODEL: + setFramedModel((Model) newValue); + return; + case TestPackage.TEST_CASE__CROM_MODEL: + setCromModel((crom_l1_composed.Model) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case TestPackage.TEST_CASE__TITLE: + setTitle(TITLE_EDEFAULT); + return; + case TestPackage.TEST_CASE__DESCRIPTION: + setDescription(DESCRIPTION_EDEFAULT); + return; + case TestPackage.TEST_CASE__FRAMED_MODEL: + setFramedModel((Model) null); + return; + case TestPackage.TEST_CASE__CROM_MODEL: + setCromModel((crom_l1_composed.Model) null); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case TestPackage.TEST_CASE__TITLE: + return TITLE_EDEFAULT == null ? title != null : !TITLE_EDEFAULT.equals(title); + case TestPackage.TEST_CASE__DESCRIPTION: + return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT + .equals(description); + case TestPackage.TEST_CASE__FRAMED_MODEL: + return framedModel != null; + case TestPackage.TEST_CASE__CROM_MODEL: + return cromModel != null; + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (title: "); + result.append(title); + result.append(", description: "); + result.append(description); + result.append(')'); + return result.toString(); + } + +} // TestCaseImpl diff --git a/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/impl/TestFactoryImpl.java b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/impl/TestFactoryImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..7d284afdeded9525e92fe34be170a092ad1750c4 --- /dev/null +++ b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/impl/TestFactoryImpl.java @@ -0,0 +1,94 @@ +/** + */ +package org.framed.orm.transformation.test.model.test.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +import org.framed.orm.transformation.test.model.test.*; + +/** + * <!-- begin-user-doc --> An implementation of the model <b>Factory</b>. <!-- end-user-doc --> + * + * @generated + */ +public class TestFactoryImpl extends EFactoryImpl implements TestFactory { + /** + * Creates the default factory implementation. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public static TestFactory init() { + try { + TestFactory theTestFactory = + (TestFactory) EPackage.Registry.INSTANCE.getEFactory(TestPackage.eNS_URI); + if (theTestFactory != null) { + return theTestFactory; + } + } catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new TestFactoryImpl(); + } + + /** + * Creates an instance of the factory. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public TestFactoryImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case TestPackage.TEST_CASE: + return createTestCase(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + + "' is not a valid classifier"); + } + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public TestCase createTestCase() { + TestCaseImpl testCase = new TestCaseImpl(); + return testCase; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public TestPackage getTestPackage() { + return (TestPackage) getEPackage(); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @deprecated + * @generated + */ + @Deprecated + public static TestPackage getPackage() { + return TestPackage.eINSTANCE; + } + +} // TestFactoryImpl diff --git a/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/impl/TestPackageImpl.java b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/impl/TestPackageImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..67c82d9f6d083b44734bb589fe89fc5a828bb038 --- /dev/null +++ b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/impl/TestPackageImpl.java @@ -0,0 +1,238 @@ +/** + */ +package org.framed.orm.transformation.test.model.test.impl; + +import crom_l1_composed.Crom_l1_composedPackage; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +import org.framed.iorm.model.OrmPackage; + +import org.framed.orm.transformation.test.model.test.TestCase; +import org.framed.orm.transformation.test.model.test.TestFactory; +import org.framed.orm.transformation.test.model.test.TestPackage; + +/** + * <!-- begin-user-doc --> An implementation of the model <b>Package</b>. <!-- end-user-doc --> + * + * @generated + */ +public class TestPackageImpl extends EPackageImpl implements TestPackage { + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + private EClass testCaseEClass = null; + + /** + * Creates an instance of the model <b>Package</b>, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package package URI + * value. + * <p> + * Note: the correct way to create the package is via the static factory method {@link #init + * init()}, which also performs initialization of the package, or returns the registered package, + * if one already exists. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.framed.orm.transformation.test.model.test.TestPackage#eNS_URI + * @see #init() + * @generated + */ + private TestPackageImpl() { + super(eNS_URI, TestFactory.eINSTANCE); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon + * which it depends. + * + * <p> + * This method is used to initialize {@link TestPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain + * the package. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static TestPackage init() { + if (isInited) + return (TestPackage) EPackage.Registry.INSTANCE.getEPackage(TestPackage.eNS_URI); + + // Obtain or create and register package + TestPackageImpl theTestPackage = + (TestPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof TestPackageImpl ? EPackage.Registry.INSTANCE + .get(eNS_URI) : new TestPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + Crom_l1_composedPackage.eINSTANCE.eClass(); + OrmPackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theTestPackage.createPackageContents(); + + // Initialize created meta-data + theTestPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theTestPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(TestPackage.eNS_URI, theTestPackage); + return theTestPackage; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public EClass getTestCase() { + return testCaseEClass; + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public EAttribute getTestCase_Title() { + return (EAttribute) testCaseEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public EAttribute getTestCase_Description() { + return (EAttribute) testCaseEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public EReference getTestCase_FramedModel() { + return (EReference) testCaseEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public EReference getTestCase_CromModel() { + return (EReference) testCaseEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public TestFactory getTestFactory() { + return (TestFactory) getEFactoryInstance(); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is guarded to have no affect on any + * invocation but its first. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public void createPackageContents() { + if (isCreated) + return; + isCreated = true; + + // Create classes and their features + testCaseEClass = createEClass(TEST_CASE); + createEAttribute(testCaseEClass, TEST_CASE__TITLE); + createEAttribute(testCaseEClass, TEST_CASE__DESCRIPTION); + createEReference(testCaseEClass, TEST_CASE__FRAMED_MODEL); + createEReference(testCaseEClass, TEST_CASE__CROM_MODEL); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This method is guarded to have + * no affect on any invocation but its first. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) + return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + OrmPackage theOrmPackage = + (OrmPackage) EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI); + Crom_l1_composedPackage theCrom_l1_composedPackage = + (Crom_l1_composedPackage) EPackage.Registry.INSTANCE + .getEPackage(Crom_l1_composedPackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + + // Initialize classes, features, and operations; add parameters + initEClass(testCaseEClass, TestCase.class, "TestCase", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getTestCase_Title(), ecorePackage.getEString(), "title", null, 0, 1, + TestCase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getTestCase_Description(), ecorePackage.getEString(), "description", null, 0, 1, + TestCase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getTestCase_FramedModel(), theOrmPackage.getModel(), null, "framedModel", null, + 0, 1, TestCase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getTestCase_CromModel(), theCrom_l1_composedPackage.getModel(), null, + "cromModel", null, 0, 1, TestCase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + } + +} // TestPackageImpl diff --git a/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/testgeneration/ConfigGenerator.java b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/testgeneration/ConfigGenerator.java new file mode 100644 index 0000000000000000000000000000000000000000..c99ef52c01aba1092b0a804b68b57fe50db8b9f7 --- /dev/null +++ b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/testgeneration/ConfigGenerator.java @@ -0,0 +1,302 @@ +package org.framed.orm.transformation.test.model.test.testgeneration; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.BitSet; +import java.util.List; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Platform; +import org.framed.iorm.ui.exceptions.FeatureModelNotReadableException; +import org.framed.iorm.ui.literals.URLLiterals; +import org.osgi.framework.Bundle; + +import de.ovgu.featureide.fm.core.base.IFeatureModel; +import de.ovgu.featureide.fm.core.configuration.Configuration; +import de.ovgu.featureide.fm.core.configuration.SelectableFeature; +import de.ovgu.featureide.fm.core.configuration.Selection; +import de.ovgu.featureide.fm.core.io.UnsupportedModelException; +import de.ovgu.featureide.fm.core.io.manager.FeatureModelManager; + +/** + * @author Kevin Kassin<br> + * This class generate valid feature configurations in structured manner to test transformations.<br> + * config[index] = features<br> + ------------------------<br> + config[0] = Role_Properties, Role_Behavior<br> + config[1] = Role_Inheritance<br> + config[2] = Compartments<br> + config[3] = Dates<br> + config[4] = Role_Implication<br> + config[5] = Role_Prohibtion<br> + config[6] = Role_Equivalence<br> + config[7] = Group_Constraints<br> + config[8] = Occurence_Constraints<br> + config[9] = Relationship<br> + config[10] = Relationship_Cardinality<br> + config[11] = Intra_Relationship_Constraints<br> + config[12] = Inter_Relationship_Constraints<br> + config[13] = Compartment_Types<br> + config[14] = Compartment_Properties, Compartment_Behavior<br> + config[15] = Compartment_Inheritance<br> + config[16] = Playable_By_Defining_Compartment<br> + config[17] = Data_Types<br> + config[18] = Data_Type_Inheritance + */ +public class ConfigGenerator { + /** + * requirementConfigTuple, list of requirement with its corresponding configurations + */ + public static List<String> rCT; + + /** + * list of configurations + */ + public static List<String> configList; + + /** + * reduced number of feature, which are relevant to test the transformations + */ + public static int reducedFeatures=19; + + /** + * the file of the corresponding feature model. + */ + File featureModelFile = null; + + /** + * the actual feature model used for the configuration + */ + private IFeatureModel featureModel; + + /** + * URLs to the feature model and its standard configuration gathered from {@link URLLiterals} + */ + private final URL URL_TO_FEATUREMODEL = URLLiterals.URL_TO_FEATUREMODEL; + + /** + * Constructor + */ + public ConfigGenerator() { + rCT=calculateRequirementConfigTuple(); + configList = new ArrayList<String>(); + } + + /** + * This method transforms a BitSet to a String + * @param bitSet_config + * @return configuration in form of a bit string + */ + public String bitSetToString(BitSet bitSet_config) { + String str_config=""; + for(int i=0; i<ConfigGenerator.reducedFeatures; i++) str_config = str_config + "0"; + for(int i=0; i<ConfigGenerator.reducedFeatures; i++) { + if(bitSet_config.get(i)) { + if(i==0) str_config = "1" + str_config.substring(1); + else if(i==ConfigGenerator.reducedFeatures) str_config = str_config.substring(0, ConfigGenerator.reducedFeatures-1) + "1"; + else str_config = str_config.substring(0, i) + "1" + str_config.substring(i+1); + } + } + return str_config; + } + + /** + * This method shifts the values of a BitSet to most right bits + * @param bitset + * @return shifted BitSet + */ + public BitSet shiftBitSet(BitSet bitset) { + BitSet bitSetCopy = new BitSet(reducedFeatures); + int j=bitset.length()-1; + for(int i=reducedFeatures-bitset.length(); i<reducedFeatures; i++) { + if(bitset.get(j)) bitSetCopy.set(i); + j--; + } + return bitSetCopy; + } + + /** + * Reads the included Feature Model from the bundle org.framed.orm.featuremodel + * + * @throws FileNotFoundException + * @throws UnsupportedModelException + */ + public void readFeatureModel() throws FileNotFoundException, UnsupportedModelException { + File featureModelFile = null; + try { + featureModelFile = new File(FileLocator.resolve(URL_TO_FEATUREMODEL).toURI()); + } catch (URISyntaxException | IOException e) { e.printStackTrace(); } + FeatureModelManager featureModelManager = FeatureModelManager.getInstance(featureModelFile.toPath()); + if(featureModelManager.getLastProblems().containsError()) { + throw new FeatureModelNotReadableException(); + } + featureModel = featureModelManager.getObject(); + } + + /** + * Set Requirements that are used to generate valid configurations that cover every requirement.<br> + * <br> + * <!-- begin-user-doc --> + * Example 1<br> + * ---------<br> + * indexes in the strings are the same as listed as above in this class.<br> + * <br> + * Role Implication (Bit 4) Implies Role Equivalence (Bit 6)<br> + * rCT.add("****1*1************"); //R9: role implications are transformed<br> + * <br> + * If Role Implication is not transformed, Feature Role Equivalence can be choosen or not<br> + * rCT.add("****0*0************"); //R10_1: role implications are not transformed<br> + * rCT.add("****0*1************"); //R10_2<br> + * <br> + * Example 2<br> + * ---------<br> + * Playable_By_Defining_Compartment (Bit 16) implies Compartments (Bit 2) and Compartment_Types (Bit 13)<br> + * rCT.add("**1**********1**1**"); //R31: fulfillments of compartment to its self are transformed<br> + * <br> + * If Playable_By_Defining_Compartment is not choosen, Compartments and Compartment_Types can be choosen<br> + * Compartments imples Compartment_Types<br> + * rCT.add("**0**********0**0**"); //R32_1: fulfillments of compartment to its self are not transformed<br> + * rCT.add("**0**********1**0**"); //R32_2<br> + * rCT.add("**1**********1**0**"); //R32_3<br> + * <!-- end-user-doc --> + * @return list of requirements and its corresponding configurations + */ + public static List<String> calculateRequirementConfigTuple() { + rCT = new ArrayList<String>();//rCT = requirementConfigTuple + + //set requirements and their relevant feature configuration + rCT.add("1******************"); //Requirement 1: role properties and operations are transformed + rCT.add("0******************"); //R2: role properties and operations are not transformed + rCT.add("*1*****************"); //R3: role inheritances are transformed + rCT.add("*0*****************"); //R4: role inheritances are not transformed + rCT.add("**1**********1*****"); //R5: fulfillments with compartment types as player are transformed + rCT.add("**0**********0*****"); //R6_1: fulfillments with compartment types as player are not transformed + rCT.add("**0**********1*****"); //R6_2 + rCT.add("***1**********1****"); //R7: fulfillments with data types as player are transformed + rCT.add("***0**********0****"); //R8_1: fulfillments with data types as player are not transformed + rCT.add("***0**********1****"); //R8_2 + rCT.add("****1*1************"); //R9: role implications are transformed + rCT.add("****0*0************"); //R10_1: role implications are not transformed + rCT.add("****0*1************"); //R10_2 + rCT.add("*****1*************"); //R11: role prohibitions are transformed + rCT.add("*****0*************"); //R12: role prohibitions are not transformed + //R13_1: role equivalences are transformed = R9 + //R13_2 = R10_2 + //R14: role equivalences are not transformed = R10_1 + rCT.add("*******1***********"); //R15: group constraints are transformed + rCT.add("*******0***********"); //R16: group constraints are not transformed + rCT.add("********1**********"); //R17: occurrence constraints are transformed + rCT.add("********0**********"); //R18: occurrence constraints are not transformed + rCT.add("*********1000******"); //R19_1: relationships are transformed + rCT.add("*********1001******"); //R19_2 connected to its child + rCT.add("*********1010******"); //R19_3 features, every combination + rCT.add("*********1011******"); //R19_4 of child features used + rCT.add("*********1100******"); //R19_5 + rCT.add("*********1101******"); //R19_6 + rCT.add("*********1110******"); //R19_7 + rCT.add("*********1111******"); //R19_8 + rCT.add("*********0000******"); //R20: relationships are not transformed + rCT.add("*********11********"); //R21: relationship cardinalities are transformed + rCT.add("*********00********"); //R22_1: relationship cardinalities are not transformed + rCT.add("*********10********"); //R22_2 + rCT.add("*********1*1*******"); //R23: relationship cardinalities are transformed + rCT.add("*********0*0*******"); //R24_1: relationship cardinalities are not transformed + rCT.add("*********1*0*******"); //R24_2 + rCT.add("*********1**1******"); //R25: relationship cardinalities are transformed + rCT.add("*********0**0******"); //R26_1: relationship cardinalities are not transformed + rCT.add("*********1**0******"); //R26_2 + rCT.add("*************11****"); //R27: compartment type attributes and operations are transformed + rCT.add("*************00****"); //R28_1: compartment type attributes and operations are not transformed + rCT.add("*************10****"); //R28_2 + rCT.add("*************1*1***"); //R29: compartment inheritance are transformed + rCT.add("*************0*0***"); //R30_1: compartment inheritance are not transformed + rCT.add("*************1*0***"); //R30_2 + rCT.add("**1**********1**1**"); //R31: fulfillments of compartment to its self are transformed + rCT.add("**0**********0**0**"); //R32_1: fulfillments of compartment to its self are not transformed + rCT.add("**0**********1**0**"); //R32_2 + rCT.add("**1**********1**0**"); //R32_3 + rCT.add("*****************11"); //R33_1: data types are transformed + rCT.add("*****************10"); //R33_2 + rCT.add("*****************00"); //R34: data types are not transformed + //R35: data type inheritance are transformed = R33_1 + //R36_1: data type inheritance are not transformed = R34 + //R36_2 = R33_2 + rCT.add("0000000000000000000"); //R37_1: Corner case empty configuration + rCT.add("1111111111111111111"); //R37_2: Corner case full configuration + + return rCT; + } + + /** + * Checks if all entries of requirementConfigTuple/ rCT are used + * @param used + * @return boolean if all entries of requirementConfigTuple are used + */ + public static boolean allEntriesUsed(List<Boolean> used) { + for(boolean b : used) if(!b) return false; + return true; + } + + /** + * Calculates the configurations using requirementConfigTuple/rCT + */ + public static void calculateCofigurations() { + String config; + boolean noContradiction; + List<Boolean> used = new ArrayList<Boolean>(); + for(int h=0; h<rCT.size(); h++) used.add(false); + + while(!allEntriesUsed(used)) { + config=null; + //find first unused entry + for(String entry : rCT) { + if(!used.get(rCT.indexOf(entry)) && config==null) { + config=entry; + used.set(rCT.indexOf(entry), true); + } + } + + for(String entry : rCT) { + noContradiction=true; + //check other unused entries for contradictions + if(!used.get(rCT.indexOf(entry))) { + for(int i=0; i<reducedFeatures; i++) { + if(config.charAt(i)!='*' && entry.charAt(i)!='*' && config.charAt(i)!=entry.charAt(i)) noContradiction=false; + } + //if no contradictions, migrate the entries into each other + if(noContradiction) { + for(int j=0; j<reducedFeatures; j++) { + if(config.charAt(j)=='*') + if(j==reducedFeatures-1) config = config.substring(0, j) + entry.charAt(j); + else if(j==0) config = entry.charAt(j) + config.substring(j+1); + else config = config.substring(0, j) + entry.charAt(j) + config.substring(j+1); + } + used.set(rCT.indexOf(entry), true); + } + } + } + config = config.replace('*', '0'); + configList.add(config); + } + } + + /** + * This method creates valid configurations; + * @return List of valid configurations + * @throws UnsupportedModelException + * @throws FileNotFoundException + */ + public List<BitSet> generateConfigurations() throws FileNotFoundException, UnsupportedModelException { + List<BitSet> bitSet_configList = new ArrayList<BitSet>(); + + calculateCofigurations(); + + for(String str_config : configList) + bitSet_configList.add(shiftBitSet(BitSet.valueOf(new long[]{Integer.parseInt(str_config, 2)}))); + return bitSet_configList; + } +} diff --git a/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/testgeneration/TestGenerator.java b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/testgeneration/TestGenerator.java new file mode 100644 index 0000000000000000000000000000000000000000..47178136ef66f09a59b9d804a6307689dcbfba39 --- /dev/null +++ b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/testgeneration/TestGenerator.java @@ -0,0 +1,554 @@ +package org.framed.orm.transformation.test.model.test.testgeneration; + +import java.io.File; +import java.io.IOException; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.BitSet; +import java.util.Collections; +import java.util.List; + +import org.eclipse.core.runtime.FileLocator; +import org.eclipse.core.runtime.Platform; +import org.eclipse.emf.common.util.EList; +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.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.framed.iorm.featuremodel.FRaMEDFeature; +import org.framed.orm.transformation.test.model.test.TestCase; +import org.osgi.framework.Bundle; + +import crom_l1_composed.*; +import de.ovgu.featureide.fm.core.io.UnsupportedModelException; + +/** + * @author Kevin Kassin + * This generates test cases in the folder "Generated" based on baseTest.xmi + */ +public class TestGenerator { + + /** + * Object that creates configurations for test cases + */ + public ConfigGenerator configGenerator; + + /** + * This method takes the basic test case to generate test cases influenced by an feature configuration. + * @param testcase + * @throws IOException + * @throws URISyntaxException + * @throws UnsupportedModelException + */ + public void generateTestCases() throws IOException, URISyntaxException, UnsupportedModelException { + /*List<BitSet> configList = new ArrayList<BitSet>(); + configGenerator = new ConfigGenerator(); + Bundle bundle = Platform.getBundle("org.framed.orm.transformation.test"); + URL fileURL = bundle.getEntry("testcases/Generated/baseTest.xmi"); + File file = new File(FileLocator.resolve(fileURL).toURI()); + String str_config; + + TestCase testCase = loadTestCase(file); + configList = configGenerator.generateConfigurations(); + for(BitSet config : configList) { + testCase = loadTestCase(file); + + //delete feature entries in framed model depending on configuration + testCase = editFeatureConfiguration(testCase, config); + //change crom model depending on configuration + testCase = editCromModel(testCase, config); + //change title and description of the generated testcase + testCase = editTitle(testCase, config); + testCase = editDescription(testCase, config); + + str_config=configGenerator.bitSetToString(config); + + URI fileURI = URI.createFileURI("testcases/Generated/" + str_config + ".xmi"); + createTestFile(testCase, fileURI); + }*/ + } + + /** + * Edits the title of the given testCase depending on the given configuration + * @param testCase + * @param config + * @return changed testCase + */ + public TestCase editTitle(TestCase testCase, BitSet config) { + testCase.setTitle("Generated test " + configGenerator.bitSetToString(config)); + return testCase; + } + + /** + * Edits the description of the given testCase depending on the given configuration + * @param testCase + * @param config + * @return changed testCase + */ + public TestCase editDescription(TestCase testCase, BitSet config) { + String description; + boolean firstFeature=true; + description = "This test was generated. The following features are choosen: "; + for(FRaMEDFeature feature : testCase.getFramedModel().getFramedConfiguration().getFeatures()) { + if(!firstFeature) description = description + ", "; + description = description + feature.getName(); + firstFeature=false; + } + testCase.setDescription(description); + return testCase; + } + + /** + * Edits the feature list/ framed configuration of the given testCase depending on the given configuration + * @param testCase + * @param config + * @return changed testCase + */ + public TestCase editFeatureConfiguration(TestCase testCase, BitSet config) { + EList<FRaMEDFeature> featureList = testCase.getFramedModel().getFramedConfiguration().getFeatures(); + + if(!config.get(0) && !config.get(1)) featureList.remove(getFeatureNumber("Role_Structure", featureList)); + if(!config.get(0)) { + featureList.remove(getFeatureNumber("Role_Properties", featureList)); + featureList.remove(getFeatureNumber("Role_Behavior", featureList)); } + if(!config.get(1)) featureList.remove(getFeatureNumber("Role_Inheritance", featureList)); + if(!config.get(2)) featureList.remove(getFeatureNumber("Compartments", featureList)); + if(!config.get(3)) featureList.remove(getFeatureNumber("Dates", featureList)); + if(!config.get(4) && !config.get(5) && !config.get(6) && !config.get(7) && !config.get(8)) + featureList.remove(getFeatureNumber("Role_Constraints", featureList)); + if(!config.get(4)) featureList.remove(getFeatureNumber("Role_Implication", featureList)); + if(!config.get(5)) featureList.remove(getFeatureNumber("Role_Prohibition", featureList)); + if(!config.get(6)) featureList.remove(getFeatureNumber("Role_Equivalence", featureList)); + if(!config.get(7)) featureList.remove(getFeatureNumber("Group_Constraints", featureList)); + if(!config.get(8)) featureList.remove(getFeatureNumber("Occurrence_Constraints", featureList)); + if(!config.get(9) && !config.get(13)) featureList.remove(getFeatureNumber("Dependent", featureList)); + if(!config.get(9)) { + featureList.remove(getFeatureNumber("On_Relationships", featureList)); + featureList.remove(getFeatureNumber("Relationships", featureList)); } + if(!config.get(10) && !config.get(11) && !config.get(12)) + featureList.remove(getFeatureNumber("Relationship_Constraints", featureList)); + if(!config.get(10)) featureList.remove(getFeatureNumber("Relationship_Cardinality", featureList)); + if(!config.get(11)) { + featureList.remove(getFeatureNumber("Intra_Relationship_Constraints", featureList)); + featureList.remove(getFeatureNumber("Parthood_Constraints", featureList)); } + if(!config.get(12)) featureList.remove(getFeatureNumber("Inter_Relationship_Constraints", featureList)); + if(!config.get(13)) { + featureList.remove(getFeatureNumber("On_Compartments", featureList)); + featureList.remove(getFeatureNumber("Compartment_Types", featureList));} + if(!config.get(14) && !config.get(15)) { + featureList.remove(getFeatureNumber("Compartment_Structure", featureList)); + } + if(!config.get(14)) { + featureList.remove(getFeatureNumber("Compartment_Properties", featureList)); + featureList.remove(getFeatureNumber("Compartment_Behavior", featureList)); + } + if(!config.get(15)) featureList.remove(getFeatureNumber("Compartment_Inheritance", featureList)); + if(!config.get(16)) { + featureList.remove(getFeatureNumber("Participants", featureList)); + featureList.remove(getFeatureNumber("Playable_by_Defining_Compartment", featureList));} + if(!config.get(17)) featureList.remove(getFeatureNumber("Data_Types", featureList)); + if(!config.get(18)) featureList.remove(getFeatureNumber("Data_Type_Inheritance", featureList)); + return testCase; + } + + /** + * Edits the crom model of the given testCase depending on the given configuration + * @param testCase + * @param config + * @return changed testCase + */ + public TestCase editCromModel(TestCase testCase, BitSet config) { + EList<crom_l1_composed.ModelElement> cromElements = testCase.getCromModel().getElements(); + List<crom_l1_composed.ModelElement> ElementsToDelete = new ArrayList<crom_l1_composed.ModelElement>(); + List<crom_l1_composed.ModelElement> ElementsToDeleteFromGroup = new ArrayList<crom_l1_composed.ModelElement>(); + List<Constraint> ConstraintsToDelete = new ArrayList<Constraint>(); + List<Relation> RelationsToDelete = new ArrayList<Relation>(); + List<Relationship> RelationshipsToDelete = new ArrayList<Relationship>(); + + //Properties and Behavior + //----------------------- + //Role_Properties, Role_Behavior + if(!config.get(0)) { + //find compartment types + for(crom_l1_composed.ModelElement element : cromElements) { + if(element instanceof crom_l1_composed.CompartmentType) { + //find roles + for(Part part : ((crom_l1_composed.CompartmentType) element).getParts()) { + if(part.getRole() instanceof crom_l1_composed.RoleType) + DeleteAttributesAndOperationFromRole((crom_l1_composed.RoleType) part.getRole()); + if(part.getRole() instanceof crom_l1_composed.RoleGroup) { + //iterate over RoleGroup elements + for(RoleGroupElement roleGroupElement : ((crom_l1_composed.RoleGroup) part.getRole()).getElements()) { + if(roleGroupElement instanceof crom_l1_composed.RoleType) + DeleteAttributesAndOperationFromRole((crom_l1_composed.RoleType) roleGroupElement); + if(roleGroupElement instanceof crom_l1_composed.RoleGroup) + TraverseInRoleGroups((crom_l1_composed.RoleGroup) roleGroupElement); + }}}}}} + + //Compartment_Types, Compartment_Behavior, Compartment_Properties + if(!config.get(14)) { + //find compartments + for(crom_l1_composed.ModelElement element : cromElements) { + //delete the attributes and operations + if(element instanceof crom_l1_composed.CompartmentType) { + ((crom_l1_composed.CompartmentType) element).getAttributes().clear(); + ((crom_l1_composed.CompartmentType) element).getOperations().clear(); + }}} + + //Constraints + //----------- + //Role_Implication + if(!config.get(4)) { + changeRoleConstraints("RoleImplication", cromElements); + } + + //Role_Prohibition + if(!config.get(5)) { + changeRoleConstraints("RoleProhibition", cromElements); + } + + //Role_Equivalence + if(!config.get(6)) { + changeRoleConstraints("RoleEquivalence", cromElements); + } + + //Group_Constraints + if(!config.get(7)) { + //find compartment types + for(crom_l1_composed.ModelElement element : cromElements) { + if(element instanceof crom_l1_composed.CompartmentType) { + //find roleGroups + for(Part part : ((crom_l1_composed.CompartmentType) element).getParts()) { + if(part.getRole() instanceof crom_l1_composed.RoleGroup) { + //delete group constraints + ((crom_l1_composed.RoleGroup) part.getRole()).setLower(0); + ((crom_l1_composed.RoleGroup) part.getRole()).setUpper(-1); + }}}}} + + //Occurence_Constraints + if(!config.get(8)) { + for(crom_l1_composed.ModelElement element : cromElements) { + if(element instanceof crom_l1_composed.CompartmentType) { + //find parts + for(Part part : ((crom_l1_composed.CompartmentType) element).getParts()) { + //delete occurence constraints + part.setLower(0); + part.setUpper(-1); + }}}} + + //Relationship + if(!config.get(9)) { + //find all relationships, delete them + for(crom_l1_composed.ModelElement element : cromElements) { + if(element instanceof crom_l1_composed.CompartmentType) { + for(Relationship relationship : ((crom_l1_composed.CompartmentType) element).getRelationships()) + RelationshipsToDelete.add(relationship); + for(Relationship relation : RelationshipsToDelete) + ((crom_l1_composed.CompartmentType) element).getRelationships().remove(relation); + }}} + + //Relationship_Cardinality + if(!config.get(10)) { + //find all relationships + for(crom_l1_composed.ModelElement element : cromElements) { + if(element instanceof crom_l1_composed.CompartmentType) { + for(Relationship relationship : ((crom_l1_composed.CompartmentType) element).getRelationships()) { + //get place, set place generic + relationship.getFirst().setLower(0); + relationship.getFirst().setUpper(-1); + relationship.getSecond().setLower(0); + relationship.getSecond().setUpper(-1); + }}}} + + //Intra_Relationship_Constraints + if(!config.get(11)) { + //find all intrarelationship constraints, delete them + for(crom_l1_composed.ModelElement element : cromElements) { + if(element instanceof crom_l1_composed.CompartmentType) { + for(Relation constraint : ((crom_l1_composed.CompartmentType) element).getConstraints()) { + if(constraint instanceof crom_l1_composed.Reflexive || + constraint instanceof crom_l1_composed.Irreflexive || + constraint instanceof crom_l1_composed.Total || + constraint instanceof crom_l1_composed.Cyclic || + constraint instanceof crom_l1_composed.Acyclic) + ConstraintsToDelete.add((Constraint) constraint); + } + for(Constraint constraint : ConstraintsToDelete) + ((crom_l1_composed.CompartmentType) element).getConstraints().remove(constraint); + ConstraintsToDelete.clear(); + }}} + + //Inter_Relationship_Constraints + if(!config.get(12)) { + //find all interrelationship constraints, delete them + for(crom_l1_composed.ModelElement element : cromElements) { + if(element instanceof crom_l1_composed.CompartmentType) { + for(Relation constraint : ((crom_l1_composed.CompartmentType) element).getConstraints()) { + if(constraint instanceof crom_l1_composed.RelationshipImplication || + constraint instanceof crom_l1_composed.RelationshipExclusion ) + ConstraintsToDelete.add((Constraint) constraint); + } + for(Constraint constraint : ConstraintsToDelete) + ((crom_l1_composed.CompartmentType) element).getConstraints().remove(constraint); + }}} + + //Fulfillments + //------------ + //Compartments + if(!config.get(2)) { + //find fulfillments + for(Relation relation : testCase.getCromModel().getRelations()) { + if(relation instanceof crom_l1_composed.Fulfillment) { + //delete fulfilment if filler is compartment_type + if(((crom_l1_composed.Fulfillment) relation).getFiller() instanceof crom_l1_composed.CompartmentType) + RelationsToDelete.add(relation); + } + } + for(Relation relation : RelationsToDelete) + testCase.getCromModel().getRelations().remove(relation); + RelationsToDelete.clear(); + } + + //Dates + if(!config.get(3)) { + //find fulfillments + for(Relation relation : testCase.getCromModel().getRelations()) { + if(relation instanceof crom_l1_composed.Fulfillment) { + //delete fulfilment if filler is data type + if(((crom_l1_composed.Fulfillment) relation).getFiller() instanceof crom_l1_composed.DataType) + RelationsToDelete.add(relation); + } + } + for(Relation relation : RelationsToDelete) + testCase.getCromModel().getRelations().remove(relation); + RelationsToDelete.clear(); + } + + //Playable_By_Defining_Compartment + if(!config.get(16)) { + //find fulfillments + for(Relation relation : testCase.getCromModel().getRelations()) { + if(relation instanceof crom_l1_composed.Fulfillment) { + if(((crom_l1_composed.Fulfillment) relation).getFiller() instanceof crom_l1_composed.CompartmentType) { + //delete fulfilment if filler is compartment_type + crom_l1_composed.CompartmentType filler =(crom_l1_composed.CompartmentType) ((crom_l1_composed.Fulfillment) relation).getFiller(); + crom_l1_composed.RoleType filled = (crom_l1_composed.RoleType) ((crom_l1_composed.Fulfillment) relation).getFilled(); + //is filled role in filler compartment types + for(Part part : filler.getParts()) { + if(part.getRole() instanceof crom_l1_composed.RoleType) + if(part.getRole()==filled) RelationsToDelete.add(relation); + if(part.getRole() instanceof crom_l1_composed.RoleGroup) { + if(RoleGroupChildContainsRole((crom_l1_composed.RoleGroup) part.getRole(), filled)) + RelationsToDelete.add(relation); + }}}}} + for(Relation relation : RelationsToDelete) + testCase.getCromModel().getRelations().remove(relation); + RelationsToDelete.clear(); + } + + //Inheritances + //------------ + //Role_Inheritance + if(!config.get(1)) { + for(Relation relation : testCase.getCromModel().getRelations()) { + //find compartment inheritances, delete them + if(relation instanceof crom_l1_composed.RoleInheritance) + RelationsToDelete.add(relation); + } + for(Relation relation : RelationsToDelete) + testCase.getCromModel().getRelations().remove(relation); + RelationsToDelete.clear(); + } + + //Compartment_Inheritance + if(!config.get(15)) { + for(Relation relation : testCase.getCromModel().getRelations()) { + //find compartment inheritances, delete them + if(relation instanceof crom_l1_composed.CompartmentInheritance) + RelationsToDelete.add(relation); + } + for(Relation relation : RelationsToDelete) + testCase.getCromModel().getRelations().remove(relation); + RelationsToDelete.clear(); + } + + //Data_Type_Inheritance + if(!config.get(18)) { + for(Relation relation : testCase.getCromModel().getRelations()) { + //find data type inheritances, delete them + if(relation instanceof crom_l1_composed.DataInheritance) + RelationsToDelete.add(relation); + } + for(Relation relation : RelationsToDelete) + testCase.getCromModel().getRelations().remove(relation); + } + + //Datatype + //-------- + if(!config.get(17)) { + for(crom_l1_composed.ModelElement element : cromElements) { + //find data types, delete them + if(element instanceof crom_l1_composed.DataType) + ElementsToDelete.add(element); + if(element instanceof crom_l1_composed.Group) { + for(crom_l1_composed.ModelElement groupElement : ((crom_l1_composed.Group) element).getElements()) { + if(groupElement instanceof crom_l1_composed.DataType) + ElementsToDeleteFromGroup.add(groupElement); + if(groupElement instanceof crom_l1_composed.Group) + TraverseInGroup((crom_l1_composed.Group) groupElement); + } + for(crom_l1_composed.ModelElement elementToDelete : ElementsToDeleteFromGroup) + ((crom_l1_composed.Group) element).getElements().remove(elementToDelete); + } + } + for(crom_l1_composed.ModelElement element : ElementsToDelete) + cromElements.remove(element); + } + + return testCase; + } + + /** + * Deletes a role constraint of a type specified by constraintType from a given list of crom model elements + * @param constraintType + * @param cromElements + */ + public static void changeRoleConstraints(String constraintType, EList<crom_l1_composed.ModelElement> cromElements) { + EList<Constraint> constraints; + ArrayList<Constraint> toDelete; + + //find compartment types + for(crom_l1_composed.ModelElement element : cromElements) { + if(element instanceof crom_l1_composed.CompartmentType) { + //find constraints + constraints = ((crom_l1_composed.CompartmentType) element).getConstraints(); + toDelete = new ArrayList<Constraint>(); + for(Constraint constraint : constraints) { + //find role implications + if(constraint instanceof crom_l1_composed.RoleImplication && constraintType.equals("RoleImplication")) + toDelete.add(constraint); + if(constraint instanceof crom_l1_composed.RoleProhibition && constraintType.equals("RoleProhibition")) + toDelete.add(constraint); + if(constraint instanceof crom_l1_composed.RoleEquivalence && constraintType.equals("RoleEquivalence")) + toDelete.add(constraint); + } + //delete role implication + for(Constraint constraint : toDelete) constraints.remove(constraints.indexOf(constraint)); + }}} + + /** + * Deletes attributes and operations of a given role + * @param role + */ + public static void DeleteAttributesAndOperationFromRole(crom_l1_composed.RoleType role) { + role.getAttributes().clear(); + role.getOperations().clear(); + } + + /** + * Traverses in a given Rolegroup: delete attributes and operations in role, call method recursive for other role groups + * @param roleGroup + */ + public static void TraverseInRoleGroups(crom_l1_composed.RoleGroup roleGroup) { + for(RoleGroupElement roleGroupElement : roleGroup.getElements()) { + if(roleGroupElement instanceof crom_l1_composed.RoleType) + DeleteAttributesAndOperationFromRole((crom_l1_composed.RoleType) roleGroupElement); + if(roleGroupElement instanceof crom_l1_composed.RoleGroup) + TraverseInRoleGroups((crom_l1_composed.RoleGroup) roleGroupElement); + } + } + + /** + * Traverses in a given Group: delete data types, call method recursive for other groups + * @param group + */ + public static void TraverseInGroup(crom_l1_composed.Group group) { + List<crom_l1_composed.ModelElement> ElementsToDelete = new ArrayList<crom_l1_composed.ModelElement>(); + for(crom_l1_composed.ModelElement groupElement : group.getElements()) { + if(groupElement instanceof crom_l1_composed.DataType) { + ElementsToDelete.add(groupElement); + } + if(groupElement instanceof crom_l1_composed.Group) + TraverseInGroup((crom_l1_composed.Group) groupElement); + } + for(crom_l1_composed.ModelElement element : ElementsToDelete) { + group.getElements().remove(element); + } + } + + /** + * Checks if a played role is part of a role group of the playing compartment type itself + * @param roleGroup + * @param filled + * @return boolean if a played role is part of a role group of the playing compartment type itself + */ + public static boolean RoleGroupChildContainsRole(crom_l1_composed.RoleGroup roleGroup, crom_l1_composed.RoleType filled) { + for(RoleGroupElement roleGroupElement : roleGroup.getElements()) { + if(roleGroupElement instanceof crom_l1_composed.RoleType) + if((crom_l1_composed.RoleType) roleGroupElement==filled) return true; + if(roleGroupElement instanceof crom_l1_composed.RoleGroup) + RoleGroupChildContainsRole((crom_l1_composed.RoleGroup) roleGroupElement, filled); + } + return false; + } + + /** + * loads the {@link TestCase} of the specified {@link File}. + * @param file + * @return testcase of file + */ + private static TestCase loadTestCase(File file) { + ResourceSet resSet = new ResourceSetImpl(); + Resource res = resSet.createResource(URI.createFileURI(file.toString())); + + try { + res.load(Collections.EMPTY_MAP); + // if there are file contents in this directory + if (res.getContents().size() > 0 + && res.getContents().get(0) instanceof TestCase) { + // load test file and add it to test list + return (TestCase) res.getContents().get(0); + } + } catch (Exception e) { + System.err.println("Was not able to load testcase \"" + + file.toString() + "\" due : " + e.toString()); + for (StackTraceElement el: e.getStackTrace()) System.err.println(el.toString()); + } + return null; + } + + /** + * Stores the given test case inside the specified {@link URI} + * + * @param object {@link EObject} to be stored + * @param file {@link URI} of destination file + * @return created {@link Resource} + */ + private Resource createTestFile(TestCase testCase, URI file) { + ResourceSet set1 = new ResourceSetImpl(); + Resource res1 = set1.createResource(file); + + if (testCase != null) res1.getContents().add(EcoreUtil.copy(testCase)); + try { + res1.save(Collections.EMPTY_MAP); + } catch(IOException e) {} + return res1; + } + + /** + * This method calculates the index of the feature in the given featureList with the given featureName + * @param featureName + * @param featureList + * @return the index of the feature in the given featureList with the given featureName + */ + private static int getFeatureNumber(String featureName, EList<FRaMEDFeature> featureList) { + for(FRaMEDFeature feature : featureList) { + if(featureName.equals(feature.getName().getLiteral())) return featureList.indexOf(feature); + } + return -1; + } + +} diff --git a/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/util/TestAdapterFactory.java b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/util/TestAdapterFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..2622cbfb5c78e1e7551e416b393252ba68115975 --- /dev/null +++ b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/util/TestAdapterFactory.java @@ -0,0 +1,116 @@ +/** + */ +package org.framed.orm.transformation.test.model.test.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +import org.framed.orm.transformation.test.model.test.*; + +/** + * <!-- begin-user-doc --> The <b>Adapter Factory</b> for the model. It provides an adapter + * <code>createXXX</code> method for each class of the model. <!-- end-user-doc --> + * + * @see org.framed.orm.transformation.test.model.test.TestPackage + * @generated + */ +public class TestAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + protected static TestPackage modelPackage; + + /** + * Creates an instance of the adapter factory. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public TestAdapterFactory() { + if (modelPackage == null) { + modelPackage = TestPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. <!-- begin-user-doc --> + * This implementation returns <code>true</code> if the object is either the model's package or is + * an instance object of the model. <!-- end-user-doc --> + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject) object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the <code>createXXX</code> methods. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @generated + */ + protected TestSwitch<Adapter> modelSwitch = new TestSwitch<Adapter>() { + @Override + public Adapter caseTestCase(TestCase object) { + return createTestCaseAdapter(); + } + + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the <code>target</code>. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @param target the object to adapt. + * @return the adapter for the <code>target</code>. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject) target); + } + + + /** + * Creates a new adapter for an object of class ' + * {@link org.framed.orm.transformation.test.model.test.TestCase <em>Case</em>}'. <!-- + * begin-user-doc --> This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. <!-- + * end-user-doc --> + * + * @return the new adapter. + * @see org.framed.orm.transformation.test.model.test.TestCase + * @generated + */ + public Adapter createTestCaseAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. <!-- begin-user-doc --> This default implementation + * returns null. <!-- end-user-doc --> + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} // TestAdapterFactory diff --git a/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/util/TestSwitch.java b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/util/TestSwitch.java new file mode 100644 index 0000000000000000000000000000000000000000..05946ee576e8de659402e11911c6851065809e91 --- /dev/null +++ b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/util/TestSwitch.java @@ -0,0 +1,105 @@ +/** + */ +package org.framed.orm.transformation.test.model.test.util; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +import org.framed.orm.transformation.test.model.test.*; + +/** + * <!-- begin-user-doc --> The <b>Switch</b> for the model's inheritance hierarchy. It supports the + * call {@link #doSwitch(EObject) doSwitch(object)} to invoke the <code>caseXXX</code> method for + * each class of the model, starting with the actual class of the object and proceeding up the + * inheritance hierarchy until a non-null result is returned, which is the result of the switch. + * <!-- end-user-doc --> + * + * @see org.framed.orm.transformation.test.model.test.TestPackage + * @generated + */ +public class TestSwitch<T> extends Switch<T> { + /** + * The cached model package <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + protected static TestPackage modelPackage; + + /** + * Creates an instance of the switch. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + public TestSwitch() { + if (modelPackage == null) { + modelPackage = TestPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. <!-- begin-user-doc --> <!-- + * end-user-doc --> + * + * @parameter ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it + * yields that result. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @return the first non-null result returned by a <code>caseXXX</code> call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case TestPackage.TEST_CASE: { + TestCase testCase = (TestCase) theEObject; + T result = caseTestCase(testCase); + if (result == null) + result = defaultCase(theEObject); + return result; + } + default: + return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Case</em>'. <!-- + * begin-user-doc --> This implementation returns null; returning a non-null result will terminate + * the switch. <!-- end-user-doc --> + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Case</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseTestCase(TestCase object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. <!-- + * begin-user-doc --> This implementation returns null; returning a non-null result will terminate + * the switch, but this is the last case anyway. <!-- end-user-doc --> + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>EObject</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} // TestSwitch diff --git a/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/validation/TestCaseValidator.java b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/validation/TestCaseValidator.java new file mode 100644 index 0000000000000000000000000000000000000000..4f368102cafc18bf78447e98fdffe0cfc6f1d6c0 --- /dev/null +++ b/org.framed.orm.transformation.test/src/org/framed/orm/transformation/test/model/test/validation/TestCaseValidator.java @@ -0,0 +1,28 @@ +/** + * + * $Id$ + */ +package org.framed.orm.transformation.test.model.test.validation; + +import org.framed.iorm.model.Model; + +/** + * A sample validator interface for {@link org.framed.orm.transformation.test.model.test.TestCase}. + * This doesn't really do anything, and it's not a real EMF artifact. It was generated by the + * org.eclipse.emf.examples.generator.validator plug-in to illustrate how EMF's code generator can + * be extended. This can be disabled with -vmargs + * -Dorg.eclipse.emf.examples.generator.validator=false. + */ +public interface TestCaseValidator { + boolean validate(); + + boolean validateTitle(String value); + + boolean validateDescription(String value); + + boolean validateDesciption(String value); + + boolean validateFramedModel(Model value); + + boolean validateCromModel(crom_l1_composed.Model value); +} diff --git a/org.framed.orm.transformation.test/testcases/CompartmentType/compartmentType_test_1.xmi b/org.framed.orm.transformation.test/testcases/CompartmentType/compartmentType_test_1.xmi new file mode 100644 index 0000000000000000000000000000000000000000..12ec824cb5ecbe790cab808fb766c0a2e660fc9c --- /dev/null +++ b/org.framed.orm.transformation.test/testcases/CompartmentType/compartmentType_test_1.xmi @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.iorm.model="http://iorm/1.0" xmlns:ts="http://org.framed/testmodel"> + <title> + Simple TestCase for CompartmentTypes + </title> + <description> + This test verifies that Shapes of type CompartmentType are + converted to CompartmentTypes and still have the same name + </description> + <framedModel> + <elements xsi:type="org.framed.iorm.model:Shape" name="compartmentType"> + <firstSegment/> + <secondSegment/> + <model/> + </elements> + <elements xsi:type="org.framed.iorm.model:Shape" name="compartmentType1"> + <firstSegment/> + <secondSegment/> + <model/> + </elements> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments"/> + <features name="Dates"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication"/> + <features name="Role_Prohibition"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints"/> + <features name="Occurrence_Constraints"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints"/> + <features name="Inter_Relationship_Constraints"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance"/> + <features name="Participants"/> + <features name="Contains_Compartments"/> + <features name="Playable_by_Defining_Compartment"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:CompartmentType" name="compartmentType"/> + <elements xsi:type="crom_l1_composed:CompartmentType" name="compartmentType1"/> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/CompartmentType/compartmentType_test_1.xmi b/org.framed.orm.transformation.test/testcases1/CompartmentType/compartmentType_test_1.xmi new file mode 100644 index 0000000000000000000000000000000000000000..32d6dd9d61c18b62fc73ebaa5a934c2c86c75872 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/CompartmentType/compartmentType_test_1.xmi @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" xmlns:ts="http://org.framed/testmodel"> + <title> + Simple TestCase for CompartmentTypes + </title> + <description> + This test verifies that Shapes of type CompartmentType are + converted to CompartmentTypes and still have the same name + </description> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="CompType1" + type="CompartmentType"> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CompType2" + type="CompartmentType" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CompType1"> + </elements> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CompType2" /> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/CompartmentType/compartmentType_test_2.xmi b/org.framed.orm.transformation.test/testcases1/CompartmentType/compartmentType_test_2.xmi new file mode 100644 index 0000000000000000000000000000000000000000..4ab8162607020240d32fecb06b182c6282244b5c --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/CompartmentType/compartmentType_test_2.xmi @@ -0,0 +1,76 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" xmlns:ts="http://org.framed/testmodel"> + <title> + Simple TestCase for CompartmentTypes + </title> + <description> + This test verifies that Shapes of type CompartmentType are + converted to CompartmentTypes and still have the same name and their attributes + </description> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="CompType1" + type="CompartmentType"> + <firstSegment> + <elements name="NamedElement0 : CompType2" /> + <elements name="NamedElement1 : CompType2" /> + <elements name="NamedElement2 : CompType2" /> + <elements name="NamedElement3 : CompType2" /> + <elements name="NamedElement4 : CompType2" /> + </firstSegment> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CompType2" + type="NaturalType" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CompType1"> + <attributes name="NamedElement0" type="//@cromModel/@elements.1" /> + <attributes name="NamedElement1" type="//@cromModel/@elements.1"/> + <attributes name="NamedElement2" type="//@cromModel/@elements.1"/> + <attributes name="NamedElement3" type="//@cromModel/@elements.1"/> + <attributes name="NamedElement4" type="//@cromModel/@elements.1"/> + </elements> + <elements xsi:type="crom_l1_composed:NaturalType" name="CompType2" /> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/CompartmentType/compartmentType_test_3.xmi b/org.framed.orm.transformation.test/testcases1/CompartmentType/compartmentType_test_3.xmi new file mode 100644 index 0000000000000000000000000000000000000000..a5ca786384edff57570b4cb324b902f4d16b5eed --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/CompartmentType/compartmentType_test_3.xmi @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" xmlns:ts="http://org.framed/testmodel"> + <title> + Test for CompartmentType with a child model containing one RoleType. + </title> + <description> + This test verifies that Shapes of type CompartmentType are converted correctly, and + that referenced child elements are inserted in the CROM model as expected. + </description> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" type="CompartmentType" name="Bank"> + <model> + <elements xsi:type="org.framed.orm.model:Shape" type="RoleType" name="Consultant"> + <description name="1..*"/> + </elements> + </model> + </elements> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:CompartmentType" name="Bank"> + <parts lower="1"> + <role xsi:type="crom_l1_composed:RoleType" name="Consultant"> + </role> + </parts> + </elements> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/CompartmentType/compartmentType_test_4.xmi b/org.framed.orm.transformation.test/testcases1/CompartmentType/compartmentType_test_4.xmi new file mode 100644 index 0000000000000000000000000000000000000000..f67f79ce346f682f606a02168f670ac078442ece --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/CompartmentType/compartmentType_test_4.xmi @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" xmlns:ts="http://org.framed/testmodel"> + <title> + Test for CompartmentType with two children of type RoleType, which are in relation. + </title> + <description> + This test verifies that Shapes of type CompartmentType are converted correctly, and + that referenced child elements are inserted in the CROM model as expected. Additionally, relationships + between child elements are tested. + </description> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" type="CompartmentType" name="Bank"> + <model> + <elements xsi:type="org.framed.orm.model:Shape" type="RoleType" name="Consultant" + outgoingRelations="//@framedModel/@elements.0/@model/@elements.2"> + <description name="1..*"/> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" type="RoleType" name="Customer" + incomingRelations="//@framedModel/@elements.0/@model/@elements.2"> + <description name="0..*"/> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="testRelation" type="Relationship" + source="//@framedModel/@elements.0/@model/@elements.0" + target="//@framedModel/@elements.0/@model/@elements.1"/> + </model> + </elements> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:CompartmentType" name="Bank"> + <parts lower="1"> + <role xsi:type="crom_l1_composed:RoleType" name="Consultant" + outgoing="//@cromModel/@elements.0/@relationships.0"> + </role> + </parts> + <parts lower="0"> + <role xsi:type="crom_l1_composed:RoleType" name="Customer" + incoming="//@cromModel/@elements.0/@relationships.0"> + </role> + </parts> + <relationships name="testRelation"> + <first lower="0" holder="//@cromModel/@elements.0/@parts.0/@role"/> + <second lower="0" holder="//@cromModel/@elements.0/@parts.1/@role"/> + </relationships> + </elements> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/CompartmentType/compartmentType_test_5.xmi b/org.framed.orm.transformation.test/testcases1/CompartmentType/compartmentType_test_5.xmi new file mode 100644 index 0000000000000000000000000000000000000000..70a90afc4b7b90b712325e003a79ee031bfda68b --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/CompartmentType/compartmentType_test_5.xmi @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" xmlns:ts="http://org.framed/testmodel"> + <title> + Test for CompartmentType with a RoleGroup. + </title> + <description> + This test verifies that Shapes of type CompartmentType are converted correctly, and + that a RoleGroup is correctly transformed as child element. + </description> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" type="CompartmentType" name="Bank"> + <model> + <elements xsi:type="org.framed.orm.model:Shape" type="RoleGroup" name="RoleGroup1"> + <model> + <elements xsi:type="org.framed.orm.model:Shape" type="RoleType" name="Consultant"> + <description name="1..*"/> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" type="RoleType" name="Customer"> + <description name="0..*"/> + </elements> + </model> + </elements> + </model> + </elements> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:CompartmentType" name="Bank"> + <parts> + <role xsi:type="crom_l1_composed:RoleGroup" name="RoleGroup1"> + <elements xsi:type="crom_l1_composed:RoleType" name="Consultant"/> + <elements xsi:type="crom_l1_composed:RoleType" name="Customer"/> + </role> + </parts> + </elements> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/Fulfillment/fulfillment_test_1.xmi b/org.framed.orm.transformation.test/testcases1/Fulfillment/fulfillment_test_1.xmi new file mode 100644 index 0000000000000000000000000000000000000000..8c3eaf52c6c076f37d510d8991705116fc094d30 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Fulfillment/fulfillment_test_1.xmi @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="Simple TestCase for Fulfillments" + description="Simple TestCase for Fulfillments"> + <framedModel> + <elements + xsi:type="org.framed.orm.model:Shape" + name="NaturalType1" + outgoingRelations="//@framedModel/@elements.1" + type="NaturalType"/> + <elements + xsi:type="org.framed.orm.model:Relation" + name="testFulfillment" + type="Fulfillment" + target="//@framedModel/@elements.2" + source="//@framedModel/@elements.0" + referencedRoles="//@framedModel/@elements.2/@model/@elements.0"/> + <elements + xsi:type="org.framed.orm.model:Shape" + name="compType1" + incomingRelations="//@framedModel/@elements.1"> + <model> + <elements + xsi:type="org.framed.orm.model:Shape" + name="roleType1" + type="RoleType"/> + </model> + </elements> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements + xsi:type="crom_l1_composed:NaturalType" + name="NaturalType1"/> + <elements + xsi:type="crom_l1_composed:CompartmentType" + name="compType1"> + <parts> + <role + xsi:type="crom_l1_composed:RoleType" + name="roleType1"/> + </parts> + </elements> + <relations + xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.0/@role" + filler="//@cromModel/@elements.0"/> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/Generated/baseTest.xmi b/org.framed.orm.transformation.test/testcases1/Generated/baseTest.xmi new file mode 100644 index 0000000000000000000000000000000000000000..e3d26e3bbc868386ef62dc5e0e56cb1a34e57a57 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Generated/baseTest.xmi @@ -0,0 +1,557 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" xmlns:ts="http://org.framed/testmodel"> + <title>Base test case for generation of feature dependant tests</title> + <description> + This test is the basic test case which is used to generate other test dependant on the feature model. + It verifies as much as possible model elements. + </description> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="CompartmentA" incomingRelations="//@framedModel/@elements.10 //@framedModel/@elements.11 //@framedModel/@elements.12 //@framedModel/@elements.13" outgoingRelations="//@framedModel/@elements.12"> + <firstSegment> + <elements name="AttributeCompartmentA : String"/> + </firstSegment> + <secondSegment> + <elements name="OperationCompartmentA(input : Boolean)"/> + </secondSegment> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleF" outgoingRelations="//@framedModel/@elements.0/@model/@elements.3" type="RoleType"> + <firstSegment/> + <secondSegment> + <elements name="OperationRoleE(input : Integer) : String"/> + </secondSegment> + <description name="1..*"/> + <boundaries> + <topLeft x="824" y="345"/> + <bottomRight x="1061" y="500"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleE" incomingRelations="//@framedModel/@elements.0/@model/@elements.3" type="RoleType"> + <firstSegment> + <elements name="AttributeRoleE : Integer"/> + </firstSegment> + <secondSegment> + <elements name="OperationRoleE(input : Integer) : String"/> + </secondSegment> + <description name="0..1"/> + <boundaries> + <topLeft x="824" y="71"/> + <bottomRight x="1059" y="224"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleGroupA (1..*)" type="RoleGroup"> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleG" incomingRelations="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.3" outgoingRelations="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.4" type="RoleType"> + <firstSegment/> + <secondSegment/> + <description name="*"/> + <boundaries> + <topLeft x="38" y="22"/> + <bottomRight x="241" y="175"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleH" outgoingRelations="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.3 //@framedModel/@elements.0/@model/@elements.2/@model/@elements.7" type="RoleType"> + <firstSegment/> + <secondSegment/> + <description name="*"/> + <boundaries> + <topLeft x="437" y="22"/> + <bottomRight x="641" y="176"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleJ" incomingRelations="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.4 //@framedModel/@elements.0/@model/@elements.2/@model/@elements.9" type="RoleType"> + <firstSegment/> + <secondSegment/> + <description name="*"/> + <boundaries> + <topLeft x="37" y="237"/> + <bottomRight x="244" y="394"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="RoleImplication" target="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.0" source="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.1"/> + <elements xsi:type="org.framed.orm.model:Relation" type="RoleProhibition" target="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.2" source="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.0"/> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleK" incomingRelations="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.7" outgoingRelations="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.9" type="RoleType"> + <firstSegment/> + <secondSegment/> + <description name="*"/> + <boundaries> + <topLeft x="435" y="238"/> + <bottomRight x="644" y="397"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="RelF" type="Relationship" target="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.5" source="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.1" connectionAnchor="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.6"> + <sourceLabel name="0..1"/> + <targetLabel name="1..*"/> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="RoleEquivalence" target="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.2" source="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.5"/> + </model> + <description name="1..1"/> + <boundaries> + <topLeft x="59" y="68"/> + <bottomRight x="752" y="518"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Inheritance" target="//@framedModel/@elements.0/@model/@elements.1" source="//@framedModel/@elements.0/@model/@elements.0"/> + </model> + <boundaries> + <topLeft x="848" y="158"/> + <bottomRight x="1102" y="312"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="SubDataA" outgoingRelations="//@framedModel/@elements.6" type="DataType"> + <firstSegment/> + <secondSegment> + <elements name="validateData() : Boolean"/> + </secondSegment> + <boundaries> + <topLeft x="88" y="86"/> + <bottomRight x="289" y="237"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="DataA" incomingRelations="//@framedModel/@elements.6" outgoingRelations="//@framedModel/@elements.10" type="DataType"> + <firstSegment> + <elements name="Data1 : String"/> + <elements name="Data2 : Integer"/> + </firstSegment> + <secondSegment> + <elements name="validateData() : Boolean"/> + </secondSegment> + <boundaries> + <topLeft x="426" y="84"/> + <bottomRight x="629" y="237"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="SubNaturalA" outgoingRelations="//@framedModel/@elements.5" type="NaturalType"> + <firstSegment> + <elements name="AttributeSubNatA : String"/> + </firstSegment> + <secondSegment/> + <boundaries> + <topLeft x="86" y="261"/> + <bottomRight x="288" y="413"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="NaturalA" incomingRelations="//@framedModel/@elements.5" outgoingRelations="//@framedModel/@elements.9 //@framedModel/@elements.11 //@framedModel/@elements.16" type="NaturalType"> + <firstSegment> + <elements name="AttributeNatA : String"/> + </firstSegment> + <secondSegment> + <elements name="OperationNatA()"/> + </secondSegment> + <boundaries> + <topLeft x="425" y="264"/> + <bottomRight x="625" y="414"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Inheritance" target="//@framedModel/@elements.4" source="//@framedModel/@elements.3"/> + <elements xsi:type="org.framed.orm.model:Relation" type="Inheritance" target="//@framedModel/@elements.2" source="//@framedModel/@elements.1"/> + <elements xsi:type="org.framed.orm.model:Shape" name="GroupA" type="Group"> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="NaturalB" type="NaturalType"> + <firstSegment> + <elements name="AttributeNatB : String"/> + </firstSegment> + <secondSegment> + <elements name="OperationNatB() : Integer"/> + </secondSegment> + <boundaries> + <topLeft x="215" y="184"/> + <bottomRight x="415" y="334"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="DataB" type="DataType"> + <firstSegment> + <elements name="value : Float"/> + </firstSegment> + <secondSegment/> + <boundaries> + <topLeft x="548" y="183"/> + <bottomRight x="750" y="335"/> + </boundaries> + </elements> + </model> + <boundaries> + <topLeft x="90" y="441"/> + <bottomRight x="290" y="591"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CompartmentB" incomingRelations="//@framedModel/@elements.9 //@framedModel/@elements.15" outgoingRelations="//@framedModel/@elements.13"> + <firstSegment/> + <secondSegment/> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleA" outgoingRelations="//@framedModel/@elements.8/@model/@elements.5 //@framedModel/@elements.8/@model/@elements.11 //@framedModel/@elements.8/@model/@elements.14 //@framedModel/@elements.8/@model/@elements.16 //@framedModel/@elements.8/@model/@elements.19 //@framedModel/@elements.8/@model/@elements.20" type="RoleType"> + <firstSegment> + <elements name="AttributeRoleA : Boolean"/> + </firstSegment> + <secondSegment/> + <description name="0..1"/> + <boundaries> + <topLeft x="234" y="116"/> + <bottomRight x="437" y="269"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleB" incomingRelations="//@framedModel/@elements.8/@model/@elements.5 //@framedModel/@elements.8/@model/@elements.16" outgoingRelations="//@framedModel/@elements.8/@model/@elements.7 //@framedModel/@elements.8/@model/@elements.17" type="RoleType"> + <firstSegment> + <elements name="AttributeRoleB : String"/> + </firstSegment> + <secondSegment> + <elements name="OperationRoleB()"/> + </secondSegment> + <description name="1..1"/> + <boundaries> + <topLeft x="639" y="116"/> + <bottomRight x="845" y="272"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleC" incomingRelations="//@framedModel/@elements.8/@model/@elements.9 //@framedModel/@elements.8/@model/@elements.11 //@framedModel/@elements.8/@model/@elements.18 //@framedModel/@elements.8/@model/@elements.20" type="RoleType"> + <firstSegment/> + <secondSegment/> + <description name="1..*"/> + <boundaries> + <topLeft x="234" y="374"/> + <bottomRight x="436" y="526"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleD" incomingRelations="//@framedModel/@elements.8/@model/@elements.7 //@framedModel/@elements.8/@model/@elements.14 //@framedModel/@elements.8/@model/@elements.17 //@framedModel/@elements.8/@model/@elements.19" outgoingRelations="//@framedModel/@elements.8/@model/@elements.9 //@framedModel/@elements.8/@model/@elements.18" type="RoleType"> + <firstSegment> + <elements name="AttributeRoleD : Integer"/> + </firstSegment> + <secondSegment/> + <description name="*"/> + <boundaries> + <topLeft x="642" y="374"/> + <bottomRight x="845" y="527"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" outgoingRelations="//@framedModel/@elements.8/@model/@elements.21" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="RelA" type="Relationship" target="//@framedModel/@elements.8/@model/@elements.1" source="//@framedModel/@elements.8/@model/@elements.0" referencedRelation="//@framedModel/@elements.8/@model/@elements.16" connectionAnchor="//@framedModel/@elements.8/@model/@elements.4"> + <sourceLabel name="1..1"/> + <targetLabel name="*"/> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="RelB" type="Relationship" target="//@framedModel/@elements.8/@model/@elements.3" source="//@framedModel/@elements.8/@model/@elements.1" referencedRelation="//@framedModel/@elements.8/@model/@elements.17" connectionAnchor="//@framedModel/@elements.8/@model/@elements.6"> + <sourceLabel name="0..1"/> + <targetLabel name="1..*"/> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" incomingRelations="//@framedModel/@elements.8/@model/@elements.22" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="RelC" type="Relationship" target="//@framedModel/@elements.8/@model/@elements.2" source="//@framedModel/@elements.8/@model/@elements.3" referencedRelation="//@framedModel/@elements.8/@model/@elements.18" connectionAnchor="//@framedModel/@elements.8/@model/@elements.8"> + <sourceLabel name="1..*"/> + <targetLabel name="1..1"/> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" outgoingRelations="//@framedModel/@elements.8/@model/@elements.22" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="RelD" type="Relationship" target="//@framedModel/@elements.8/@model/@elements.2" source="//@framedModel/@elements.8/@model/@elements.0" referencedRelation="//@framedModel/@elements.8/@model/@elements.20" connectionAnchor="//@framedModel/@elements.8/@model/@elements.10"> + <sourceLabel name="*"/> + <targetLabel name="*"/> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" incomingRelations="//@framedModel/@elements.8/@model/@elements.21" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="RelE" type="Relationship" target="//@framedModel/@elements.8/@model/@elements.3" source="//@framedModel/@elements.8/@model/@elements.0" referencedRelation="//@framedModel/@elements.8/@model/@elements.19" connectionAnchor="//@framedModel/@elements.8/@model/@elements.13"> + <sourceLabel name="*"/> + <targetLabel name="*"/> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" type="RelationshipShapeChild"> + <boundaries> + <topLeft y="1"/> + <bottomRight x="1"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Reflexive" type="Reflexive" target="//@framedModel/@elements.8/@model/@elements.1" source="//@framedModel/@elements.8/@model/@elements.0" referencedRelation="//@framedModel/@elements.8/@model/@elements.5"> + <bendpoints> + <referencePoints x="438" y="193"/> + <referencePoints x="639" y="194"/> + <distances x="-121" y="1"/> + <distances/> + </bendpoints> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Irreflexive" type="Irreflexive" target="//@framedModel/@elements.8/@model/@elements.3" source="//@framedModel/@elements.8/@model/@elements.1" referencedRelation="//@framedModel/@elements.8/@model/@elements.7"> + <bendpoints> + <referencePoints x="742" y="273"/> + <referencePoints x="744" y="374"/> + <distances x="-21" y="51"/> + <distances/> + </bendpoints> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Total" type="Total" target="//@framedModel/@elements.8/@model/@elements.2" source="//@framedModel/@elements.8/@model/@elements.3" referencedRelation="//@framedModel/@elements.8/@model/@elements.9"> + <bendpoints> + <referencePoints x="642" y="451"/> + <referencePoints x="437" y="450"/> + <distances x="-122"/> + <distances/> + </bendpoints> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Cyclic" type="Cyclic" target="//@framedModel/@elements.8/@model/@elements.3" source="//@framedModel/@elements.8/@model/@elements.0" referencedRelation="//@framedModel/@elements.8/@model/@elements.14"> + <bendpoints> + <referencePoints x="336" y="270"/> + <referencePoints x="744" y="374"/> + <distances x="-224" y="52"/> + <distances/> + </bendpoints> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Acyclic" type="Acyclic" target="//@framedModel/@elements.8/@model/@elements.2" source="//@framedModel/@elements.8/@model/@elements.0" referencedRelation="//@framedModel/@elements.8/@model/@elements.11"> + <bendpoints> + <referencePoints x="336" y="270"/> + <referencePoints x="335" y="374"/> + <distances x="-20" y="52"/> + <distances/> + </bendpoints> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="RelationshipImplication" target="//@framedModel/@elements.8/@model/@elements.13" source="//@framedModel/@elements.8/@model/@elements.4"/> + <elements xsi:type="org.framed.orm.model:Relation" type="RelationshipExclusion" target="//@framedModel/@elements.8/@model/@elements.8" source="//@framedModel/@elements.8/@model/@elements.10"/> + </model> + <boundaries> + <topLeft x="850" y="363"/> + <bottomRight x="1052" y="515"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" target="//@framedModel/@elements.8" source="//@framedModel/@elements.4" referencedRoles="//@framedModel/@elements.8/@model/@elements.0 //@framedModel/@elements.8/@model/@elements.1 //@framedModel/@elements.8/@model/@elements.2 //@framedModel/@elements.8/@model/@elements.3"/> + <elements xsi:type="org.framed.orm.model:Relation" name="" type="Fulfillment" target="//@framedModel/@elements.0" source="//@framedModel/@elements.2" referencedRoles="//@framedModel/@elements.0/@model/@elements.1 //@framedModel/@elements.0/@model/@elements.0"/> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" target="//@framedModel/@elements.0" source="//@framedModel/@elements.4" referencedRoles="//@framedModel/@elements.0/@model/@elements.2"/> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" target="//@framedModel/@elements.0" source="//@framedModel/@elements.0" referencedRoles="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.5"> + <bendpoints> + <referencePoints x="848" y="158"/> + <referencePoints x="848" y="158"/> + <distances y="183"/> + <distances/> + </bendpoints> + <bendpoints> + <referencePoints x="848" y="158"/> + <referencePoints x="848" y="158"/> + <distances x="166" y="92"/> + <distances x="166" y="92"/> + </bendpoints> + <bendpoints> + <referencePoints x="848" y="158"/> + <referencePoints x="848" y="158"/> + <distances x="164" y="2"/> + <distances x="164" y="2"/> + </bendpoints> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" target="//@framedModel/@elements.0" source="//@framedModel/@elements.8" referencedRoles="//@framedModel/@elements.0/@model/@elements.2/@model/@elements.1"/> + <elements xsi:type="org.framed.orm.model:Shape" name="CompartmentC" incomingRelations="//@framedModel/@elements.16" outgoingRelations="//@framedModel/@elements.15"> + <firstSegment/> + <secondSegment> + <elements name="OperationCompartmentC(input : Boolean)"/> + </secondSegment> + <model/> + <boundaries> + <topLeft x="410" y="434"/> + <bottomRight x="656" y="589"/> + </boundaries> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Inheritance" target="//@framedModel/@elements.8" source="//@framedModel/@elements.14"/> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" target="//@framedModel/@elements.14" source="//@framedModel/@elements.4" referencedRoles="//@framedModel/@elements.8/@model/@elements.0 //@framedModel/@elements.8/@model/@elements.1 //@framedModel/@elements.8/@model/@elements.2 //@framedModel/@elements.8/@model/@elements.3"/> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CompartmentA"> + <attributes name="AttributeCompartmentA"/> + <operations name="OperationCompartmentA"> + <params name="input"/> + </operations> + <parts lower="1"> + <role xsi:type="crom_l1_composed:RoleType" name="RoleF" outgoing="//@cromModel/@relations.0"> + <operations name="OperationRoleE"> + <params name="input"/> + </operations> + </role> + </parts> + <parts upper="1"> + <role xsi:type="crom_l1_composed:RoleType" name="RoleE" incoming="//@cromModel/@relations.0"> + <attributes name="AttributeRoleE"/> + <operations name="OperationRoleE"> + <params name="input"/> + </operations> + </role> + </parts> + <parts lower="1" upper="1"> + <role xsi:type="crom_l1_composed:RoleGroup" name="RoleGroupA" lower="1"> + <elements xsi:type="crom_l1_composed:RoleType" name="RoleG"/> + <elements xsi:type="crom_l1_composed:RoleType" name="RoleH" outgoing="//@cromModel/@elements.0/@relationships.0"/> + <elements xsi:type="crom_l1_composed:RoleType" name="RoleJ"/> + <elements xsi:type="crom_l1_composed:RoleType" name="RoleK" incoming="//@cromModel/@elements.0/@relationships.0"/> + </role> + </parts> + <relationships name="RelF"> + <first upper="1" holder="//@cromModel/@elements.0/@parts.2/@role/@elements.1"/> + <second lower="1" holder="//@cromModel/@elements.0/@parts.2/@role/@elements.3"/> + </relationships> + <constraints xsi:type="crom_l1_composed:RoleImplication" first="//@cromModel/@elements.0/@parts.2/@role/@elements.1" second="//@cromModel/@elements.0/@parts.2/@role/@elements.0"/> + <constraints xsi:type="crom_l1_composed:RoleProhibition" first="//@cromModel/@elements.0/@parts.2/@role/@elements.0" second="//@cromModel/@elements.0/@parts.2/@role/@elements.2"/> + <constraints xsi:type="crom_l1_composed:RoleEquivalence" first="//@cromModel/@elements.0/@parts.2/@role/@elements.3" second="//@cromModel/@elements.0/@parts.2/@role/@elements.2"/> + </elements> + <elements xsi:type="crom_l1_composed:DataType" name="SubDataA" outgoing="//@cromModel/@relations.2"> + <operations name="validateData"/> + </elements> + <elements xsi:type="crom_l1_composed:DataType" name="DataA" incoming="//@cromModel/@relations.2"> + <attributes name="Data1"/> + <attributes name="Data2"/> + <operations name="validateData"/> + </elements> + <elements xsi:type="crom_l1_composed:NaturalType" name="SubNaturalA" outgoing="//@cromModel/@relations.1"> + <attributes name="AttributeSubNatA"/> + </elements> + <elements xsi:type="crom_l1_composed:NaturalType" name="NaturalA" incoming="//@cromModel/@relations.1"> + <attributes name="AttributeNatA"/> + <operations name="OperationNatA"/> + </elements> + <elements xsi:type="crom_l1_composed:Group" name="GroupA"> + <elements xsi:type="crom_l1_composed:NaturalType" name="NaturalB"> + <attributes name="AttributeNatB"/> + <operations name="OperationNatB"/> + </elements> + <elements xsi:type="crom_l1_composed:DataType" name="DataB"> + <attributes name="value"/> + </elements> + </elements> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CompartmentB" incoming="//@cromModel/@relations.12"> + <parts upper="1"> + <role xsi:type="crom_l1_composed:RoleType" name="RoleA" outgoing="//@cromModel/@elements.6/@relationships.0 //@cromModel/@elements.6/@relationships.3 //@cromModel/@elements.6/@relationships.4"> + <attributes name="AttributeRoleA"/> + </role> + </parts> + <parts lower="1" upper="1"> + <role xsi:type="crom_l1_composed:RoleType" name="RoleB" incoming="//@cromModel/@elements.6/@relationships.0" outgoing="//@cromModel/@elements.6/@relationships.1"> + <attributes name="AttributeRoleB"/> + <operations name="OperationRoleB"/> + </role> + </parts> + <parts lower="1"> + <role xsi:type="crom_l1_composed:RoleType" name="RoleC" incoming="//@cromModel/@elements.6/@relationships.2 //@cromModel/@elements.6/@relationships.3"/> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RoleD" incoming="//@cromModel/@elements.6/@relationships.1 //@cromModel/@elements.6/@relationships.4" outgoing="//@cromModel/@elements.6/@relationships.2"> + <attributes name="AttributeRoleD"/> + </role> + </parts> + <relationships name="RelA"> + <first lower="1" upper="1" holder="//@cromModel/@elements.6/@parts.0/@role"/> + <second holder="//@cromModel/@elements.6/@parts.1/@role"/> + </relationships> + <relationships name="RelB"> + <first upper="1" holder="//@cromModel/@elements.6/@parts.1/@role"/> + <second lower="1" holder="//@cromModel/@elements.6/@parts.3/@role"/> + </relationships> + <relationships name="RelC"> + <first lower="1" holder="//@cromModel/@elements.6/@parts.3/@role"/> + <second lower="1" upper="1" holder="//@cromModel/@elements.6/@parts.2/@role"/> + </relationships> + <relationships name="RelD"> + <first holder="//@cromModel/@elements.6/@parts.0/@role"/> + <second holder="//@cromModel/@elements.6/@parts.2/@role"/> + </relationships> + <relationships name="RelE"> + <first holder="//@cromModel/@elements.6/@parts.0/@role"/> + <second holder="//@cromModel/@elements.6/@parts.3/@role"/> + </relationships> + <constraints xsi:type="crom_l1_composed:Reflexive" relation="//@cromModel/@elements.6/@relationships.0"/> + <constraints xsi:type="crom_l1_composed:Irreflexive" relation="//@cromModel/@elements.6/@relationships.1"/> + <constraints xsi:type="crom_l1_composed:Total" relation="//@cromModel/@elements.6/@relationships.2"/> + <constraints xsi:type="crom_l1_composed:Cyclic" relation="//@cromModel/@elements.6/@relationships.4"/> + <constraints xsi:type="crom_l1_composed:Acyclic" relation="//@cromModel/@elements.6/@relationships.3"/> + <constraints xsi:type="crom_l1_composed:RelationshipImplication" first="//@cromModel/@elements.6/@relationships.0" second="//@cromModel/@elements.6/@relationships.4"/> + <constraints xsi:type="crom_l1_composed:RelationshipExclusion" first="//@cromModel/@elements.6/@relationships.3" second="//@cromModel/@elements.6/@relationships.2"/> + </elements> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CompartmentC" outgoing="//@cromModel/@relations.12"> + <operations name="OperationCompartmentC"> + <params name="input"/> + </operations> + </elements> + <relations xsi:type="crom_l1_composed:RoleInheritance" super="//@cromModel/@elements.0/@parts.1/@role" sub="//@cromModel/@elements.0/@parts.0/@role"/> + <relations xsi:type="crom_l1_composed:NaturalInheritance" super="//@cromModel/@elements.4" sub="//@cromModel/@elements.3"/> + <relations xsi:type="crom_l1_composed:DataInheritance" super="//@cromModel/@elements.2" sub="//@cromModel/@elements.1"/> + <relations xsi:type="crom_l1_composed:Fulfillment" filled="//@cromModel/@elements.6/@parts.0/@role" filler="//@cromModel/@elements.4"/> + <relations xsi:type="crom_l1_composed:Fulfillment" filled="//@cromModel/@elements.6/@parts.1/@role" filler="//@cromModel/@elements.4"/> + <relations xsi:type="crom_l1_composed:Fulfillment" filled="//@cromModel/@elements.6/@parts.2/@role" filler="//@cromModel/@elements.4"/> + <relations xsi:type="crom_l1_composed:Fulfillment" filled="//@cromModel/@elements.6/@parts.3/@role" filler="//@cromModel/@elements.4"/> + <relations xsi:type="crom_l1_composed:Fulfillment" filled="//@cromModel/@elements.0/@parts.1/@role" filler="//@cromModel/@elements.2"/> + <relations xsi:type="crom_l1_composed:Fulfillment" filled="//@cromModel/@elements.0/@parts.0/@role" filler="//@cromModel/@elements.2"/> + <relations xsi:type="crom_l1_composed:Fulfillment" filled="//@cromModel/@elements.0/@parts.2/@role" filler="//@cromModel/@elements.4"/> + <relations xsi:type="crom_l1_composed:Fulfillment" filled="//@cromModel/@elements.0/@parts.2/@role/@elements.3" filler="//@cromModel/@elements.0"/> + <relations xsi:type="crom_l1_composed:Fulfillment" filled="//@cromModel/@elements.0/@parts.2/@role/@elements.1" filler="//@cromModel/@elements.6"/> + <relations xsi:type="crom_l1_composed:CompartmentInheritance" super="//@cromModel/@elements.6" sub="//@cromModel/@elements.7"/> + <relations xsi:type="crom_l1_composed:Fulfillment" filled="//@cromModel/@elements.6/@parts.0/@role" filler="//@cromModel/@elements.4"/> + <relations xsi:type="crom_l1_composed:Fulfillment" filled="//@cromModel/@elements.6/@parts.1/@role" filler="//@cromModel/@elements.4"/> + <relations xsi:type="crom_l1_composed:Fulfillment" filled="//@cromModel/@elements.6/@parts.2/@role" filler="//@cromModel/@elements.4"/> + <relations xsi:type="crom_l1_composed:Fulfillment" filled="//@cromModel/@elements.6/@parts.3/@role" filler="//@cromModel/@elements.4"/> + </cromModel> +</ts:TestCase> \ No newline at end of file diff --git a/org.framed.orm.transformation.test/testcases1/Group/group_test_1.xmi b/org.framed.orm.transformation.test/testcases1/Group/group_test_1.xmi new file mode 100644 index 0000000000000000000000000000000000000000..aab731429e96d08335c2253a72b875106e033ba7 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Group/group_test_1.xmi @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" xmlns:ts="http://org.framed/testmodel"> + <title> + Test for a simple Group shape with one contained NaturalType. + </title> + <description> + This test verifies that Groups and contained elements are transformed correctly. + </description> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="GroupTest" type="Group"> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="NaturalType1" type="NaturalType"> + <firstSegment/> + <secondSegment/> + </elements> + </model> + </elements> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:Group" name="GroupTest"> + <elements xsi:type="crom_l1_composed:NaturalType" name="NaturalType1"/> + </elements> + </cromModel> +</ts:TestCase> \ No newline at end of file diff --git a/org.framed.orm.transformation.test/testcases1/Inheritance/inheritance_test_1.xmi b/org.framed.orm.transformation.test/testcases1/Inheritance/inheritance_test_1.xmi new file mode 100644 index 0000000000000000000000000000000000000000..90a1425db55a4e10ffa4c09692270d06732ccda9 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Inheritance/inheritance_test_1.xmi @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="Simple TestCase for Inheritance Relation" + description="Simple TestCase for Inheritance Relation"> + <framedModel> + <elements + xsi:type="org.framed.orm.model:Shape" + name="CompType1" + outgoingRelations="//@framedModel/@elements.2"/> + <elements + xsi:type="org.framed.orm.model:Shape" + name="CompType2" + incomingRelations="//@framedModel/@elements.2"/> + <elements + xsi:type="org.framed.orm.model:Relation" + type="Inheritance" + target="//@framedModel/@elements.1" + source="//@framedModel/@elements.0"/> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements + xsi:type="crom_l1_composed:CompartmentType" + name="CompType1" + outgoing="//@cromModel/@relations.0"/> + <elements + xsi:type="crom_l1_composed:CompartmentType" + name="CompType2" + incoming="//@cromModel/@relations.0"/> + <relations + xsi:type="crom_l1_composed:CompartmentInheritance" + super="//@cromModel/@elements.1" + sub="//@cromModel/@elements.0"/> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/Inheritance/inheritance_test_2.xmi b/org.framed.orm.transformation.test/testcases1/Inheritance/inheritance_test_2.xmi new file mode 100644 index 0000000000000000000000000000000000000000..1dcac113ed399037291274dbb54420b9e4160477 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Inheritance/inheritance_test_2.xmi @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="Simple TestCase for Inheritance from inherited element" + description="TestCase to test inheritance over inheritance ;)"> + <framedModel> + <elements + xsi:type="org.framed.orm.model:Shape" + name="CompType1" + outgoingRelations="//@framedModel/@elements.2"/> + <elements + xsi:type="org.framed.orm.model:Shape" + name="CompType2" + incomingRelations="//@framedModel/@elements.2" + outgoingRelations="//@framedModel/@elements.4"/> + <elements + xsi:type="org.framed.orm.model:Relation" + type="Inheritance" + target="//@framedModel/@elements.1" + source="//@framedModel/@elements.0"/> + <elements + xsi:type="org.framed.orm.model:Shape" + name="CompType3" + incomingRelations="//@framedModel/@elements.4"/> + <elements + xsi:type="org.framed.orm.model:Relation" + type="Inheritance" + target="//@framedModel/@elements.3" + source="//@framedModel/@elements.1"/> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements + xsi:type="crom_l1_composed:CompartmentType" + name="CompType1" + outgoing="//@cromModel/@relations.0"/> + <elements + xsi:type="crom_l1_composed:CompartmentType" + name="CompType2" + incoming="//@cromModel/@relations.0" + outgoing="//@cromModel/@relations.1"/> + <elements + xsi:type="crom_l1_composed:CompartmentType" + name="CompType3" + incoming="//@cromModel/@relations.1"/> + <relations + xsi:type="crom_l1_composed:CompartmentInheritance" + super="//@cromModel/@elements.1" + sub="//@cromModel/@elements.0"/> + <relations + xsi:type="crom_l1_composed:CompartmentInheritance" + super="//@cromModel/@elements.2" + sub="//@cromModel/@elements.1"/> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/Inheritance/inheritance_test_3.xmi b/org.framed.orm.transformation.test/testcases1/Inheritance/inheritance_test_3.xmi new file mode 100644 index 0000000000000000000000000000000000000000..5e9b7e3ede69319e930a88e3b3644cdabf8504a0 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Inheritance/inheritance_test_3.xmi @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="TestCase to test double inheritance" + description="TestCase to test double inheritance"> + <framedModel> + <elements + xsi:type="org.framed.orm.model:Shape" + name="CompType1" + outgoingRelations="//@framedModel/@elements.2 //@framedModel/@elements.4"/> + <elements + xsi:type="org.framed.orm.model:Shape" + name="CompType2" + incomingRelations="//@framedModel/@elements.2"/> + <elements + xsi:type="org.framed.orm.model:Relation" + type="Inheritance" + target="//@framedModel/@elements.1" + source="//@framedModel/@elements.0"/> + <elements + xsi:type="org.framed.orm.model:Shape" + name="CompType3" + incomingRelations="//@framedModel/@elements.4"/> + <elements + xsi:type="org.framed.orm.model:Relation" + type="Inheritance" + target="//@framedModel/@elements.3" + source="//@framedModel/@elements.0"/> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements + xsi:type="crom_l1_composed:CompartmentType" + name="CompType1" + outgoing="//@cromModel/@relations.0 //@cromModel/@relations.1"/> + <elements + xsi:type="crom_l1_composed:CompartmentType" + name="CompType2" + incoming="//@cromModel/@relations.0"/> + <elements + xsi:type="crom_l1_composed:CompartmentType" + name="CompType3" + incoming="//@cromModel/@relations.1"/> + <relations + xsi:type="crom_l1_composed:CompartmentInheritance" + super="//@cromModel/@elements.1" + sub="//@cromModel/@elements.0"/> + <relations + xsi:type="crom_l1_composed:CompartmentInheritance" + super="//@cromModel/@elements.2" + sub="//@cromModel/@elements.0"/> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/NaturalType/naturalType_test_1.xmi b/org.framed.orm.transformation.test/testcases1/NaturalType/naturalType_test_1.xmi new file mode 100644 index 0000000000000000000000000000000000000000..eaf7e41b5979f54e3632e1df5b0722bc5b9c1d67 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/NaturalType/naturalType_test_1.xmi @@ -0,0 +1,68 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="
		Simple TestCase for Natural Types
	" + description="
		This test verifies that Shapes of type NaturalType are
		converted to NaturalTypes and still have the same name
	"> + <framedModel> + <elements + xsi:type="org.framed.orm.model:Shape" + name="NaturalType1" + type="NaturalType"/> + <elements + xsi:type="org.framed.orm.model:Shape" + name="NaturalType2" + type="NaturalType"/> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements + xsi:type="crom_l1_composed:NaturalType" + name="NaturalType1"/> + <elements + xsi:type="crom_l1_composed:NaturalType" + name="NaturalType2"/> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/NaturalType/naturalType_test_2.xmi b/org.framed.orm.transformation.test/testcases1/NaturalType/naturalType_test_2.xmi new file mode 100644 index 0000000000000000000000000000000000000000..ebf4904915b769d82392e1c4aa07c97e72577660 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/NaturalType/naturalType_test_2.xmi @@ -0,0 +1,80 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="
		Simple TestCase for Natural Types with attributes
	" + description="
		This test verifies that Shapes of type NaturalType are
		converted to NaturalTypes with their attributes which are contained in
		the first segment of a shape.
	"> + <framedModel> + <elements + xsi:type="org.framed.orm.model:Shape" + name="NaturalType1" + type="NaturalType"> + <firstSegment> + <elements + name="NamedElement0 : NaturalType1"/> + <elements + name="NamedElement1 : NaturalType2"/> + </firstSegment> + </elements> + <elements + xsi:type="org.framed.orm.model:Shape" + name="NaturalType2" + type="NaturalType"/> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements + xsi:type="crom_l1_composed:NaturalType" + name="NaturalType1"> + <attributes + name="NamedElement0" type="//@cromModel/@elements.0"/> + <attributes + name="NamedElement1" type="//@cromModel/@elements.1"/> + </elements> + <elements + xsi:type="crom_l1_composed:NaturalType" + name="NaturalType2"/> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/NaturalType/naturalType_test_3.xmi b/org.framed.orm.transformation.test/testcases1/NaturalType/naturalType_test_3.xmi new file mode 100644 index 0000000000000000000000000000000000000000..e48e7a3e92ccee8d7dc64264b640b40072aaae8f --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/NaturalType/naturalType_test_3.xmi @@ -0,0 +1,72 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" xmlns:ts="http://org.framed/testmodel"> + <title> + Test to ensure operations can be transformed. + </title> + <description> + This test checks if two operations without parameters can be converted. + </description> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="NaturalType1" + type="NaturalType"> + <firstSegment /> + <secondSegment> + <elements name="operation1() : NaturalType2" /> + <elements name="operation2() : NaturalType1" /> + </secondSegment> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="NaturalType2" + type="NaturalType" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:NaturalType" name="NaturalType1"> + <operations name="operation1" type="//@cromModel/@elements.1" + operation="" /> + <operations name="operation2" type="//@cromModel/@elements.0" + operation="" /> + </elements> + <elements xsi:type="crom_l1_composed:NaturalType" name="NaturalType2" /> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/NaturalType/naturalType_test_4.xmi b/org.framed.orm.transformation.test/testcases1/NaturalType/naturalType_test_4.xmi new file mode 100644 index 0000000000000000000000000000000000000000..2b5acc2fa95a5bd87dd3017af17ec8e2368c7f39 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/NaturalType/naturalType_test_4.xmi @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="
		Test to ensure operations can be transformed basically
	" + description="
		This test checks if two operations with parameters can be converted.
	"> + <framedModel> + <elements + xsi:type="org.framed.orm.model:Shape" + name="NaturalType1" + type="NaturalType"> + <firstSegment/> + <secondSegment> + <elements + name="operation1(para1 : NaturalType1) : NaturalType2"/> + <elements + name="operation2(para1 : NaturalType1, para2:NaturalType2) : NaturalType1"/> + </secondSegment> + </elements> + <elements + xsi:type="org.framed.orm.model:Shape" + name="NaturalType2" + type="NaturalType"/> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements + xsi:type="crom_l1_composed:NaturalType" + name="NaturalType1"> + <operations + name="operation1" + type="//@cromModel/@elements.1" + operation=""> + <params + name="para1" + type="//@cromModel/@elements.0"/> + </operations> + <operations + name="operation2" + type="//@cromModel/@elements.0" + operation=""> + <params + name="para1" + type="//@cromModel/@elements.0"/> + <params + name="para2" + type="//@cromModel/@elements.1"/> + </operations> + </elements> + <elements + xsi:type="crom_l1_composed:NaturalType" + name="NaturalType2"/> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/NaturalType/naturalType_test_5.xmi b/org.framed.orm.transformation.test/testcases1/NaturalType/naturalType_test_5.xmi new file mode 100644 index 0000000000000000000000000000000000000000..5735016214a13649c004ee6b898be2d95c6b9a94 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/NaturalType/naturalType_test_5.xmi @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="
		Test to ensure operations can be transformed basically
	" + description="
		This test checks if two operations with parameters with some crazy syntax can be converted.
	"> + <framedModel> + <elements + xsi:type="org.framed.orm.model:Shape" + name="NaturalType1" + type="NaturalType"> + <firstSegment/> + <secondSegment> + <elements + name="operation1(para1:NaturalType1): NaturalType2"/> + <elements + name="operation2(para1 : NaturalType1, para2:NaturalType2) :NaturalType1"/> + </secondSegment> + </elements> + <elements + xsi:type="org.framed.orm.model:Shape" + name="NaturalType2" + type="NaturalType"/> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements + xsi:type="crom_l1_composed:NaturalType" + name="NaturalType1"> + <operations + name="operation1" + type="//@cromModel/@elements.1" + operation=""> + <params + name="para1" + type="//@cromModel/@elements.0"/> + </operations> + <operations + name="operation2" + type="//@cromModel/@elements.0" + operation=""> + <params + name="para1" + type="//@cromModel/@elements.0"/> + <params + name="para2" + type="//@cromModel/@elements.1"/> + </operations> + </elements> + <elements + xsi:type="crom_l1_composed:NaturalType" + name="NaturalType2"/> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_1.xmi b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_1.xmi new file mode 100644 index 0000000000000000000000000000000000000000..431fe7fad0986897ba40171f73d33fe4b6b97c2e --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_1.xmi @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="Simple TestCase for Relationships" + description="Simple TestCase for Relationships"> +<framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="CT"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.0/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + outgoingRelations="//@framedModel/@elements.0/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.0/@model/@elements.0" + source="//@framedModel/@elements.0/@model/@elements.1" + connectionAnchor="//@framedModel/@elements.0/@model/@elements.2"> + <sourceLabel name="*" /> + <targetLabel name="*" /> + </elements> + </model> + </elements> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.0/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + outgoing="//@cromModel/@elements.0/@relationships.0" /> + </parts> + <relationships name="rst"> + <first holder="//@cromModel/@elements.0/@parts.1/@role" /> + <second holder="//@cromModel/@elements.0/@parts.0/@role" /> + </relationships> + </elements> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_10.xmi b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_10.xmi new file mode 100644 index 0000000000000000000000000000000000000000..5cc4cd52c100db0b5e546300a9aa77db45c1bf40 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_10.xmi @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="TestCase for 1 relationship(s)" + description="TestCase for 1 relationship(s) between two RoleType(s)"> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="NT" + outgoingRelations="//@framedModel/@elements.2" type="NaturalType"> + <firstSegment /> + <secondSegment /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CT" + incomingRelations="//@framedModel/@elements.2"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.1/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.2"> + <sourceLabel name="*" /> + <targetLabel name="*" /> + </elements> + </model> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" + target="//@framedModel/@elements.1" source="//@framedModel/@elements.0" + referencedRoles="//@framedModel/@elements.1/@model/@elements.0 //@framedModel/@elements.1/@model/@elements.1" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:NaturalType" name="NT" /> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + outgoing="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <relationships name="rst"> + <first holder="//@cromModel/@elements.1/@parts.1/@role" /> + <second holder="//@cromModel/@elements.1/@parts.0/@role" /> + </relationships> + </elements> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.0/@role" filler="//@cromModel/@elements.0" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.1/@role" filler="//@cromModel/@elements.0" /> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_11.xmi b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_11.xmi new file mode 100644 index 0000000000000000000000000000000000000000..09118677f68bfec7f0e318be35a0ffe280aed628 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_11.xmi @@ -0,0 +1,132 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="TestCase for 2 relationship(s)" + description="TestCase for 2 relationship(s) between two RoleType(s)"> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="NT" + outgoingRelations="//@framedModel/@elements.2" type="NaturalType"> + <firstSegment /> + <secondSegment /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CT" + incomingRelations="//@framedModel/@elements.2"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.1/@model/@elements.6" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + incomingRelations="//@framedModel/@elements.1/@model/@elements.3" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.6" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.1" + source="//@framedModel/@elements.1/@model/@elements.0" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.2"> + <sourceLabel name="1" /> + <targetLabel name="1..*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="subrst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.5"> + <sourceLabel name="*" /> + <targetLabel name="0..1" /> + </elements> + </model> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" + target="//@framedModel/@elements.1" source="//@framedModel/@elements.0" + referencedRoles="//@framedModel/@elements.1/@model/@elements.0 //@framedModel/@elements.1/@model/@elements.1" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:NaturalType" name="NT" /> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.1/@relationships.1" outgoing="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + incoming="//@cromModel/@elements.1/@relationships.0" outgoing="//@cromModel/@elements.1/@relationships.1" /> + </parts> + <relationships name="rst"> + <first lower="1" upper="1" + holder="//@cromModel/@elements.1/@parts.0/@role" /> + <second lower="1" holder="//@cromModel/@elements.1/@parts.1/@role" /> + </relationships> + <relationships name="subrst"> + <first holder="//@cromModel/@elements.1/@parts.1/@role" /> + <second upper="1" holder="//@cromModel/@elements.1/@parts.0/@role" /> + </relationships> + </elements> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.0/@role" filler="//@cromModel/@elements.0" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.1/@role" filler="//@cromModel/@elements.0" /> + </cromModel> +</ts:TestCase> \ No newline at end of file diff --git a/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_2.xmi b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_2.xmi new file mode 100644 index 0000000000000000000000000000000000000000..3b7b541a3143d13cb08491b9f5d9a3f3c2822352 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_2.xmi @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" xmlns:ts="http://org.framed/testmodel" + title="TestCase for cyclic relationships" + description="TestCase for cyclic relationships where one RoleType is referenced by a cyclic relationship to another RoleType"> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="NT" + outgoingRelations="//@framedModel/@elements.2" type="NaturalType"> + <firstSegment /> + <secondSegment /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CT" + incomingRelations="//@framedModel/@elements.2"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.1/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.4" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.2"> + <sourceLabel name="*" /> + <targetLabel name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Cyclic" + type="Cyclic" target="//@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1"> + </elements> + </model> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" + target="//@framedModel/@elements.1" source="//@framedModel/@elements.0" + referencedRoles="//@framedModel/@elements.1/@model/@elements.0 //@framedModel/@elements.1/@model/@elements.1" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:NaturalType" name="NT" /> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + outgoing="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <relationships name="rst"> + <first holder="//@cromModel/@elements.1/@parts.1/@role" /> + <second holder="//@cromModel/@elements.1/@parts.0/@role" /> + </relationships> + <constraints xsi:type="crom_l1_composed:Cyclic" + relation="//@cromModel/@elements.1/@relationships.0" /> + </elements> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.0/@role" filler="//@cromModel/@elements.0" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.1/@role" filler="//@cromModel/@elements.0" /> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_3.xmi b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_3.xmi new file mode 100644 index 0000000000000000000000000000000000000000..639f0b22ace99500dcfa1add13ec5d6455f9902e --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_3.xmi @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" xmlns:ts="http://org.framed/testmodel" + title="TestCase for irreflexive relationships" + description="TestCase for irreflexive relationships where one RoleType is referenced by a irreflexive relationship to another RoleType"> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="NT" + outgoingRelations="//@framedModel/@elements.2" type="NaturalType"> + <firstSegment /> + <secondSegment /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CT" + incomingRelations="//@framedModel/@elements.2"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.1/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.4" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.2"> + <sourceLabel name="*" /> + <targetLabel name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Irreflexive" + type="Irreflexive" target="//@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1"> + </elements> + </model> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" + target="//@framedModel/@elements.1" source="//@framedModel/@elements.0" + referencedRoles="//@framedModel/@elements.1/@model/@elements.0 //@framedModel/@elements.1/@model/@elements.1" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:NaturalType" name="NT" /> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + outgoing="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <relationships name="rst"> + <first holder="//@cromModel/@elements.1/@parts.1/@role" /> + <second holder="//@cromModel/@elements.1/@parts.0/@role" /> + </relationships> + <constraints xsi:type="crom_l1_composed:Irreflexive" + relation="//@cromModel/@elements.1/@relationships.0" /> + </elements> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.0/@role" filler="//@cromModel/@elements.0" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.1/@role" filler="//@cromModel/@elements.0" /> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_4.xmi b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_4.xmi new file mode 100644 index 0000000000000000000000000000000000000000..a5fa5f42c130c09054cfd0335fcd08daeed999a5 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_4.xmi @@ -0,0 +1,130 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" xmlns:ts="http://org.framed/testmodel" + title="TestCase for cyclic,irreflexive relationships" + description="TestCase for cyclic,irreflexive relationships where one RoleType is referenced by a cyclic,irreflexive relationship to another RoleType"> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="NT" + outgoingRelations="//@framedModel/@elements.2" type="NaturalType"> + <firstSegment /> + <secondSegment /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CT" + incomingRelations="//@framedModel/@elements.2"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.1/@model/@elements.3 //@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.3 //@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.2"> + <sourceLabel name="*" /> + <targetLabel name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Irreflexive" + type="Irreflexive" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.3"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Cyclic" + type="Cyclic" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.3"> + </elements> + </model> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" + target="//@framedModel/@elements.1" source="//@framedModel/@elements.0" + referencedRoles="//@framedModel/@elements.1/@model/@elements.0 //@framedModel/@elements.1/@model/@elements.1" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:NaturalType" name="NT" /> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + outgoing="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <relationships name="rst"> + <first holder="//@cromModel/@elements.1/@parts.1/@role" /> + <second holder="//@cromModel/@elements.1/@parts.0/@role" /> + </relationships> + <constraints xsi:type="crom_l1_composed:Irreflexive" + relation="//@cromModel/@elements.1/@relationships.0" /> + <constraints xsi:type="crom_l1_composed:Cyclic" + relation="//@cromModel/@elements.1/@relationships.0" /> + </elements> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.0/@role" filler="//@cromModel/@elements.0" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.1/@role" filler="//@cromModel/@elements.0" /> + </cromModel> +</ts:TestCase> \ No newline at end of file diff --git a/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_5.xmi b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_5.xmi new file mode 100644 index 0000000000000000000000000000000000000000..e82085add43ce78fae2f38a04c55a6077590cdd0 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_5.xmi @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="TestCase for acyclic relationships" + description="TestCase for Acyclic relationships where one RoleType is referenced by an Acyclic relationship to another RoleType"> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="NT" + outgoingRelations="//@framedModel/@elements.2" type="NaturalType"> + <firstSegment /> + <secondSegment /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CT" + incomingRelations="//@framedModel/@elements.2"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.1/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.4" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.2"> + <sourceLabel name="*" /> + <targetLabel name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Acyclic" + type="Acyclic" target="//@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1"> + </elements> + </model> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" + target="//@framedModel/@elements.1" source="//@framedModel/@elements.0" + referencedRoles="//@framedModel/@elements.1/@model/@elements.0 //@framedModel/@elements.1/@model/@elements.1" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:NaturalType" name="NT" /> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + outgoing="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <relationships name="rst"> + <first holder="//@cromModel/@elements.1/@parts.1/@role" /> + <second holder="//@cromModel/@elements.1/@parts.0/@role" /> + </relationships> + <constraints xsi:type="crom_l1_composed:Acyclic" + relation="//@cromModel/@elements.1/@relationships.0" /> + </elements> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.0/@role" filler="//@cromModel/@elements.0" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.1/@role" filler="//@cromModel/@elements.0" /> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_6.xmi b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_6.xmi new file mode 100644 index 0000000000000000000000000000000000000000..76d3b5107b1ca2361ac0d5e3e69c6cb990c9015c --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_6.xmi @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="TestCase for reflexive relationships" + description="TestCase for Reflexive relationships where one RoleType is referenced by a Reflexive relationship to another RoleType"> +<framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="NT" + outgoingRelations="//@framedModel/@elements.2" type="NaturalType"> + <firstSegment /> + <secondSegment /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CT" + incomingRelations="//@framedModel/@elements.2"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.1/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.4" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.2"> + <sourceLabel name="*" /> + <targetLabel name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Reflexive" + type="Reflexive" target="//@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1"> + </elements> + </model> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" + target="//@framedModel/@elements.1" source="//@framedModel/@elements.0" + referencedRoles="//@framedModel/@elements.1/@model/@elements.0 //@framedModel/@elements.1/@model/@elements.1" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:NaturalType" name="NT" /> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + outgoing="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <relationships name="rst"> + <first holder="//@cromModel/@elements.1/@parts.1/@role" /> + <second holder="//@cromModel/@elements.1/@parts.0/@role" /> + </relationships> + <constraints xsi:type="crom_l1_composed:Reflexive" + relation="//@cromModel/@elements.1/@relationships.0" /> + </elements> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.0/@role" filler="//@cromModel/@elements.0" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.1/@role" filler="//@cromModel/@elements.0" /> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_7.xmi b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_7.xmi new file mode 100644 index 0000000000000000000000000000000000000000..e898314974d4323ea4397a92ea64997b91a70fda --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_7.xmi @@ -0,0 +1,133 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="TestCase for cyclic, reflexive relationships" + description="TestCase for cyclic, reflexive relationships where one RoleType is referenced by a cyclic, reflexive relationship to another RoleType"> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="NT" + outgoingRelations="//@framedModel/@elements.2" type="NaturalType"> + <firstSegment /> + <secondSegment /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CT" + incomingRelations="//@framedModel/@elements.2"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.1/@model/@elements.3 //@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.3 //@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.2"> + <sourceLabel name="*" /> + <targetLabel name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Reflexive" + type="Reflexive" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.3"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Cyclic" + type="Cyclic" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.3"> + </elements> + </model> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" + target="//@framedModel/@elements.1" source="//@framedModel/@elements.0" + referencedRoles="//@framedModel/@elements.1/@model/@elements.0 //@framedModel/@elements.1/@model/@elements.1" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:NaturalType" name="NT" /> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + outgoing="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <relationships name="rst"> + <first holder="//@cromModel/@elements.1/@parts.1/@role" /> + <second holder="//@cromModel/@elements.1/@parts.0/@role" /> + </relationships> + <constraints xsi:type="crom_l1_composed:Reflexive" + relation="//@cromModel/@elements.1/@relationships.0" /> + <constraints xsi:type="crom_l1_composed:Cyclic" + relation="//@cromModel/@elements.1/@relationships.0" /> + </elements> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.0/@role" filler="//@cromModel/@elements.0" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.1/@role" filler="//@cromModel/@elements.0" /> + </cromModel> +</ts:TestCase> \ No newline at end of file diff --git a/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_8.xmi b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_8.xmi new file mode 100644 index 0000000000000000000000000000000000000000..7b1e5ca237e67fc2898d3dbfbc88e9dcd4dbf612 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_8.xmi @@ -0,0 +1,133 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="TestCase for acyclic, irreflexive relationships" + description="TestCase for acyclic, irreflexive relationships where one RoleType is referenced by a acyclic, irreflexive relationship to another RoleType"> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="NT" + outgoingRelations="//@framedModel/@elements.2" type="NaturalType"> + <firstSegment /> + <secondSegment /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CT" + incomingRelations="//@framedModel/@elements.2"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.1/@model/@elements.3 //@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.3 //@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.2"> + <sourceLabel name="*" /> + <targetLabel name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Irreflexive" + type="Irreflexive" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.3"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Acyclic" + type="Acyclic" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.3"> + </elements> + </model> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" + target="//@framedModel/@elements.1" source="//@framedModel/@elements.0" + referencedRoles="//@framedModel/@elements.1/@model/@elements.0 //@framedModel/@elements.1/@model/@elements.1" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:NaturalType" name="NT" /> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + outgoing="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <relationships name="rst"> + <first holder="//@cromModel/@elements.1/@parts.1/@role" /> + <second holder="//@cromModel/@elements.1/@parts.0/@role" /> + </relationships> + <constraints xsi:type="crom_l1_composed:Irreflexive" + relation="//@cromModel/@elements.1/@relationships.0" /> + <constraints xsi:type="crom_l1_composed:Acyclic" + relation="//@cromModel/@elements.1/@relationships.0" /> + </elements> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.0/@role" filler="//@cromModel/@elements.0" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.1/@role" filler="//@cromModel/@elements.0" /> + </cromModel> +</ts:TestCase> \ No newline at end of file diff --git a/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_9.xmi b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_9.xmi new file mode 100644 index 0000000000000000000000000000000000000000..cf273f3b81aeb83be3fbdc29fb4b7f6e3b1839be --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/Relationship/relationship_test_9.xmi @@ -0,0 +1,133 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="TestCase for cyclic,total relationships" + description="TestCase for cyclic,total relationships where one RoleType is referenced by a cyclic,total relationship to another RoleType"> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="NT" + outgoingRelations="//@framedModel/@elements.2" type="NaturalType"> + <firstSegment /> + <secondSegment /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CT" + incomingRelations="//@framedModel/@elements.2"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.1/@model/@elements.3 //@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.3 //@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.2"> + <sourceLabel name="*" /> + <targetLabel name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Irreflexive" + type="Irreflexive" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.3"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Total" + type="Total" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.3"> + </elements> + </model> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" + target="//@framedModel/@elements.1" source="//@framedModel/@elements.0" + referencedRoles="//@framedModel/@elements.1/@model/@elements.0 //@framedModel/@elements.1/@model/@elements.1" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:NaturalType" name="NT" /> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + outgoing="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <relationships name="rst"> + <first holder="//@cromModel/@elements.1/@parts.1/@role" /> + <second holder="//@cromModel/@elements.1/@parts.0/@role" /> + </relationships> + <constraints xsi:type="crom_l1_composed:Irreflexive" + relation="//@cromModel/@elements.1/@relationships.0" /> + <constraints xsi:type="crom_l1_composed:Total" + relation="//@cromModel/@elements.1/@relationships.0" /> + </elements> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.0/@role" filler="//@cromModel/@elements.0" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.1/@role" filler="//@cromModel/@elements.0" /> + </cromModel> +</ts:TestCase> \ No newline at end of file diff --git a/org.framed.orm.transformation.test/testcases1/RelationshipCardinality/relationshipcardinality_test_1.xmi b/org.framed.orm.transformation.test/testcases1/RelationshipCardinality/relationshipcardinality_test_1.xmi new file mode 100644 index 0000000000000000000000000000000000000000..5d1eba153949f1eff410009778c8d89d9fd215b4 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/RelationshipCardinality/relationshipcardinality_test_1.xmi @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="TestCase for Relationship Cardinality (1)" + description="TestCase for Relationship Cardinality (1) (2)"> +<framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="CT"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.0/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + outgoingRelations="//@framedModel/@elements.0/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.0/@model/@elements.0" + source="//@framedModel/@elements.0/@model/@elements.1" + connectionAnchor="//@framedModel/@elements.0/@model/@elements.2"> + <sourceLabel name="1" /> + <targetLabel name="2" /> + </elements> + </model> + </elements> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.0/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + outgoing="//@cromModel/@elements.0/@relationships.0" /> + </parts> + <relationships name="rst"> + <first lower="1" upper="1" holder="//@cromModel/@elements.0/@parts.1/@role" /> + <second lower="2" upper="2" holder="//@cromModel/@elements.0/@parts.0/@role" /> + </relationships> + </elements> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/RelationshipCardinality/relationshipcardinality_test_2.xmi b/org.framed.orm.transformation.test/testcases1/RelationshipCardinality/relationshipcardinality_test_2.xmi new file mode 100644 index 0000000000000000000000000000000000000000..d67a3b248258cb498766aad42feb9c85a1bd153f --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/RelationshipCardinality/relationshipcardinality_test_2.xmi @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="TestCase for Relationship Cardinality (1..2)" + description="TestCase for Relationship Cardinality (1..2) (2..3)"> +<framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="CT"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.0/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + outgoingRelations="//@framedModel/@elements.0/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.0/@model/@elements.0" + source="//@framedModel/@elements.0/@model/@elements.1" + connectionAnchor="//@framedModel/@elements.0/@model/@elements.2"> + <sourceLabel name="1..2" /> + <targetLabel name="3..4" /> + </elements> + </model> + </elements> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.0/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + outgoing="//@cromModel/@elements.0/@relationships.0" /> + </parts> + <relationships name="rst"> + <first lower="1" upper="2" holder="//@cromModel/@elements.0/@parts.1/@role" /> + <second lower="3" upper="4" holder="//@cromModel/@elements.0/@parts.0/@role" /> + </relationships> + </elements> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/RelationshipCardinality/relationshipcardinality_test_3.xmi b/org.framed.orm.transformation.test/testcases1/RelationshipCardinality/relationshipcardinality_test_3.xmi new file mode 100644 index 0000000000000000000000000000000000000000..02ef1a48fcabbab33c4aa3b5de3a559d7582e6a3 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/RelationshipCardinality/relationshipcardinality_test_3.xmi @@ -0,0 +1,98 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="TestCase for Relationship Cardinality (1..*)" + description="TestCase for Relationship Cardinality (1..*) (2..*)"> +<framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="CT"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.0/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + outgoingRelations="//@framedModel/@elements.0/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.0/@model/@elements.0" + source="//@framedModel/@elements.0/@model/@elements.1" + connectionAnchor="//@framedModel/@elements.0/@model/@elements.2"> + <sourceLabel name="1..*" /> + <targetLabel name="2..*" /> + </elements> + </model> + </elements> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.0/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + outgoing="//@cromModel/@elements.0/@relationships.0" /> + </parts> + <relationships name="rst"> + <first lower="1" holder="//@cromModel/@elements.0/@parts.1/@role" /> + <second lower="2" holder="//@cromModel/@elements.0/@parts.0/@role" /> + </relationships> + </elements> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/RelationshipConstraint/RelationshipConstraintTestGenerator.py b/org.framed.orm.transformation.test/testcases1/RelationshipConstraint/RelationshipConstraintTestGenerator.py new file mode 100644 index 0000000000000000000000000000000000000000..8bc1c778274a02db9ad861468e9ffb23b882fea4 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/RelationshipConstraint/RelationshipConstraintTestGenerator.py @@ -0,0 +1,315 @@ +#!/usr/bin/env python + +#FRaMED testcase generator for (n)-relationships and relationship constraints. +# +#This generator creates testcases for (n)-relationships or testcases for (n)-relationships with all possible combinations of constraints (unregarded impossible constraint combination, e.g. cyclic - acyclic). The generator will create a new folder (Relationship or RelationshipConstraint) in which all testcases (relationship_test_n/relationshipconstraint_test_n) are created. It is called by cmd/terminal with: +# "python TestGenerator.py n" (Create testcases for n-relationships) +# "python TestGenerator.py n true" (Create testcases for n-relationships with all possible constraint combinations) + +import sys, os, itertools + +__author__ = "Duc Dung Dam" +__date__ = "24/04/16" +__version__ = "1.0" +__maintainer__ = "Duc Dung Dam" +__email__ = "dung.dam_duc@tu-dresden.de" +__status__ = "Prototype" + + +types = ['RoleType'] +constraints = ['Irreflexive', 'Reflexive', 'Cyclic', 'Acyclic', 'Total'] + +def write(filename, content, mode): + #0 = create relationship tests + #1 = create relationshipconstraint tests + if mode == 0: + path = os.path.dirname(os.path.realpath(__file__))+"/Relationship"; + if not os.path.exists(path): + os.mkdir(path) + dirPath = "Relationship/" + if mode == 1: + path = os.path.dirname(os.path.realpath(__file__))+"/RelationshipConstraint"; + if not os.path.exists(path): + os.mkdir(path) + dirPath = "RelationshipConstraint/" + filename += '.xmi' + try: + file = open(dirPath+filename, "w") + file.write(content) + file.close() + except: + sys.exit(0) + +def createRelationshipTestcases(n): + print "createRelationshipTestcases" + + for x in types: + for y in range(1, n+1): + content = framedModel = cromModel = '' + + #Header + filename = 'relationship_test_'+str(y) + description = "TestCase for "+ str(y) +" relationship(s) between two " + x + "(s)" + title = "TestCase for "+ str(y) +" relationship(s)" + header = ('<?xml version="1.0" encoding="ASCII"?>\n' + '<ts:TestCase\n' + '\txmi:version=\"2.0"\n' + '\txmlns:xmi="http://www.omg.org/XMI"\n' + '\txmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n' + '\txmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/"\n' + '\txmlns:org.framed.orm.model="http://orm/1.0"\n' + '\txmlns:ts="http://org.framed/testmodel"\n' + '\ttitle="'+title+'"\n' + '\tdescription="'+description+'">\n') + content += header + print filename + + #FramedModel + framedModel += ('\t<framedModel>\n' + '\t\t<elements\n' + '\t\t\txsi:type="org.framed.orm.model:Shape"\n' + '\t\t\tname="Test">\n' + '\t\t\t<model>\n') + + #FramedModel - Elements + #FramedModel - Elements - Loop for outgoingRelations/incomingRelations + framedRelations = '' + for z in range (0, y): + framedRelations += '//@framedModel/@elements.0/@model/@elements.'+str(z+2)+' ' + framedRelations = framedRelations[:-1] + framedModel += ('\t\t\t\t<elements\n' + '\t\t\t\t\txsi:type="org.framed.orm.model:Shape"\n' + '\t\t\t\t\tname="RoleType1"\n' + '\t\t\t\t\toutgoingRelations="') + framedModel += framedRelations + framedModel += '"\n\t\t\t\t\ttype="'+ x +'"/>\n' + framedModel += ('\t\t\t\t<elements\n' + '\t\t\t\t\txsi:type="org.framed.orm.model:Shape"\n' + '\t\t\t\t\tname="RoleType2"\n' + '\t\t\t\t\tincomingRelations="') + framedModel += framedRelations + framedModel += '\"\n\t\t\t\t\ttype=\"'+ x +'\"/>\n' + + #FramedModel - Relations + for z in range (0, y): + framedModel += ('\t\t\t\t<elements\n' + '\t\t\t\t\txsi:type="org.framed.orm.model:Relation"\n' + '\t\t\t\t\tname="testRelation_'+str(z)+'"\n' + '\t\t\t\t\ttype="Relationship"\n' + '\t\t\t\t\ttarget="//@framedModel/@elements.0/@model/@elements.1"\n' + '\t\t\t\t\tsource="//@framedModel/@elements.0/@model/@elements.0"/>\n') + + framedModel += ('\t\t\t</model>\n' + '\t\t</elements>\n' + '\t</framedModel>\n') + content += framedModel + + #CromModel + cromModel += ('\t<cromModel>\n' + '\t\t<elements\n' + '\t\t\txsi:type="crom_l1_composed:CompartmentType"\n' + '\t\t\tname="Test">\n') + + #CromModel - Elements + #CromModel - Elements - Loop for outgoingRelations/incomingRelations + cromRelations = '' + for z in range (0, y): + cromRelations += '//@cromModel/@elements.0/@relationships.'+str(z)+' ' + cromRelations = cromRelations[:-1] + cromModel += ('\t\t\t<parts>\n' + '\t\t\t\t<role\n' + '\t\t\t\txsi:type="crom_l1_composed:'+ x +'"\n' + '\t\t\t\tname="RoleType1"\n' + '\t\t\t\toutgoing=\"') + cromModel += cromRelations + cromModel += ('"/>\n' + '\t\t\t</parts>\n') + + cromModel += ('\t\t\t<parts>\n' + '\t\t\t\t<role\n' + '\t\t\t\t\txsi:type="crom_l1_composed:'+ x +'"\n' + '\t\t\t\t\tname="RoleType2"\n' + '\t\t\t\t\tincoming="') + cromModel += cromRelations + cromModel += ('"/>\n' + '\t\t\t</parts>\n') + + #CromModel - Relations + for z in xrange(0, y): + cromModel += '\t\t\t<relationships name=\"testRelation_'+ str(z) +'\"/>\n' + + cromModel += ('\t\t</elements>\n' + '\t</cromModel>\n') + content += cromModel + + #Footer + footer = "</ts:TestCase>" + content += footer + + write(filename, content, 0) + +def createRelationshipConstraintsTestcases(n): + print "createRelationshipConstraintsTestcases" + + #Generate all possible combinations of constraints for n relationships + cons = [] + for y in range(1,len(constraints)+1): + cons.extend(itertools.combinations(constraints, y)) + cons_combinations = [] + for n_relationship in range(1, n+1): + cons_combinations.extend(itertools.product(cons, repeat = n_relationship)) + + #Start generate testcase + counter = 1 + for tupel_constraint in cons_combinations: + #print "testcase with " + str(len(tupel_constraint)) + " relationship(s) and " + str(tupel_constraint) + " constraint(s)" + + #Init + content = framedModel = cromModel = '' + + #Create all elements for FramedModel and CromModel + + framedRelations = framedRelationships = framedConstraints = '' + cromRelations = cromRelationships = cromConstraints = '' + + + framedElementsCounter = 2 #2 because elements.0 and elements.1 are Roletypes + relationshipCounter = 0 + framedElementsConstraintCounter = framedElementsCounter+len(tupel_constraint) + + for constraint in tupel_constraint: + #outgoing/incoming relations + #framedModel + framedRelations += '//@framedModel/@elements.0/@model/@elements.'+str(framedElementsCounter)+" " + #cromModel + cromRelations += '//@cromModel/@elements.0/@relationships.'+str(relationshipCounter)+" " + #constraint elements + referencedRelation = 'referencedRelation="' + for element_constraint in constraint: + #framedModel + framedConstraints += ('\t\t\t\t<elements\n' + '\t\t\t\t\txsi:type="org.framed.orm.model:Relation"\n' + '\t\t\t\t\tname="'+element_constraint+'" type="'+element_constraint+'"\n' + '\t\t\t\t\ttarget="//@framedModel/@elements.0/@model/@elements.1"\n' + '\t\t\t\t\tsource="//@framedModel/@elements.0/@model/@elements.0"\n' + '\t\t\t\t\treferencedRelation="//@framedModel/@elements.0/@model/@elements.'+str(framedElementsCounter)+'"/>\n') + referencedRelation += '//@framedModel/@elements.0/@model/@elements.'+str(framedElementsConstraintCounter)+' ' + framedElementsConstraintCounter += 1 + #cromModel + cromConstraints += ('\t\t\t\t<constraints\n' + '\t\t\t\t\txsi:type="crom_l1_composed:'+element_constraint+'"\n' + '\t\t\t\t\trelation="//@cromModel/@elements.0/@relationships.'+str(relationshipCounter)+'"/>\n') + referencedRelation = referencedRelation[:-1]+'"' + + #relationship elements + #framedModel + framedRelationships += ('\t\t\t\t<elements\n' + '\t\t\t\t\txsi:type="org.framed.orm.model:Relation"\n' + '\t\t\t\t\tname="testRelation_' +str(relationshipCounter)+ '"\n' + '\t\t\t\t\ttype="Relationship"\n' + '\t\t\t\t\ttarget="//@framedModel/@elements.0/@model/@elements.1"\n' + '\t\t\t\t\tsource="//@framedModel/@elements.0/@model/@elements.0"\n' + '\t\t\t\t\t'+referencedRelation+'/>\n') + + #cromModel + cromRelationships += ('\t\t\t\t<relationships name="testRelation_'+str(relationshipCounter)+'"/>\n') + + framedElementsCounter += 1 + relationshipCounter += 1 + + #Header + filename = 'relationshipconstraint_test_'+str(counter) + description = "TestCase for "+ str(len(tupel_constraint)) +" relationship(s) with constraints "+ str(tupel_constraint) +" between two " + types[0] + title = "TestCase for "+ str(len(tupel_constraint)) +" relationship(s) with constraints "+ str(tupel_constraint) + header = ("<?xml version=\"1.0\" encoding=\"ASCII\"?>\n" + "<ts:TestCase\n" + "\txmi:version=\"2.0\"\n" + "\txmlns:xmi=\"http://www.omg.org/XMI\"\n" + "\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n" + "\txmlns:crom_l1_composed=\"platform:/resource/org.rosi.crom.metamodel/\"\n" + "\txmlns:org.framed.orm.model=\"http://orm/1.0\"\n" + "\txmlns:ts=\"http://org.framed/testmodel\"\n" + "\ttitle=\""+title+"\"\n" + "\tdescription=\""+description+"\">\n") + content += header + #FramedModel + #Header + framedModel += '\t<framedModel>\n' + #Content + framedModel += ('\t\t<elements\n' + '\t\t\txsi:type="org.framed.orm.model:Shape"\n' + '\t\t\tname="Test">\n' + '\t\t\t<model>\n' + #Roletype1 + '\t\t\t\t<elements\n' + '\t\t\t\t\t\txsi:type="org.framed.orm.model:Shape"\n' + '\t\t\t\t\t\tname="'+types[0]+'1"\n' + '\t\t\t\t\t\toutgoingRelations="'+framedRelations+'"\n' + '\t\t\t\t\t\ttype="RoleType"/>\n' + #Roletype2 + '\t\t\t\t<elements\n' + '\t\t\t\t\t\txsi:type="org.framed.orm.model:Shape"\n' + '\t\t\t\t\t\tname="'+types[0]+'2"\n' + '\t\t\t\t\t\tincomingRelations="'+framedRelations+'"\n' + '\t\t\t\t\t\ttype="RoleType"/>\n') + #Relationships + framedModel += framedRelationships + #Constraints + framedModel += framedConstraints + #Footer + framedModel += ('\t\t\t</model>\n' + '\t\t</elements>\n' + '\t</framedModel>\n') + content += framedModel + + #CromModel + #Header + cromModel += '\t<cromModel>\n' + #Content + cromModel += ('\t\t<elements\n' + '\t\t\txsi:type="crom_l1_composed:CompartmentType"\n' + '\t\t\tname="Test">\n' + #Roletype1 + '\t\t\t<parts>\n' + '\t\t\t\t<role\n' + '\t\t\t\t\txsi:type="crom_l1_composed:RoleType"\n' + '\t\t\t\t\tname="RoleType1"\n' + '\t\t\t\t\toutgoing="'+cromRelations+'"/>\n' + '\t\t\t</parts>\n' + #Roletype2 + '\t\t\t<parts>\n' + '\t\t\t\t<role\n' + '\t\t\t\t\txsi:type="crom_l1_composed:RoleType"\n' + '\t\t\t\t\tname="RoleType2"\n' + '\t\t\t\t\tincoming="'+cromRelations+'"/>\n' + '\t\t\t</parts>\n') + #Relationships + cromModel += cromRelationships + #Constraints + cromModel += cromConstraints + #Footer + cromModel += ('\t\t</elements>\n' + '\t</cromModel>\n') + content += cromModel + + #Footer + footer = "</ts:TestCase>" + content += footer + + write(filename, content, 1) + counter += 1 + +def init(): + print "Generating Testcases:" + if sys.argv is not None: + #python TestGenerator (int)n (creates testcases from 1 to n relationships) + if len(sys.argv) == 2: + createRelationshipTestcases(int(sys.argv[1])) + + #python TestGenerator (int)n (bool)true (creates testcases from 1 to n relationships with all possible constraint combinations) + if len(sys.argv) == 3 and bool(sys.argv[2]) is True: + createRelationshipConstraintsTestcases(int(sys.argv[1])) + else: + createRelationshipTestcases(1) + +init() diff --git a/org.framed.orm.transformation.test/testcases1/RelationshipConstraint/relationshipConstraint_test_1.xmi b/org.framed.orm.transformation.test/testcases1/RelationshipConstraint/relationshipConstraint_test_1.xmi new file mode 100644 index 0000000000000000000000000000000000000000..f2487b0139f3d7f82b0d4a1630f92998b7bceb21 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/RelationshipConstraint/relationshipConstraint_test_1.xmi @@ -0,0 +1,257 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" xmlns:ts="http://org.framed/testmodel" + title="TestCase for 3 relationship(s) with constraints (('Irreflexive', 'Reflexive', 'Cyclic', 'Acyclic', 'Total'), ('Irreflexive', 'Reflexive', 'Cyclic', 'Acyclic', 'Total'), ('Irreflexive', 'Reflexive', 'Cyclic', 'Acyclic', 'Total'))" + description="TestCase for 3 relationship(s) with constraints (('Irreflexive', 'Reflexive', 'Cyclic', 'Acyclic', 'Total'), ('Irreflexive', 'Reflexive', 'Cyclic', 'Acyclic', 'Total'), ('Irreflexive', 'Reflexive', 'Cyclic', 'Acyclic', 'Total')) between two RoleType"> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="NT" + outgoingRelations="//@framedModel/@elements.2" type="NaturalType"> + <firstSegment /> + <secondSegment /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CT" + incomingRelations="//@framedModel/@elements.2"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.1/@model/@elements.3 //@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7 //@framedModel/@elements.1/@model/@elements.9 //@framedModel/@elements.1/@model/@elements.12 //@framedModel/@elements.1/@model/@elements.14 //@framedModel/@elements.1/@model/@elements.15 //@framedModel/@elements.1/@model/@elements.16 //@framedModel/@elements.1/@model/@elements.17 //@framedModel/@elements.1/@model/@elements.18 //@framedModel/@elements.1/@model/@elements.19 //@framedModel/@elements.1/@model/@elements.20 //@framedModel/@elements.1/@model/@elements.21 //@framedModel/@elements.1/@model/@elements.22 //@framedModel/@elements.1/@model/@elements.23 //@framedModel/@elements.1/@model/@elements.24 //@framedModel/@elements.1/@model/@elements.25 //@framedModel/@elements.1/@model/@elements.26" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.3 //@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7 //@framedModel/@elements.1/@model/@elements.9 //@framedModel/@elements.1/@model/@elements.12 //@framedModel/@elements.1/@model/@elements.14 //@framedModel/@elements.1/@model/@elements.15 //@framedModel/@elements.1/@model/@elements.16 //@framedModel/@elements.1/@model/@elements.17 //@framedModel/@elements.1/@model/@elements.18 //@framedModel/@elements.1/@model/@elements.19 //@framedModel/@elements.1/@model/@elements.20 //@framedModel/@elements.1/@model/@elements.21 //@framedModel/@elements.1/@model/@elements.22 //@framedModel/@elements.1/@model/@elements.23 //@framedModel/@elements.1/@model/@elements.24 //@framedModel/@elements.1/@model/@elements.25 //@framedModel/@elements.1/@model/@elements.26" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7 //@framedModel/@elements.1/@model/@elements.15 //@framedModel/@elements.1/@model/@elements.16 //@framedModel/@elements.1/@model/@elements.17" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.2"> + <sourceLabel name="*" /> + <targetLabel name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Irreflexive" + type="Irreflexive" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.3"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Acyclic" + type="Acyclic" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.3"> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst2" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.14 //@framedModel/@elements.1/@model/@elements.18 //@framedModel/@elements.1/@model/@elements.19 //@framedModel/@elements.1/@model/@elements.20 //@framedModel/@elements.1/@model/@elements.21" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.8"> + <sourceLabel name="*" /> + <targetLabel name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst3" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.22 //@framedModel/@elements.1/@model/@elements.23 //@framedModel/@elements.1/@model/@elements.24 //@framedModel/@elements.1/@model/@elements.25 //@framedModel/@elements.1/@model/@elements.26" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.11"> + <sourceLabel name="*" /> + <targetLabel name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Irreflexive" + type="Irreflexive" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.9"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Reflexive" + type="Reflexive" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.3"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Total" + type="Total" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.3"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Cyclic" + type="Cyclic" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.3"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Reflexive" + type="Reflexive" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.9"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Total" + type="Total" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.9"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Cyclic" + type="Cyclic" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.9"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Acyclic" + type="Acyclic" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.9"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Reflexive" + type="Reflexive" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.12"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Irreflexive" + type="Irreflexive" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.12"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Total" + type="Total" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.12"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Cyclic" + type="Cyclic" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.12"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Acyclic" + type="Acyclic" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.12"> + </elements> + </model> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" + target="//@framedModel/@elements.1" source="//@framedModel/@elements.0" + referencedRoles="//@framedModel/@elements.1/@model/@elements.0 //@framedModel/@elements.1/@model/@elements.1" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:NaturalType" name="NT" /> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.1/@relationships.0 //@cromModel/@elements.1/@relationships.1 //@cromModel/@elements.1/@relationships.2" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + outgoing="//@cromModel/@elements.1/@relationships.0 //@cromModel/@elements.1/@relationships.1 //@cromModel/@elements.1/@relationships.2" /> + </parts> + <relationships name="rst"> + <first holder="//@cromModel/@elements.1/@parts.1/@role" /> + <second holder="//@cromModel/@elements.1/@parts.0/@role" /> + </relationships> + <relationships name="rst2"> + <first holder="//@cromModel/@elements.1/@parts.1/@role" /> + <second holder="//@cromModel/@elements.1/@parts.0/@role" /> + </relationships> + <relationships name="rst3"> + <first holder="//@cromModel/@elements.1/@parts.1/@role" /> + <second holder="//@cromModel/@elements.1/@parts.0/@role" /> + </relationships> + <constraints xsi:type="crom_l1_composed:Irreflexive" + relation="//@cromModel/@elements.1/@relationships.0" /> + <constraints xsi:type="crom_l1_composed:Acyclic" + relation="//@cromModel/@elements.1/@relationships.0" /> + <constraints xsi:type="crom_l1_composed:Irreflexive" + relation="//@cromModel/@elements.1/@relationships.1" /> + <constraints xsi:type="crom_l1_composed:Reflexive" + relation="//@cromModel/@elements.1/@relationships.0" /> + <constraints xsi:type="crom_l1_composed:Total" + relation="//@cromModel/@elements.1/@relationships.0" /> + <constraints xsi:type="crom_l1_composed:Cyclic" + relation="//@cromModel/@elements.1/@relationships.0" /> + <constraints xsi:type="crom_l1_composed:Reflexive" + relation="//@cromModel/@elements.1/@relationships.1" /> + <constraints xsi:type="crom_l1_composed:Total" + relation="//@cromModel/@elements.1/@relationships.1" /> + <constraints xsi:type="crom_l1_composed:Cyclic" + relation="//@cromModel/@elements.1/@relationships.1" /> + <constraints xsi:type="crom_l1_composed:Acyclic" + relation="//@cromModel/@elements.1/@relationships.1" /> + <constraints xsi:type="crom_l1_composed:Reflexive" + relation="//@cromModel/@elements.1/@relationships.2" /> + <constraints xsi:type="crom_l1_composed:Irreflexive" + relation="//@cromModel/@elements.1/@relationships.2" /> + <constraints xsi:type="crom_l1_composed:Total" + relation="//@cromModel/@elements.1/@relationships.2" /> + <constraints xsi:type="crom_l1_composed:Cyclic" + relation="//@cromModel/@elements.1/@relationships.2" /> + <constraints xsi:type="crom_l1_composed:Acyclic" + relation="//@cromModel/@elements.1/@relationships.2" /> + </elements> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.0/@role" filler="//@cromModel/@elements.0" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.1/@role" filler="//@cromModel/@elements.0" /> + </cromModel> +</ts:TestCase> \ No newline at end of file diff --git a/org.framed.orm.transformation.test/testcases1/RelationshipConstraint/relationshipConstraint_test_2.xmi b/org.framed.orm.transformation.test/testcases1/RelationshipConstraint/relationshipConstraint_test_2.xmi new file mode 100644 index 0000000000000000000000000000000000000000..7cbc38bccf1e6f686437a341c592352939d45056 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/RelationshipConstraint/relationshipConstraint_test_2.xmi @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" xmlns:ts="http://org.framed/testmodel" + title="TestCase for 1 relationship(s) with constraint" + description="TestCase for 1 relationship(s) with constraint between two RoleType(s)"> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="NT" + outgoingRelations="//@framedModel/@elements.2" type="NaturalType"> + <firstSegment /> + <secondSegment /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CT" + incomingRelations="//@framedModel/@elements.2"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.1/@model/@elements.3 //@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7 //@framedModel/@elements.1/@model/@elements.8" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.3 //@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7 //@framedModel/@elements.1/@model/@elements.8" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.6 //@framedModel/@elements.1/@model/@elements.7 //@framedModel/@elements.1/@model/@elements.8" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.2"> + <sourceLabel name="*" /> + <targetLabel name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Irreflexive" + type="Irreflexive" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.3"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Total" + type="Total" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.3"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="Acyclic" + type="Acyclic" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + referencedRelation="//@framedModel/@elements.1/@model/@elements.3"> + </elements> + </model> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" + target="//@framedModel/@elements.1" source="//@framedModel/@elements.0" + referencedRoles="//@framedModel/@elements.1/@model/@elements.0 //@framedModel/@elements.1/@model/@elements.1" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:NaturalType" name="NT" /> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + outgoing="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <relationships name="rst"> + <first holder="//@cromModel/@elements.1/@parts.1/@role" /> + <second holder="//@cromModel/@elements.1/@parts.0/@role" /> + </relationships> + <constraints xsi:type="crom_l1_composed:Irreflexive" + relation="//@cromModel/@elements.1/@relationships.0" /> + <constraints xsi:type="crom_l1_composed:Total" + relation="//@cromModel/@elements.1/@relationships.0" /> + <constraints xsi:type="crom_l1_composed:Acyclic" + relation="//@cromModel/@elements.1/@relationships.0" /> + </elements> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.0/@role" filler="//@cromModel/@elements.0" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.1/@role" filler="//@cromModel/@elements.0" /> + </cromModel> +</ts:TestCase> \ No newline at end of file diff --git a/org.framed.orm.transformation.test/testcases1/RelationshipExclusion/relationshipExclusion_test_1.xmi b/org.framed.orm.transformation.test/testcases1/RelationshipExclusion/relationshipExclusion_test_1.xmi new file mode 100644 index 0000000000000000000000000000000000000000..e09ee1094bf93ba0dcddc0b1e3f94100adc758de --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/RelationshipExclusion/relationshipExclusion_test_1.xmi @@ -0,0 +1,141 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="Simple TestCase for RelationshipExclusions" + description="Simple TestCase for RelationshipExclusions"> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="NT" + outgoingRelations="//@framedModel/@elements.2" type="NaturalType"> + <firstSegment /> + <secondSegment /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CT" + incomingRelations="//@framedModel/@elements.2"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.1/@model/@elements.6" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + incomingRelations="//@framedModel/@elements.1/@model/@elements.3" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.6" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + incomingRelations="//@framedModel/@elements.1/@model/@elements.8" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.1" + source="//@framedModel/@elements.1/@model/@elements.0" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.2"> + <sourceLabel name="1" /> + <targetLabel name="1..*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.8" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="subrst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.5"> + <sourceLabel name="*" /> + <targetLabel name="0..1" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="RelationshipExclusion" + target="//@framedModel/@elements.1/@model/@elements.2" source="//@framedModel/@elements.1/@model/@elements.5" /> + </model> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" + target="//@framedModel/@elements.1" source="//@framedModel/@elements.0" + referencedRoles="//@framedModel/@elements.1/@model/@elements.0 //@framedModel/@elements.1/@model/@elements.1" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:NaturalType" name="NT" /> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.1/@relationships.1" outgoing="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + incoming="//@cromModel/@elements.1/@relationships.0" outgoing="//@cromModel/@elements.1/@relationships.1" /> + </parts> + <relationships name="rst"> + <first lower="1" upper="1" + holder="//@cromModel/@elements.1/@parts.0/@role" /> + <second lower="1" holder="//@cromModel/@elements.1/@parts.1/@role" /> + </relationships> + <relationships name="subrst"> + <first holder="//@cromModel/@elements.1/@parts.1/@role" /> + <second upper="1" holder="//@cromModel/@elements.1/@parts.0/@role" /> + </relationships> + <constraints xsi:type="crom_l1_composed:RelationshipExclusion" + first="//@cromModel/@elements.1/@relationships.1" second="//@cromModel/@elements.1/@relationships.0" /> + </elements> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.0/@role" filler="//@cromModel/@elements.0" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.1/@role" filler="//@cromModel/@elements.0" /> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/RelationshipImplication/relationshipImplication_test_1.xmi b/org.framed.orm.transformation.test/testcases1/RelationshipImplication/relationshipImplication_test_1.xmi new file mode 100644 index 0000000000000000000000000000000000000000..94c0a440615e5c4d20ce4d55ccf1e583503b8bfa --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/RelationshipImplication/relationshipImplication_test_1.xmi @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" xmlns:ts="http://org.framed/testmodel" + title="Simple TestCase for RelationshipImplications" description="Simple TestCase for RelationshipImplications"> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="NT" + outgoingRelations="//@framedModel/@elements.2" type="NaturalType"> + <firstSegment /> + <secondSegment /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="CT" + incomingRelations="//@framedModel/@elements.2"> + <firstSegment /> + <secondSegment /> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RT1" + incomingRelations="//@framedModel/@elements.1/@model/@elements.6" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.3" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RT2" + incomingRelations="//@framedModel/@elements.1/@model/@elements.3" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.6" + type="RoleType"> + <firstSegment /> + <secondSegment /> + <description name="*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + incomingRelations="//@framedModel/@elements.1/@model/@elements.8" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="rst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.1" + source="//@framedModel/@elements.1/@model/@elements.0" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.2"> + <sourceLabel name="1" /> + <targetLabel name="1..*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + outgoingRelations="//@framedModel/@elements.1/@model/@elements.8" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="subrst" + type="Relationship" target="//@framedModel/@elements.1/@model/@elements.0" + source="//@framedModel/@elements.1/@model/@elements.1" + connectionAnchor="//@framedModel/@elements.1/@model/@elements.5"> + <sourceLabel name="*" /> + <targetLabel name="0..1" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="" + type="RelationshipShapeChild"> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="RelationshipImplication" + target="//@framedModel/@elements.1/@model/@elements.2" source="//@framedModel/@elements.1/@model/@elements.5" /> + </model> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" + target="//@framedModel/@elements.1" source="//@framedModel/@elements.0" + referencedRoles="//@framedModel/@elements.1/@model/@elements.0 //@framedModel/@elements.1/@model/@elements.1" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:NaturalType" name="NT" /> + <elements xsi:type="crom_l1_composed:CompartmentType" name="CT"> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT1" + incoming="//@cromModel/@elements.1/@relationships.1" outgoing="//@cromModel/@elements.1/@relationships.0" /> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="RT2" + incoming="//@cromModel/@elements.1/@relationships.0" outgoing="//@cromModel/@elements.1/@relationships.1" /> + </parts> + <relationships name="rst"> + <first lower="1" upper="1" + holder="//@cromModel/@elements.1/@parts.0/@role" /> + <second lower="1" holder="//@cromModel/@elements.1/@parts.1/@role" /> + </relationships> + <relationships name="subrst"> + <first holder="//@cromModel/@elements.1/@parts.1/@role" /> + <second upper="1" holder="//@cromModel/@elements.1/@parts.0/@role" /> + </relationships> + <constraints xsi:type="crom_l1_composed:RelationshipImplication" + first="//@cromModel/@elements.1/@relationships.1" second="//@cromModel/@elements.1/@relationships.0" /> + </elements> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.0/@role" filler="//@cromModel/@elements.0" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.1/@parts.1/@role" filler="//@cromModel/@elements.0" /> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/RoleImplication/roleEquivalence_test_1.xmi b/org.framed.orm.transformation.test/testcases1/RoleImplication/roleEquivalence_test_1.xmi new file mode 100644 index 0000000000000000000000000000000000000000..be80f7c50d0c60811f2fe6ab03806ad08c314843 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/RoleImplication/roleEquivalence_test_1.xmi @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="Simple TestCase for RoleImplications" + description="Simple TestCase for RoleImplications"> + <framedModel> + <elements + xsi:type="org.framed.orm.model:Shape" + name="compType1"> + <model> + <elements + xsi:type="org.framed.orm.model:Shape" + name="roleType1" + outgoingRelations="//@framedModel/@elements.0/@model/@elements.2" + type="RoleType"/> + <elements + xsi:type="org.framed.orm.model:Shape" + name="roleType2" + incomingRelations="//@framedModel/@elements.0/@model/@elements.2" + type="RoleType"/> + <elements + xsi:type="org.framed.orm.model:Relation" + name="" + type="RoleEquivalence" + target="//@framedModel/@elements.0/@model/@elements.1" + source="//@framedModel/@elements.0/@model/@elements.0"/> + </model> + </elements> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements + xsi:type="crom_l1_composed:CompartmentType" + name="compType1"> + <parts> + <role + xsi:type="crom_l1_composed:RoleType" + name="roleType1"/> + </parts> + <parts> + <role + xsi:type="crom_l1_composed:RoleType" + name="roleType2"/> + </parts> + <constraints + xsi:type="crom_l1_composed:RoleEquivalence" + first="//@cromModel/@elements.0/@parts.0/@role" + second="//@cromModel/@elements.0/@parts.1/@role"/> + </elements> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/RoleImplication/roleImplication_test_1.xmi b/org.framed.orm.transformation.test/testcases1/RoleImplication/roleImplication_test_1.xmi new file mode 100644 index 0000000000000000000000000000000000000000..28005fd3cf32cf7c752b0bb0733c4d10dcd72489 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/RoleImplication/roleImplication_test_1.xmi @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="Simple TestCase for RoleImplications" + description="Simple TestCase for RoleImplications"> + <framedModel> + <elements + xsi:type="org.framed.orm.model:Shape" + name="compType1"> + <model> + <elements + xsi:type="org.framed.orm.model:Shape" + name="roleType1" + outgoingRelations="//@framedModel/@elements.0/@model/@elements.2" + type="RoleType"/> + <elements + xsi:type="org.framed.orm.model:Shape" + name="roleType2" + incomingRelations="//@framedModel/@elements.0/@model/@elements.2" + type="RoleType"/> + <elements + xsi:type="org.framed.orm.model:Relation" + name="" + type="RoleImplication" + target="//@framedModel/@elements.0/@model/@elements.1" + source="//@framedModel/@elements.0/@model/@elements.0"/> + </model> + </elements> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements + xsi:type="crom_l1_composed:CompartmentType" + name="compType1"> + <parts> + <role + xsi:type="crom_l1_composed:RoleType" + name="roleType1"/> + </parts> + <parts> + <role + xsi:type="crom_l1_composed:RoleType" + name="roleType2"/> + </parts> + <constraints + xsi:type="crom_l1_composed:RoleImplication" + first="//@cromModel/@elements.0/@parts.0/@role" + second="//@cromModel/@elements.0/@parts.1/@role"/> + </elements> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/RoleImplication/roleProhibition_test_1.xmi b/org.framed.orm.transformation.test/testcases1/RoleImplication/roleProhibition_test_1.xmi new file mode 100644 index 0000000000000000000000000000000000000000..5cdf357c0a9c892e33ebefa51e0719cd3c87b0e4 --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/RoleImplication/roleProhibition_test_1.xmi @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase + xmi:version="2.0" + xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" + xmlns:ts="http://org.framed/testmodel" + title="Simple TestCase for RoleImplications" + description="Simple TestCase for RoleImplications"> + <framedModel> + <elements + xsi:type="org.framed.orm.model:Shape" + name="compType1"> + <model> + <elements + xsi:type="org.framed.orm.model:Shape" + name="roleType1" + outgoingRelations="//@framedModel/@elements.0/@model/@elements.2" + type="RoleType"/> + <elements + xsi:type="org.framed.orm.model:Shape" + name="roleType2" + incomingRelations="//@framedModel/@elements.0/@model/@elements.2" + type="RoleType"/> + <elements + xsi:type="org.framed.orm.model:Relation" + name="" + type="RoleProhibition" + target="//@framedModel/@elements.0/@model/@elements.1" + source="//@framedModel/@elements.0/@model/@elements.0"/> + </model> + </elements> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements + xsi:type="crom_l1_composed:CompartmentType" + name="compType1"> + <parts> + <role + xsi:type="crom_l1_composed:RoleType" + name="roleType1"/> + </parts> + <parts> + <role + xsi:type="crom_l1_composed:RoleType" + name="roleType2"/> + </parts> + <constraints + xsi:type="crom_l1_composed:RoleProhibition" + first="//@cromModel/@elements.0/@parts.0/@role" + second="//@cromModel/@elements.0/@parts.1/@role"/> + </elements> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/testcases1/integration/bank_example_test.xmi b/org.framed.orm.transformation.test/testcases1/integration/bank_example_test.xmi new file mode 100644 index 0000000000000000000000000000000000000000..8b71b5d2b9b04c2a13a6397284ea5b9a1f20692f --- /dev/null +++ b/org.framed.orm.transformation.test/testcases1/integration/bank_example_test.xmi @@ -0,0 +1,407 @@ +<?xml version="1.0" encoding="ASCII"?> +<ts:TestCase xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:crom_l1_composed="platform:/resource/org.rosi.crom.metamodel/" + xmlns:org.framed.orm.model="http://orm/1.0" xmlns:ts="http://org.framed/testmodel" + title="BankExample Test" description="BankExample Test"> + <framedModel> + <elements xsi:type="org.framed.orm.model:Shape" name="Person" + outgoingRelations="//@framedModel/@elements.11" type="NaturalType"> + <firstSegment> + <elements name="title : String" /> + <elements name="firstName : String" /> + <elements name="lastName : String" /> + <elements name="address : String" /> + </firstSegment> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="Company" + outgoingRelations="//@framedModel/@elements.12" type="NaturalType"> + <firstSegment> + <elements name="name : String" /> + <elements name="legalForm : String" /> + <elements name="addresses : String" /> + <elements name="POBox : String" /> + </firstSegment> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="Bank" + incomingRelations="//@framedModel/@elements.11 //@framedModel/@elements.12 //@framedModel/@elements.13 //@framedModel/@elements.15 //@framedModel/@elements.14"> + <firstSegment> + <elements name="name : String" /> + </firstSegment> + <secondSegment> + <elements name="executeTransactions()" /> + </secondSegment> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="Customer" + incomingRelations="//@framedModel/@elements.2/@model/@elements.2" + outgoingRelations="//@framedModel/@elements.2/@model/@elements.5 //@framedModel/@elements.2/@model/@elements.6" + type="RoleType"> + <firstSegment> + <elements name="id : Integer" /> + <elements name="name : String" /> + </firstSegment> + <secondSegment> + <elements name="addSavingsAccount() : Boolean" /> + <elements name="addCheckingsAccount() : Boolean" /> + <elements name="getAccounts() : Integer" /> + <elements name="getBalance(id : Integer) : Money" /> + <elements name="transfer(from : Integer, to : Integer) : Boolean" /> + <elements name="sendAccountStatement(id : Integer) : Boolean" /> + </secondSegment> + <description name="0..*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="Consultant" + outgoingRelations="//@framedModel/@elements.2/@model/@elements.2" + type="RoleType"> + <firstSegment> + <elements name="Phone : String" /> + </firstSegment> + <secondSegment> + <elements name="consult(id : Integer)" /> + </secondSegment> + <description name="1..*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="advices" + type="Relationship" target="//@framedModel/@elements.2/@model/@elements.0" + source="//@framedModel/@elements.2/@model/@elements.1"> + <sourceLabel name="0..*" /> + <targetLabel name="1..*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="Transaction" + type="RoleType"> + <firstSegment> + <elements name="execution : DateTime" /> + </firstSegment> + <secondSegment> + <elements name="execute() : Boolean" /> + <elements name="isExecuted() : Boolean" /> + </secondSegment> + <description name="0..*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleGroup (1..1)" + type="RoleGroup"> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="CheckingsAccount" + incomingRelations="//@framedModel/@elements.2/@model/@elements.5" + type="RoleType"> + <firstSegment> + <elements name="limit : Money" /> + </firstSegment> + <secondSegment> + <elements name="decrease(amount : Money) " /> + <elements name="getLimit() : Money" /> + <elements name="setLimit(limit : Money) " /> + </secondSegment> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="SavingsAccount" + incomingRelations="//@framedModel/@elements.2/@model/@elements.6" + type="RoleType"> + <firstSegment> + <elements name="transactionFee:Double" /> + </firstSegment> + <secondSegment> + <elements name="decrease(amount : Money) " /> + </secondSegment> + </elements> + </model> + <description name="0..*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="own_ca" + type="Relationship" + target="//@framedModel/@elements.2/@model/@elements.4/@model/@elements.0" + source="//@framedModel/@elements.2/@model/@elements.0"> + <sourceLabel name="1" /> + <targetLabel name="0..*" /> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="own_sa" + type="Relationship" + target="//@framedModel/@elements.2/@model/@elements.4/@model/@elements.1" + source="//@framedModel/@elements.2/@model/@elements.0"> + <sourceLabel name="1..*" /> + <targetLabel name="0..*" /> + </elements> + </model> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="String" + type="DataType" /> + <elements xsi:type="org.framed.orm.model:Shape" name="Transaction" + outgoingRelations="//@framedModel/@elements.13"> + <firstSegment> + <elements name="creationtime : DateTime" /> + <elements name="amount : Money" /> + </firstSegment> + <secondSegment> + <elements name="bind(source:Account, target:Account):Boolean" /> + <elements name="execute() : Boolean" /> + </secondSegment> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="RoleGroup (1..1)" + type="RoleGroup"> + <model> + <elements xsi:type="org.framed.orm.model:Shape" name="Source" + outgoingRelations="//@framedModel/@elements.4/@model/@elements.0/@model/@elements.2 //@framedModel/@elements.4/@model/@elements.0/@model/@elements.3" + type="RoleType"> + <secondSegment> + <elements name="withdraw(amount:Money)" /> + </secondSegment> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="Target" + incomingRelations="//@framedModel/@elements.4/@model/@elements.0/@model/@elements.2 //@framedModel/@elements.4/@model/@elements.0/@model/@elements.3" + type="RoleType"> + <secondSegment> + <elements name="deposite(amount:Money)" /> + </secondSegment> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="trans" + type="Relationship" + target="//@framedModel/@elements.4/@model/@elements.0/@model/@elements.1" + source="//@framedModel/@elements.4/@model/@elements.0/@model/@elements.0" + referencedRelation="//@framedModel/@elements.4/@model/@elements.0/@model/@elements.3"> + <sourceLabel name="1" /> + <targetLabel name="1" /> + </elements> + <elements xsi:type="org.framed.orm.model:Relation" name="" + type="Irreflexive" + target="//@framedModel/@elements.4/@model/@elements.0/@model/@elements.1" + source="//@framedModel/@elements.4/@model/@elements.0/@model/@elements.0" + referencedRelation="//@framedModel/@elements.4/@model/@elements.0/@model/@elements.2" /> + </model> + <description name="2..2" /> + </elements> + </model> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="Account" + outgoingRelations="//@framedModel/@elements.14 //@framedModel/@elements.15" + type="NaturalType"> + <firstSegment> + <elements name="id : Integer" /> + <elements name="balance : Money" /> + </firstSegment> + <secondSegment> + <elements name="getBalance() : Money" /> + <elements name="getId() : Integer" /> + <elements name="increase(amount: Money)" /> + <elements name="decrease(amount : Money)" /> + </secondSegment> + </elements> + <elements xsi:type="org.framed.orm.model:Shape" name="Integer" + type="DataType" /> + <elements xsi:type="org.framed.orm.model:Shape" name="Boolean" + type="DataType" /> + <elements xsi:type="org.framed.orm.model:Shape" name="Money" + type="DataType" /> + <elements xsi:type="org.framed.orm.model:Shape" name="Double" + type="DataType" /> + <elements xsi:type="org.framed.orm.model:Shape" name="DateTime" + type="DataType" /> + <elements xsi:type="org.framed.orm.model:Relation" name="" + type="Fulfillment" target="//@framedModel/@elements.2" source="//@framedModel/@elements.0" + referencedRoles="//@framedModel/@elements.2/@model/@elements.1 //@framedModel/@elements.2/@model/@elements.0" /> + <elements xsi:type="org.framed.orm.model:Relation" name="" + type="Fulfillment" target="//@framedModel/@elements.2" source="//@framedModel/@elements.1" + referencedRoles="//@framedModel/@elements.2/@model/@elements.0" /> + <elements xsi:type="org.framed.orm.model:Relation" name="" + type="Fulfillment" target="//@framedModel/@elements.2" source="//@framedModel/@elements.4" + referencedRoles="//@framedModel/@elements.2/@model/@elements.3" /> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" + target="//@framedModel/@elements.2" source="//@framedModel/@elements.5" + referencedRoles="//@framedModel/@elements.2/@model/@elements.4" /> + <elements xsi:type="org.framed.orm.model:Relation" type="Fulfillment" + target="//@framedModel/@elements.2" source="//@framedModel/@elements.5" + referencedRoles="//@framedModel/@elements.4/@model/@elements.0" /> + <framedConfiguration> + <features/> + <features name="Role_Types"/> + <features name="Role_Structure"/> + <features name="Role_Properties" manuallySelected="true"/> + <features name="Role_Behavior"/> + <features name="Role_Inheritance" manuallySelected="true"/> + <features name="Playable"/> + <features name="Players"/> + <features name="Naturals"/> + <features name="Roles"/> + <features name="Compartments" manuallySelected="true"/> + <features name="Dates" manuallySelected="true"/> + <features name="Dependent"/> + <features name="On_Compartments"/> + <features name="On_Relationships"/> + <features name="Role_Constraints"/> + <features name="Role_Implication" manuallySelected="true"/> + <features name="Role_Prohibition" manuallySelected="true"/> + <features name="Role_Equivalence"/> + <features name="Group_Constraints" manuallySelected="true"/> + <features name="Occurrence_Constraints" manuallySelected="true"/> + <features name="Relationships"/> + <features name="Relationship_Constraints"/> + <features name="Relationship_Cardinality" manuallySelected="true"/> + <features name="Intra_Relationship_Constraints"/> + <features name="Parthood_Constraints" manuallySelected="true"/> + <features name="Inter_Relationship_Constraints" manuallySelected="true"/> + <features name="Compartment_Types"/> + <features name="Compartment_Structure"/> + <features name="Compartment_Properties" manuallySelected="true"/> + <features name="Compartment_Behavior"/> + <features name="Compartment_Inheritance" manuallySelected="true"/> + <features name="Participants"/> + <features name="Contains_Compartments" manuallySelected="true"/> + <features name="Playable_by_Defining_Compartment" manuallySelected="true"/> + <features name="Data_Types"/> + <features name="Data_Type_Inheritance" manuallySelected="true"/> + </framedConfiguration> + </framedModel> + <cromModel> + <elements xsi:type="crom_l1_composed:NaturalType" name="Person"> + <attributes name="title" type="//@cromModel/@elements.3" /> + <attributes name="firstName" type="//@cromModel/@elements.3" /> + <attributes name="lastName" type="//@cromModel/@elements.3" /> + <attributes name="address" type="//@cromModel/@elements.3" /> + </elements> + <elements xsi:type="crom_l1_composed:NaturalType" name="Company"> + <attributes name="name" type="//@cromModel/@elements.3" /> + <attributes name="legalForm" type="//@cromModel/@elements.3" /> + <attributes name="addresses" type="//@cromModel/@elements.3" /> + <attributes name="POBox" type="//@cromModel/@elements.3" /> + </elements> + <elements xsi:type="crom_l1_composed:CompartmentType" name="Bank"> + <attributes name="name" type="//@cromModel/@elements.3" /> + <operations name="executeTransactions" /> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="Customer" + incoming="//@cromModel/@elements.2/@relationships.0" + outgoing="//@cromModel/@elements.2/@relationships.1 //@cromModel/@elements.2/@relationships.2"> + <attributes name="id" type="//@cromModel/@elements.6" /> + <attributes name="name" type="//@cromModel/@elements.3" /> + <operations name="addSavingsAccount" type="//@cromModel/@elements.7" /> + <operations name="addCheckingsAccount" type="//@cromModel/@elements.7" /> + <operations name="getAccounts" type="//@cromModel/@elements.6" /> + <operations name="getBalance" type="//@cromModel/@elements.8"> + <params name="id" type="//@cromModel/@elements.6" /> + </operations> + <operations name="transfer" type="//@cromModel/@elements.7"> + <params name="from" type="//@cromModel/@elements.6" /> + <params name="to" type="//@cromModel/@elements.6" /> + </operations> + <operations name="sendAccountStatement" type="//@cromModel/@elements.7"> + <params name="id" type="//@cromModel/@elements.6" /> + </operations> + </role> + </parts> + <parts lower="1"> + <role xsi:type="crom_l1_composed:RoleType" name="Consultant" + outgoing="//@cromModel/@elements.2/@relationships.0"> + <attributes name="Phone" type="//@cromModel/@elements.3" /> + <operations name="consult"> + <params name="id" type="//@cromModel/@elements.6" /> + </operations> + </role> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleType" name="Transaction"> + <attributes name="execution" type="//@cromModel/@elements.10" /> + <operations name="execute" type="//@cromModel/@elements.7" /> + <operations name="isExecuted" type="//@cromModel/@elements.7" /> + </role> + </parts> + <parts> + <role xsi:type="crom_l1_composed:RoleGroup" name="RoleGroup" + lower="1" upper="1"> + <elements xsi:type="crom_l1_composed:RoleType" name="CheckingsAccount" + incoming="//@cromModel/@elements.2/@relationships.1"> + <attributes name="limit" type="//@cromModel/@elements.8" /> + <operations name="decrease"> + <params name="amount" type="//@cromModel/@elements.8" /> + </operations> + <operations name="getLimit" type="//@cromModel/@elements.8" /> + <operations name="setLimit"> + <params name="limit" type="//@cromModel/@elements.8" /> + </operations> + </elements> + <elements xsi:type="crom_l1_composed:RoleType" name="SavingsAccount" + incoming="//@cromModel/@elements.2/@relationships.2"> + <attributes name="transactionFee" type="//@cromModel/@elements.9" /> + <operations name="decrease"> + <params name="amount" type="//@cromModel/@elements.8" /> + </operations> + </elements> + </role> + </parts> + <relationships name="advices"> + <first holder="//@cromModel/@elements.2/@parts.1/@role" /> + <second lower="1" holder="//@cromModel/@elements.2/@parts.0/@role" /> + </relationships> + <relationships name="own_ca"> + <first lower="1" upper="1" + holder="//@cromModel/@elements.2/@parts.0/@role" /> + <second holder="//@cromModel/@elements.2/@parts.3/@role/@elements.0" /> + </relationships> + <relationships name="own_sa"> + <first lower="1" holder="//@cromModel/@elements.2/@parts.0/@role" /> + <second holder="//@cromModel/@elements.2/@parts.3/@role/@elements.1" /> + </relationships> + </elements> + <elements xsi:type="crom_l1_composed:DataType" name="String" /> + <elements xsi:type="crom_l1_composed:CompartmentType" name="Transaction"> + <attributes name="creationtime" type="//@cromModel/@elements.10" /> + <attributes name="amount" type="//@cromModel/@elements.8" /> + <operations name="bind" type="//@cromModel/@elements.7"> + <params name="source" type="//@cromModel/@elements.5" /> + <params name="target" type="//@cromModel/@elements.5" /> + </operations> + <operations name="execute" type="//@cromModel/@elements.7" /> + <parts lower="2" upper="2"> + <role xsi:type="crom_l1_composed:RoleGroup" name="RoleGroup" + lower="1" upper="1"> + <elements xsi:type="crom_l1_composed:RoleType" name="Source" + outgoing="//@cromModel/@elements.4/@relationships.0"> + <operations name="withdraw"> + <params name="amount" type="//@cromModel/@elements.8" /> + </operations> + </elements> + <elements xsi:type="crom_l1_composed:RoleType" name="Target" + incoming="//@cromModel/@elements.4/@relationships.0"> + <operations name="deposite"> + <params name="amount" type="//@cromModel/@elements.8" /> + </operations> + </elements> + </role> + </parts> + <relationships name="trans"> + <first lower="1" upper="1" + holder="//@cromModel/@elements.4/@parts.0/@role/@elements.0" /> + <second lower="1" upper="1" + holder="//@cromModel/@elements.4/@parts.0/@role/@elements.1" /> + </relationships> + <constraints xsi:type="crom_l1_composed:Irreflexive" + relation="//@cromModel/@elements.4/@relationships.0" /> + </elements> + <elements xsi:type="crom_l1_composed:NaturalType" name="Account"> + <attributes name="id" type="//@cromModel/@elements.6" /> + <attributes name="balance" type="//@cromModel/@elements.8" /> + <operations name="getBalance" type="//@cromModel/@elements.8" /> + <operations name="getId" type="//@cromModel/@elements.6" /> + <operations name="increase"> + <params name="amount" type="//@cromModel/@elements.8" /> + </operations> + <operations name="decrease"> + <params name="amount" type="//@cromModel/@elements.8" /> + </operations> + </elements> + <elements xsi:type="crom_l1_composed:DataType" name="Integer" /> + <elements xsi:type="crom_l1_composed:DataType" name="Boolean" /> + <elements xsi:type="crom_l1_composed:DataType" name="Money" /> + <elements xsi:type="crom_l1_composed:DataType" name="Double" /> + <elements xsi:type="crom_l1_composed:DataType" name="DateTime" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.2/@parts.1/@role" filler="//@cromModel/@elements.0" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.2/@parts.0/@role" filler="//@cromModel/@elements.0" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.2/@parts.0/@role" filler="//@cromModel/@elements.1" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.2/@parts.2/@role" filler="//@cromModel/@elements.4" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.2/@parts.3/@role" filler="//@cromModel/@elements.5" /> + <relations xsi:type="crom_l1_composed:Fulfillment" + filled="//@cromModel/@elements.4/@parts.0/@role" filler="//@cromModel/@elements.5" /> + </cromModel> +</ts:TestCase> diff --git a/org.framed.orm.transformation.test/text/description.txt b/org.framed.orm.transformation.test/text/description.txt new file mode 100644 index 0000000000000000000000000000000000000000..ad49745ab5fe89adc9bcbe240ba2881cf6883be1 --- /dev/null +++ b/org.framed.orm.transformation.test/text/description.txt @@ -0,0 +1,14 @@ +Model Testmodel + +This model description is not a real EMF artifact. It was generated by the +org.eclipse.emf.examples.generator.validator plug-in to illustrate how EMF's +code generator can be extended. +This can be disabled with -vmargs -Dorg.eclipse.emf.examples.generator.validator=false. + +Package test <http://org.framed/testmodel> + + Class TestCase + Attribute title : EString + Attribute description : EString + Reference framedModel : Model + Reference cromModel : Model