From a68f2ae355966f4cf2bd2d772a95074b6086fbcc Mon Sep 17 00:00:00 2001
From: Chrissi <christopher@hbsc-werner.de>
Date: Thu, 6 Jun 2019 16:06:34 +0200
Subject: [PATCH] change package namings in ecore models + use ns prefix as
 package name in code generator

---
 assets/models/AML.ecore                       |   2 +-
 assets/models/IMDBDatabase.ecore              |   2 +-
 assets/models/Library.ecore                   |   2 +-
 assets/models/ModelJoinLibrary.ecore          |   4 +-
 assets/models/TT.ttmodel                      | 137 +++++++++++++-----
 .../model_sync/generator/Generator.scala      |   2 +-
 .../conversion/SClassConverter.scala          |  14 +-
 .../generator/conversion/SEnumConverter.scala |   2 +-
 .../conversion/SModelGenerator.scala          |   5 +-
 .../generator/test/ApplicationTest.scala      |   1 +
 10 files changed, 121 insertions(+), 50 deletions(-)

diff --git a/assets/models/AML.ecore b/assets/models/AML.ecore
index 488c44f..db85f69 100644
--- a/assets/models/AML.ecore
+++ b/assets/models/AML.ecore
@@ -1,6 +1,6 @@
 <?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="amlanguage" nsURI="http://www.example.org/aml" nsPrefix="aml">
+    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="AMLLanguage" nsURI="http://www.example.org/aml" nsPrefix="org.rosi_project.example.mm.aml">
   <eClassifiers xsi:type="ecore:EClass" name="CAEXObject" abstract="true">
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="id" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
diff --git a/assets/models/IMDBDatabase.ecore b/assets/models/IMDBDatabase.ecore
index 952ef85..9c09d12 100644
--- a/assets/models/IMDBDatabase.ecore
+++ b/assets/models/IMDBDatabase.ecore
@@ -1,6 +1,6 @@
 <?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="imdbdatabase" nsURI="http://www.example.org/database" nsPrefix="database">
+    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="IMDBdatabase" nsURI="http://www.example.org/database" nsPrefix="org.rosi_project.example.mm.database">
   <eClassifiers xsi:type="ecore:EClass" name="IMDB">
     <eStructuralFeatures xsi:type="ecore:EReference" name="users" upperBound="-1"
         eType="#//User" containment="true" eOpposite="#//User/library"/>
diff --git a/assets/models/Library.ecore b/assets/models/Library.ecore
index 68c34fc..3317912 100644
--- a/assets/models/Library.ecore
+++ b/assets/models/Library.ecore
@@ -1,6 +1,6 @@
 <?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="library" nsURI="http://www.example.org/library" nsPrefix="lib">
+    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="Library" nsURI="http://www.example.org/library" nsPrefix="org.rosi_project.example.mm.lib">
   <eClassifiers xsi:type="ecore:EClass" name="Library">
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" unique="false" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
     <eStructuralFeatures xsi:type="ecore:EReference" name="employees" upperBound="-1"
diff --git a/assets/models/ModelJoinLibrary.ecore b/assets/models/ModelJoinLibrary.ecore
index f038003..d98f470 100644
--- a/assets/models/ModelJoinLibrary.ecore
+++ b/assets/models/ModelJoinLibrary.ecore
@@ -1,7 +1,7 @@
 <?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="eclipselibrary" nsURI="http://www.example.org/eclipselibrary"
-    nsPrefix="elib">
+    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="EclipseLibrary" nsURI="http://www.example.org/eclipselibrary"
+    nsPrefix="org.rosi_project.example.mm.elib">
   <eClassifiers xsi:type="ecore:EClass" name="Item">
     <eStructuralFeatures xsi:type="ecore:EAttribute" name="publicationDate" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
   </eClassifiers>
diff --git a/assets/models/TT.ttmodel b/assets/models/TT.ttmodel
index 98d2058..55150aa 100644
--- a/assets/models/TT.ttmodel
+++ b/assets/models/TT.ttmodel
@@ -1,66 +1,137 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<TruthTable xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://www.transformation-tool-contest.eu/2019/tt" name="Test">
-  <ports xsi:type="InputPort" name="a" cells="//@rows.0/@cells.0 //@rows.1/@cells.0 //@rows.2/@cells.0 //@rows.3/@cells.0 //@rows.4/@cells.0 //@rows.5/@cells.0 //@rows.6/@cells.0 //@rows.7/@cells.0 //@rows.8/@cells.0"/>
-  <ports xsi:type="InputPort" name="b" cells="//@rows.0/@cells.1 //@rows.1/@cells.1 //@rows.2/@cells.1 //@rows.3/@cells.1 //@rows.4/@cells.1 //@rows.5/@cells.1 //@rows.7/@cells.1 //@rows.8/@cells.1"/>
-  <ports xsi:type="InputPort" name="c" cells="//@rows.1/@cells.2 //@rows.2/@cells.2 //@rows.3/@cells.2 //@rows.4/@cells.2 //@rows.5/@cells.2 //@rows.7/@cells.2 //@rows.8/@cells.2"/>
-  <ports xsi:type="InputPort" name="d" cells="//@rows.1/@cells.3 //@rows.2/@cells.3 //@rows.4/@cells.3 //@rows.5/@cells.3 //@rows.6/@cells.1 //@rows.7/@cells.3 //@rows.8/@cells.3"/>
-  <ports xsi:type="OutputPort" name="s" cells="//@rows.0/@cells.2 //@rows.1/@cells.4 //@rows.2/@cells.4 //@rows.3/@cells.3 //@rows.4/@cells.4 //@rows.5/@cells.4 //@rows.6/@cells.2 //@rows.7/@cells.4 //@rows.8/@cells.4"/>
+<?xml version="1.0" encoding="ASCII"?>
+<tt:TruthTable xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tt="https://www.transformation-tool-contest.eu/2019/tt" name="TableI4O2Seed42">
+  <ports xsi:type="tt:InputPort" name="I0" cells="//@rows.0/@cells.0 //@rows.1/@cells.0 //@rows.2/@cells.0 //@rows.3/@cells.0 //@rows.4/@cells.0 //@rows.5/@cells.0 //@rows.6/@cells.0 //@rows.7/@cells.0 //@rows.8/@cells.0 //@rows.9/@cells.0 //@rows.10/@cells.0 //@rows.11/@cells.0 //@rows.12/@cells.0 //@rows.13/@cells.0 //@rows.14/@cells.0 //@rows.15/@cells.0"/>
+  <ports xsi:type="tt:InputPort" name="I1" cells="//@rows.0/@cells.1 //@rows.1/@cells.1 //@rows.2/@cells.1 //@rows.3/@cells.1 //@rows.4/@cells.1 //@rows.5/@cells.1 //@rows.6/@cells.1 //@rows.7/@cells.1 //@rows.8/@cells.1 //@rows.9/@cells.1 //@rows.10/@cells.1 //@rows.11/@cells.1 //@rows.12/@cells.1 //@rows.13/@cells.1 //@rows.14/@cells.1 //@rows.15/@cells.1"/>
+  <ports xsi:type="tt:InputPort" name="I2" cells="//@rows.0/@cells.2 //@rows.1/@cells.2 //@rows.2/@cells.2 //@rows.3/@cells.2 //@rows.4/@cells.2 //@rows.5/@cells.2 //@rows.6/@cells.2 //@rows.7/@cells.2 //@rows.8/@cells.2 //@rows.9/@cells.2 //@rows.10/@cells.2 //@rows.11/@cells.2 //@rows.12/@cells.2 //@rows.13/@cells.2 //@rows.14/@cells.2 //@rows.15/@cells.2"/>
+  <ports xsi:type="tt:InputPort" name="I3" cells="//@rows.0/@cells.3 //@rows.1/@cells.3 //@rows.2/@cells.3 //@rows.3/@cells.3 //@rows.4/@cells.3 //@rows.5/@cells.3 //@rows.6/@cells.3 //@rows.7/@cells.3 //@rows.8/@cells.3 //@rows.9/@cells.3 //@rows.10/@cells.3 //@rows.11/@cells.3 //@rows.12/@cells.3 //@rows.13/@cells.3 //@rows.14/@cells.3 //@rows.15/@cells.3"/>
+  <ports xsi:type="tt:OutputPort" name="O0" cells="//@rows.0/@cells.4 //@rows.1/@cells.4 //@rows.2/@cells.4 //@rows.3/@cells.4 //@rows.4/@cells.4 //@rows.5/@cells.4 //@rows.6/@cells.4 //@rows.7/@cells.4 //@rows.8/@cells.4 //@rows.9/@cells.4 //@rows.10/@cells.4 //@rows.11/@cells.4 //@rows.12/@cells.4 //@rows.13/@cells.4 //@rows.14/@cells.4 //@rows.15/@cells.4"/>
+  <ports xsi:type="tt:OutputPort" name="O1" cells="//@rows.0/@cells.5 //@rows.1/@cells.5 //@rows.2/@cells.5 //@rows.3/@cells.5 //@rows.4/@cells.5 //@rows.5/@cells.5 //@rows.6/@cells.5 //@rows.7/@cells.5 //@rows.8/@cells.5 //@rows.9/@cells.5 //@rows.10/@cells.5 //@rows.11/@cells.5 //@rows.12/@cells.5 //@rows.13/@cells.5 //@rows.14/@cells.5 //@rows.15/@cells.5"/>
   <rows>
-    <cells value="false" port="//@ports.0"/>
-    <cells value="false" port="//@ports.1"/>
-    <cells value="false" port="//@ports.4"/>
+    <cells port="//@ports.0"/>
+    <cells port="//@ports.1"/>
+    <cells port="//@ports.2"/>
+    <cells port="//@ports.3"/>
+    <cells value="true" port="//@ports.4"/>
+    <cells port="//@ports.5"/>
   </rows>
   <rows>
-    <cells value="false" port="//@ports.0"/>
-    <cells value="true" port="//@ports.1"/>
-    <cells value="false" port="//@ports.2"/>
-    <cells value="false" port="//@ports.3"/>
+    <cells value="true" port="//@ports.0"/>
+    <cells port="//@ports.1"/>
+    <cells port="//@ports.2"/>
+    <cells port="//@ports.3"/>
     <cells value="true" port="//@ports.4"/>
+    <cells port="//@ports.5"/>
   </rows>
   <rows>
-    <cells value="false" port="//@ports.0"/>
+    <cells port="//@ports.0"/>
     <cells value="true" port="//@ports.1"/>
-    <cells value="false" port="//@ports.2"/>
-    <cells value="true" port="//@ports.3"/>
-    <cells value="false" port="//@ports.4"/>
+    <cells port="//@ports.2"/>
+    <cells port="//@ports.3"/>
+    <cells port="//@ports.4"/>
+    <cells value="true" port="//@ports.5"/>
   </rows>
   <rows>
-    <cells value="false" port="//@ports.0"/>
+    <cells value="true" port="//@ports.0"/>
     <cells value="true" port="//@ports.1"/>
+    <cells port="//@ports.2"/>
+    <cells port="//@ports.3"/>
+    <cells port="//@ports.4"/>
+    <cells value="true" port="//@ports.5"/>
+  </rows>
+  <rows>
+    <cells port="//@ports.0"/>
+    <cells port="//@ports.1"/>
     <cells value="true" port="//@ports.2"/>
-    <cells value="false" port="//@ports.4"/>
+    <cells port="//@ports.3"/>
+    <cells value="true" port="//@ports.4"/>
+    <cells port="//@ports.5"/>
   </rows>
   <rows>
     <cells value="true" port="//@ports.0"/>
-    <cells value="false" port="//@ports.1"/>
-    <cells value="false" port="//@ports.2"/>
-    <cells value="false" port="//@ports.3"/>
-    <cells value="false" port="//@ports.4"/>
+    <cells port="//@ports.1"/>
+    <cells value="true" port="//@ports.2"/>
+    <cells port="//@ports.3"/>
+    <cells value="true" port="//@ports.4"/>
+    <cells port="//@ports.5"/>
+  </rows>
+  <rows>
+    <cells port="//@ports.0"/>
+    <cells value="true" port="//@ports.1"/>
+    <cells value="true" port="//@ports.2"/>
+    <cells port="//@ports.3"/>
+    <cells port="//@ports.4"/>
+    <cells port="//@ports.5"/>
   </rows>
   <rows>
     <cells value="true" port="//@ports.0"/>
-    <cells value="false" port="//@ports.1"/>
+    <cells value="true" port="//@ports.1"/>
     <cells value="true" port="//@ports.2"/>
-    <cells value="false" port="//@ports.3"/>
-    <cells value="true" port="//@ports.4"/>
+    <cells port="//@ports.3"/>
+    <cells port="//@ports.4"/>
+    <cells value="true" port="//@ports.5"/>
+  </rows>
+  <rows>
+    <cells port="//@ports.0"/>
+    <cells port="//@ports.1"/>
+    <cells port="//@ports.2"/>
+    <cells value="true" port="//@ports.3"/>
+    <cells port="//@ports.4"/>
+    <cells value="true" port="//@ports.5"/>
   </rows>
   <rows>
     <cells value="true" port="//@ports.0"/>
+    <cells port="//@ports.1"/>
+    <cells port="//@ports.2"/>
+    <cells value="true" port="//@ports.3"/>
+    <cells value="true" port="//@ports.4"/>
+    <cells value="true" port="//@ports.5"/>
+  </rows>
+  <rows>
+    <cells port="//@ports.0"/>
+    <cells value="true" port="//@ports.1"/>
+    <cells port="//@ports.2"/>
     <cells value="true" port="//@ports.3"/>
-    <cells value="false" port="//@ports.4"/>
+    <cells value="true" port="//@ports.4"/>
+    <cells port="//@ports.5"/>
   </rows>
   <rows>
     <cells value="true" port="//@ports.0"/>
     <cells value="true" port="//@ports.1"/>
-    <cells value="false" port="//@ports.2"/>
-    <cells value="false" port="//@ports.3"/>
+    <cells port="//@ports.2"/>
+    <cells value="true" port="//@ports.3"/>
+    <cells port="//@ports.4"/>
+    <cells port="//@ports.5"/>
+  </rows>
+  <rows>
+    <cells port="//@ports.0"/>
+    <cells port="//@ports.1"/>
+    <cells value="true" port="//@ports.2"/>
+    <cells value="true" port="//@ports.3"/>
     <cells value="true" port="//@ports.4"/>
+    <cells value="true" port="//@ports.5"/>
+  </rows>
+  <rows>
+    <cells value="true" port="//@ports.0"/>
+    <cells port="//@ports.1"/>
+    <cells value="true" port="//@ports.2"/>
+    <cells value="true" port="//@ports.3"/>
+    <cells port="//@ports.4"/>
+    <cells value="true" port="//@ports.5"/>
+  </rows>
+  <rows>
+    <cells port="//@ports.0"/>
+    <cells value="true" port="//@ports.1"/>
+    <cells value="true" port="//@ports.2"/>
+    <cells value="true" port="//@ports.3"/>
+    <cells port="//@ports.4"/>
+    <cells port="//@ports.5"/>
   </rows>
   <rows>
     <cells value="true" port="//@ports.0"/>
     <cells value="true" port="//@ports.1"/>
     <cells value="true" port="//@ports.2"/>
-    <cells value="false" port="//@ports.3"/>
-    <cells value="false" port="//@ports.4"/>
+    <cells value="true" port="//@ports.3"/>
+    <cells value="true" port="//@ports.4"/>
+    <cells port="//@ports.5"/>
   </rows>
-</TruthTable>
+</tt:TruthTable>
diff --git a/src/main/scala/org/rosi_project/model_sync/generator/Generator.scala b/src/main/scala/org/rosi_project/model_sync/generator/Generator.scala
index c81f258..04d8100 100644
--- a/src/main/scala/org/rosi_project/model_sync/generator/Generator.scala
+++ b/src/main/scala/org/rosi_project/model_sync/generator/Generator.scala
@@ -32,7 +32,7 @@ class Generator(config: GeneratorConfig) {
       }
 
       //read the ecore models
-      var ecoreModels: Map[String, ClassAndInstance] = Map.empty
+      var ecoreModels: Map[String, ClassAndInstance] = Map.empty      
       try {
         config.sources.foreach(s => {
           ecoreModels = ecoreModels + (s -> (new EcoreLoader loadEcore s))
diff --git a/src/main/scala/org/rosi_project/model_sync/generator/conversion/SClassConverter.scala b/src/main/scala/org/rosi_project/model_sync/generator/conversion/SClassConverter.scala
index b162a3b..346a2f2 100644
--- a/src/main/scala/org/rosi_project/model_sync/generator/conversion/SClassConverter.scala
+++ b/src/main/scala/org/rosi_project/model_sync/generator/conversion/SClassConverter.scala
@@ -20,14 +20,14 @@ class SClassConverter extends Converter[EClass, SClass] {
     (source.getEAttributes: List[EAttribute]).foreach(eAttr => {      
       val attrType: STypedElement = STypeRegistry
         // check if the attribute type is already known and registered
-        .query(eAttr.getEAttributeType.getName, eAttr.getEAttributeType.getEPackage.getName)
+        .query(eAttr.getEAttributeType.getName, eAttr.getEAttributeType.getEPackage.getNsPrefix)
         // otherwise create a new type
         .getOrElse {
           val newAttr = EmfTypeTranslator
             // if the type is wrapped by EMF (such as EString), use the corresponding scala type
             .getSClassFromEmf(eAttr.getEAttributeType)
             // otherwise create a new class (as the attribute should instance of a class rather than a type in this case)
-            .getOrElse(new SClass(eAttr.getEAttributeType.getName, eAttr.getEAttributeType.getEPackage.getName))
+            .getOrElse(new SClass(eAttr.getEAttributeType.getName, eAttr.getEAttributeType.getEPackage.getNsPrefix))
 
           // finally save the type
           STypeRegistry.addType(newAttr, null)
@@ -41,7 +41,7 @@ class SClassConverter extends Converter[EClass, SClass] {
       .foreach(eRef => {
         val refName: String = eRef.getName //Attribute name       
         val refType: String = eRef.getEReferenceType.getName //Name of the attribute type
-        val refTypePckg: String = eRef.getEReferenceType.getEPackage.getName //Package name of the attribute type
+        val refTypePckg: String = eRef.getEReferenceType.getEPackage.getNsPrefix //Package name of the attribute type
         val containment: Boolean = eRef.isContainment() //Containment relation or not
         val oppositeERef: EReference = eRef.getEOpposite() //Opposite reference
         var oppositeRef: SReference = null //Opposite reference
@@ -106,7 +106,7 @@ class SClassConverter extends Converter[EClass, SClass] {
         .queryForName(p.getName)
         // otherwise we need to create and register it
         .getOrElse {
-          val parentSClass: SClass = new SClass(p.getName, p.getEPackage.getName)
+          val parentSClass: SClass = new SClass(p.getName, p.getEPackage.getNsPrefix)
           // register the parent (it will be visited and completely inflated later on)
           STypeRegistry.addType(parentSClass, null)
           parentSClass
@@ -119,7 +119,7 @@ class SClassConverter extends Converter[EClass, SClass] {
         .queryForName(p.getName)
         // otherwise we need to create and register it
         .getOrElse {
-          val parentSClass: SClass = new SClass(p.getName, sPackage = p.getEPackage.getName)
+          val parentSClass: SClass = new SClass(p.getName, sPackage = p.getEPackage.getNsPrefix)
           // register the parent (it will be visited and completely inflated later on)
           STypeRegistry.addType(parentSClass)
           parentSClass
@@ -136,7 +136,7 @@ class SClassConverter extends Converter[EClass, SClass] {
      *  have the type known). Therefore we will set these now.
      */
 
-    val currentClass: Option[STypedElement] = STypeRegistry.query(source.getName, source.getEPackage.getName)
+    val currentClass: Option[STypedElement] = STypeRegistry.query(source.getName, source.getEPackage.getNsPrefix)
 
     currentClass.map {
       case clazz: SClass =>
@@ -149,7 +149,7 @@ class SClassConverter extends Converter[EClass, SClass] {
       case sType =>
         sys.error(s"sType should have been a class: $sType")
     }.getOrElse {
-      val createdClass: SClass = new SClass(source.getName, source.getEPackage.getName, source.isAbstract, source.isInterface)
+      val createdClass: SClass = new SClass(source.getName, source.getEPackage.getNsPrefix, source.isAbstract, source.isInterface)
       createdClass.setAttributes(attrs)
       createdClass.setReferences(refs)
       pars.foreach(p => {
diff --git a/src/main/scala/org/rosi_project/model_sync/generator/conversion/SEnumConverter.scala b/src/main/scala/org/rosi_project/model_sync/generator/conversion/SEnumConverter.scala
index ba54c91..127ac5b 100644
--- a/src/main/scala/org/rosi_project/model_sync/generator/conversion/SEnumConverter.scala
+++ b/src/main/scala/org/rosi_project/model_sync/generator/conversion/SEnumConverter.scala
@@ -16,7 +16,7 @@ class SEnumConverter extends Converter[EEnum, SEnum] {
       strings += elit.getName
     }) 
     
-    val createdEnum: SEnum = new SEnum(source.getName, source.getEPackage.getName, strings)
+    val createdEnum: SEnum = new SEnum(source.getName, source.getEPackage.getNsPrefix, strings)
     STypeRegistry.addType(createdEnum, null)
     createdEnum
   }
diff --git a/src/main/scala/org/rosi_project/model_sync/generator/conversion/SModelGenerator.scala b/src/main/scala/org/rosi_project/model_sync/generator/conversion/SModelGenerator.scala
index 4a82455..a8ed626 100644
--- a/src/main/scala/org/rosi_project/model_sync/generator/conversion/SModelGenerator.scala
+++ b/src/main/scala/org/rosi_project/model_sync/generator/conversion/SModelGenerator.scala
@@ -14,7 +14,7 @@ import org.eclipse.emf.ecore.EEnum
 class SModelGenerator extends Converter[EPackage, SModel] {
 
   override def convert(source: EPackage, sourceName: String): SModel = {
-    val packageName = if (source.getName != null) source.getName else ""
+    //val packageName = if (source.getName != null) source.getName else ""
     var contents = source.eAllContents().asScala
     val model = new ComplexSModel(source.getName, sourceName)
 
@@ -22,8 +22,7 @@ class SModelGenerator extends Converter[EPackage, SModel] {
     println("First run creates all classes, important for abstract and interface relations")
     contents.foreach {
       case ec: EClass =>
-        //println(ec)
-        STypeRegistry.addType(new SClass(ec.getName, ec.getEPackage.getName, ec.isAbstract, ec.isInterface), ec)
+        STypeRegistry.addType(new SClass(ec.getName, ec.getEPackage.getNsPrefix, ec.isAbstract, ec.isInterface), ec)
       case ee: EEnum =>
         //prinltn(ee)
         model.addModelEnums(new SEnumConverter convert (ee, sourceName))
diff --git a/src/main/scala/org/rosi_project/model_sync/generator/test/ApplicationTest.scala b/src/main/scala/org/rosi_project/model_sync/generator/test/ApplicationTest.scala
index e887035..664b0c6 100644
--- a/src/main/scala/org/rosi_project/model_sync/generator/test/ApplicationTest.scala
+++ b/src/main/scala/org/rosi_project/model_sync/generator/test/ApplicationTest.scala
@@ -11,6 +11,7 @@ object ApplicationTest extends App {
   //runShrinkingModel(Creation.rsum)
   
   runTTC2019(Creation.rolecomb)
+  //runTTC2019(Creation.rolesync)
 
   
   //runAllTests(Creation.rsum)
-- 
GitLab