Browse Source

Make merged and RAMified world-writable

Yentl Van Tendeloo 7 years ago
parent
commit
035f93ca94
4 changed files with 101 additions and 111 deletions
  1. 15 1
      bootstrap/99_core.mvc
  2. 4 0
      bootstrap/core_algorithm.alc
  3. 81 109
      unit/test_all.py
  4. 1 1
      wrappers/modelverse_SCCD.py

+ 15 - 1
bootstrap/99_core.mvc

@@ -22,6 +22,16 @@ CF core {
         name = ""
         name = ""
         permissions = "221"
         permissions = "221"
 
 
+        Folder merged {
+            name = "merged"
+            permissions = "222"
+        }
+
+        Folder RAMified {
+            name = "RAMified"
+            permissions = "222"
+        }
+
         Folder formalisms {
         Folder formalisms {
             name = "formalisms"
             name = "formalisms"
             permissions = "221"
             permissions = "221"
@@ -146,7 +156,7 @@ CF core {
 
 
         Folder administration {
         Folder administration {
             name = "administration"
             name = "administration"
-            permissions = "221"
+            permissions = "110"
 
 
             Model CoreFormalism {
             Model CoreFormalism {
                 name = "administration/CoreFormalism"
                 name = "administration/CoreFormalism"
@@ -163,6 +173,8 @@ CF core {
     }
     }
 
 
     group (root, admin_group) {}
     group (root, admin_group) {}
+    group (RAMified, admin_group) {}
+    group (merged, admin_group) {}
     group (formalisms, admin_group) {}
     group (formalisms, admin_group) {}
     group (SimpleClassDiagrams, admin_group) {}
     group (SimpleClassDiagrams, admin_group) {}
     group (TypeMapping, admin_group) {}
     group (TypeMapping, admin_group) {}
@@ -190,6 +202,8 @@ CF core {
     group (TM_Core, admin_group) {}
     group (TM_Core, admin_group) {}
 
 
     owner (root, admin_user) {}
     owner (root, admin_user) {}
+    owner (RAMified, admin_user) {}
+    owner (merged, admin_user) {}
     owner (formalisms, admin_user) {}
     owner (formalisms, admin_user) {}
     owner (SimpleClassDiagrams, admin_user) {}
     owner (SimpleClassDiagrams, admin_user) {}
     owner (TypeMapping, admin_user) {}
     owner (TypeMapping, admin_user) {}

+ 4 - 0
bootstrap/core_algorithm.alc

@@ -364,6 +364,8 @@ String function create_folders(user_id : String, folder_name : String):
 	String new_entry
 	String new_entry
 	String cummul
 	String cummul
 
 
+	log("Writing folder " + folder_name)
+
 	if (get_entry_id(folder_name) != ""):
 	if (get_entry_id(folder_name) != ""):
 		// Folders already exist, so don't iterate
 		// Folders already exist, so don't iterate
 		return get_entry_id(folder_name)!
 		return get_entry_id(folder_name)!
@@ -391,6 +393,8 @@ String function create_folders(user_id : String, folder_name : String):
 				instantiate_link(core, "group", "", new_entry, get_group_id("nobody"))
 				instantiate_link(core, "group", "", new_entry, get_group_id("nobody"))
 				instantiate_link(core, "owner", "", new_entry, user_id)
 				instantiate_link(core, "owner", "", new_entry, user_id)
 			else:
 			else:
+				log("Not allowed to write!")
+				log("User was: " + cast_string(read_attribute(core, current_user_id, "name")))
 				return read_root()!
 				return read_root()!
 
 
 		prev = get_entry_id(cummul)
 		prev = get_entry_id(cummul)

+ 81 - 109
unit/test_all.py

@@ -44,14 +44,14 @@ model_hierarchy = \
                                "8": {},
                                "8": {},
                                "9": {},
                                "9": {},
                               },
                               },
+            "merged/": {},
+            "RAMified/": {},
             }
             }
 
 
 def verify_clean():
 def verify_clean():
     compare_locations("", set())
     compare_locations("", set())
     compare_locations("models", set())
     compare_locations("models", set())
     compare_locations("formalisms", set())
     compare_locations("formalisms", set())
-    compare_locations("administration", set())
-    compare_locations("type mappings", set())
 
 
 def get_model_list(location):
 def get_model_list(location):
     try:
     try:
@@ -109,7 +109,8 @@ class TestModelverse(unittest.TestCase):
                                       "administration/",
                                       "administration/",
                                       "type mappings/",
                                       "type mappings/",
                                       "users/",
                                       "users/",
-                                      "test/",
+                                      "merged/",
+                                      "RAMified/",
                                      ])
                                      ])
         assert model_list("formalisms") == set(["SimpleClassDiagrams",
         assert model_list("formalisms") == set(["SimpleClassDiagrams",
                                                 "ActionLanguage",
                                                 "ActionLanguage",
@@ -134,7 +135,8 @@ class TestModelverse(unittest.TestCase):
                                            ("administration/", "admin", "admin", "110"),
                                            ("administration/", "admin", "admin", "110"),
                                            ("type mappings/", "admin", "admin", "221"),
                                            ("type mappings/", "admin", "admin", "221"),
                                            ("users/", "admin", "admin", "221"),
                                            ("users/", "admin", "admin", "221"),
-                                           ("test/", "admin", "nobody", "200"),
+                                           ("merged/", "admin", "admin", "222"),
+                                           ("RAMified/", "admin", "admin", "222"),
                                           ])
                                           ])
         assert model_list_full("formalisms") == set([("SimpleClassDiagrams", "admin", "admin", "221"),
         assert model_list_full("formalisms") == set([("SimpleClassDiagrams", "admin", "admin", "221"),
                                                      ("ActionLanguage", "admin", "admin", "221"),
                                                      ("ActionLanguage", "admin", "admin", "221"),
@@ -174,12 +176,12 @@ class TestModelverse(unittest.TestCase):
         except:
         except:
             pass
             pass
 
 
-        model_add("test/a", "formalisms/ProcessModel")
-        assert verify("test/a", "formalisms/ProcessModel").startswith("Lower cardinality violated for class: ")
-        instantiate("test/a", "Start")
-        assert verify("test/a", "formalisms/ProcessModel") == "Lower cardinality violated for class: Finish"
-        instantiate("test/a", "Finish")
-        assert verify("test/a", "formalisms/ProcessModel") == "OK"
+        model_add("users/user/test/a", "formalisms/ProcessModel")
+        assert verify("users/user/test/a", "formalisms/ProcessModel").startswith("Lower cardinality violated for class: ")
+        instantiate("users/user/test/a", "Start")
+        assert verify("users/user/test/a", "formalisms/ProcessModel") == "Lower cardinality violated for class: Finish"
+        instantiate("users/user/test/a", "Finish")
+        assert verify("users/user/test/a", "formalisms/ProcessModel") == "OK"
 
 
     def test_op_permission_modify(self):
     def test_op_permission_modify(self):
         model_add("users/user/test/a", "formalisms/SimpleClassDiagrams")
         model_add("users/user/test/a", "formalisms/SimpleClassDiagrams")
@@ -291,62 +293,56 @@ class TestModelverse(unittest.TestCase):
 
 
     def test_modelling(self):
     def test_modelling(self):
         # Add a model
         # Add a model
-        model_add("test/Empty", "formalisms/SimpleClassDiagrams")
+        model_add("users/user/test/Empty", "formalisms/SimpleClassDiagrams")
 
 
         # Check that it exists
         # Check that it exists
-        compare_locations("test", set(["Empty"]))
-        compare_locations("type mappings/test", set(["Empty"]))
+        compare_locations("users/user/test", set(["Empty"]))
 
 
         # Check that it conforms
         # Check that it conforms
-        assert verify("test/Empty", "formalisms/SimpleClassDiagrams") == "OK"
+        assert verify("users/user/test/Empty", "formalisms/SimpleClassDiagrams") == "OK"
 
 
         # Check for permissions
         # Check for permissions
-        assert model_list_full("test") == set([(name, "admin", "admin", "221") for name in get_model_list("test")]) | \
-                                                set([("Empty", "admin", "nobody", "200")])
-        assert model_list_full("type mappings/test") == set([(name, "admin", "admin", "221") for name in get_model_list("type mappings/test")]) | \
-                                                              set([("Empty", "admin", "nobody", "200")])
+        assert model_list_full("users/user/test") == set([(name, "user", "nobody", "221") for name in get_model_list("users/user/test")]) | \
+                                                set([("Empty", "user", "nobody", "200")])
 
 
         # Instantiate it further
         # Instantiate it further
-        model_add("test/my_empty", "test/Empty")
-        assert verify("test/my_empty", "test/Empty") == "OK"
+        model_add("users/user/test/my_empty", "users/user/test/Empty")
+        assert verify("users/user/test/my_empty", "users/user/test/Empty") == "OK"
 
 
         # Check that it exists
         # Check that it exists
-        compare_locations("test", set(["my_empty", "Empty"]))
-        compare_locations("type mappings/test", set(["my_empty", "Empty"]))
+        compare_locations("users/user/test", set(["my_empty", "Empty"]))
 
 
         # Check that an instantiate of "A" fails
         # Check that an instantiate of "A" fails
         try:
         try:
-            res = instantiate("test/my_empty", "A")
+            res = instantiate("users/user/test/my_empty", "A")
             assert False
             assert False
         except UnknownIdentifier:
         except UnknownIdentifier:
-            assert verify("test/Empty", "formalisms/SimpleClassDiagrams") == "OK"
+            assert verify("users/user/test/Empty", "formalisms/SimpleClassDiagrams") == "OK"
 
 
         # Create something in the formalism
         # Create something in the formalism
-        instantiate("test/Empty", "Class", ID="A")
-        attr_assign("test/Empty", "A", "name", "A")
-        assert verify("test/Empty", "formalisms/SimpleClassDiagrams") == "OK"
+        instantiate("users/user/test/Empty", "Class", ID="A")
+        attr_assign("users/user/test/Empty", "A", "name", "A")
+        assert verify("users/user/test/Empty", "formalisms/SimpleClassDiagrams") == "OK"
 
 
         # Now instantiate that in the model as well, which now works
         # Now instantiate that in the model as well, which now works
-        instantiate("test/my_empty", "A")
-        assert verify("test/my_empty", "test/Empty") == "OK"
+        instantiate("users/user/test/my_empty", "A")
+        assert verify("users/user/test/my_empty", "users/user/test/Empty") == "OK"
 
 
     def test_overwrite(self):
     def test_overwrite(self):
-        model_add("test/Empty", "formalisms/SimpleClassDiagrams")
-        assert element_list("test/Empty") == set([])
+        model_add("users/user/test/Empty", "formalisms/SimpleClassDiagrams")
+        assert element_list("users/user/test/Empty") == set([])
 
 
-        instantiate("test/Empty", "Class", ID="A")
-        assert element_list("test/Empty") == set([("A", "Class")])
+        instantiate("users/user/test/Empty", "Class", ID="A")
+        assert element_list("users/user/test/Empty") == set([("A", "Class")])
 
 
-        model_overwrite("test/Empty", "")
-        assert element_list("test/Empty") == set([])
-        compare_locations("test", set(["Empty"]))
-        compare_locations("type mappings/test", set(["Empty"]))
+        model_overwrite("users/user/test/Empty", "")
+        assert element_list("users/user/test/Empty") == set([])
+        compare_locations("users/user/test", set(["Empty"]))
         
         
-        assert element_list("test/Empty") == set([])
+        assert element_list("users/user/test/Empty") == set([])
 
 
-        instantiate("test/Empty", "Class", ID="B")
-        compare_locations("test", set(["Empty"]))
-        compare_locations("type mappings/test", set(["Empty"]))
+        instantiate("users/user/test/Empty", "Class", ID="B")
+        compare_locations("users/user/test", set(["Empty"]))
 
 
     def test_operations(self):
     def test_operations(self):
         log = []
         log = []
@@ -371,10 +367,10 @@ class TestModelverse(unittest.TestCase):
             attr_assign(model, p2t2, "weight", 1)
             attr_assign(model, p2t2, "weight", 1)
             attr_assign(model, t2p1, "weight", 2)
             attr_assign(model, t2p1, "weight", 2)
 
 
-        model_add("test/PetriNet", "formalisms/SimpleClassDiagrams", open("integration/code/pn_design.mvc", "r").read())
-        model_add("test/PetriNet_Runtime", "formalisms/SimpleClassDiagrams", open("integration/code/pn_runtime.mvc", "r").read())
+        model_add("users/user/test/PetriNet", "formalisms/SimpleClassDiagrams", open("integration/code/pn_design.mvc", "r").read())
+        model_add("users/user/test/PetriNet_Runtime", "formalisms/SimpleClassDiagrams", open("integration/code/pn_runtime.mvc", "r").read())
 
 
-        model_add("test/my_pn", "test/PetriNet", open("integration/code/pn_design_model.mvc", "r").read())
+        model_add("users/user/test/my_pn", "users/user/test/PetriNet", open("integration/code/pn_design_model.mvc", "r").read())
 
 
         def add_tracability_D2R(model):
         def add_tracability_D2R(model):
             instantiate(model, "Association", ("PetriNet/Place", "PetriNet_Runtime/Place"), ID="D2R_PlaceLink")
             instantiate(model, "Association", ("PetriNet/Place", "PetriNet_Runtime/Place"), ID="D2R_PlaceLink")
@@ -384,10 +380,10 @@ class TestModelverse(unittest.TestCase):
             instantiate(model, "Association", ("PetriNet_Runtime/Place", "PetriNet/Place"), ID="R2D_PlaceLink")
             instantiate(model, "Association", ("PetriNet_Runtime/Place", "PetriNet/Place"), ID="R2D_PlaceLink")
             instantiate(model, "Association", ("PetriNet_Runtime/Transition", "PetriNet/Transition"), ID="R2D_TransitionLink")
             instantiate(model, "Association", ("PetriNet_Runtime/Transition", "PetriNet/Transition"), ID="R2D_TransitionLink")
 
 
-        transformation_add_MT({"PetriNet": "test/PetriNet"}, {}, "test/print_pn", open("integration/code/pn_print.mvc").read())
-        transformation_add_MANUAL({"PetriNet": "test/PetriNet"}, {"PetriNet_Runtime": "test/PetriNet_Runtime"}, "test/pn_design_to_runtime", add_tracability_D2R)
-        transformation_add_AL({"PetriNet_Runtime": "test/PetriNet_Runtime"}, {"PetriNet_Runtime": "test/PetriNet_Runtime"}, "test/pn_simulate", open("integration/code/pn_simulate.alc").read())
-        transformation_add_MT({"PetriNet_Runtime": "test/PetriNet_Runtime"}, {"PetriNet": "test/PetriNet"}, "test/pn_runtime_to_design", open("integration/code/pn_runtime_to_design.mvc").read(), add_tracability_R2D)
+        transformation_add_MT({"PetriNet": "users/user/test/PetriNet"}, {}, "users/user/test/print_pn", open("integration/code/pn_print.mvc").read())
+        transformation_add_MANUAL({"PetriNet": "users/user/test/PetriNet"}, {"PetriNet_Runtime": "users/user/test/PetriNet_Runtime"}, "users/user/test/pn_design_to_runtime", add_tracability_D2R)
+        transformation_add_AL({"PetriNet_Runtime": "users/user/test/PetriNet_Runtime"}, {"PetriNet_Runtime": "users/user/test/PetriNet_Runtime"}, "users/user/test/pn_simulate", open("integration/code/pn_simulate.alc").read())
+        transformation_add_MT({"PetriNet_Runtime": "users/user/test/PetriNet_Runtime"}, {"PetriNet": "users/user/test/PetriNet"}, "users/user/test/pn_runtime_to_design", open("integration/code/pn_runtime_to_design.mvc").read(), add_tracability_R2D)
 
 
         log = []
         log = []
         ctrl = log_output.Controller(log, keep_running=False)
         ctrl = log_output.Controller(log, keep_running=False)
@@ -395,15 +391,15 @@ class TestModelverse(unittest.TestCase):
         thrd.daemon = True
         thrd.daemon = True
         thrd.start()
         thrd.start()
 
 
-        assert transformation_execute_MT("test/print_pn", {"PetriNet": "test/my_pn"}, {}, (ctrl, "inp", "outp")) == True
+        assert transformation_execute_MT("users/user/test/print_pn", {"PetriNet": "users/user/test/my_pn"}, {}, (ctrl, "inp", "outp")) == True
         thrd.join()
         thrd.join()
         assert set(log) == set(['"p1" --> 1',
         assert set(log) == set(['"p1" --> 1',
                                 '"p2" --> 2',
                                 '"p2" --> 2',
                                 '"p3" --> 3'])
                                 '"p3" --> 3'])
 
 
-        assert transformation_execute_MANUAL("test/pn_design_to_runtime", {"PetriNet": "test/my_pn"}, {"PetriNet_Runtime": "test/my_pn_RT"}, manual_callback) == True
-        assert transformation_execute_AL("test/pn_simulate", {"PetriNet_Runtime": "test/my_pn_RT"}, {"PetriNet_Runtime": "test/my_pn_RT"}) == True
-        assert transformation_execute_MT("test/pn_runtime_to_design", {"PetriNet_Runtime": "test/my_pn_RT"}, {"PetriNet": "test/my_pn"}) == True
+        assert transformation_execute_MANUAL("users/user/test/pn_design_to_runtime", {"PetriNet": "users/user/test/my_pn"}, {"PetriNet_Runtime": "users/user/test/my_pn_RT"}, manual_callback) == True
+        assert transformation_execute_AL("users/user/test/pn_simulate", {"PetriNet_Runtime": "users/user/test/my_pn_RT"}, {"PetriNet_Runtime": "users/user/test/my_pn_RT"}) == True
+        assert transformation_execute_MT("users/user/test/pn_runtime_to_design", {"PetriNet_Runtime": "users/user/test/my_pn_RT"}, {"PetriNet": "users/user/test/my_pn"}) == True
 
 
         log = []
         log = []
         ctrl = log_output.Controller(log, keep_running=False)
         ctrl = log_output.Controller(log, keep_running=False)
@@ -411,27 +407,20 @@ class TestModelverse(unittest.TestCase):
         thrd.daemon = True
         thrd.daemon = True
         thrd.start()
         thrd.start()
 
 
-        assert transformation_execute_MT("test/print_pn", {"PetriNet": "test/my_pn"}, {}, (ctrl, "inp", "outp")) == True
+        assert transformation_execute_MT("users/user/test/print_pn", {"PetriNet": "users/user/test/my_pn"}, {}, (ctrl, "inp", "outp")) == True
         thrd.join()
         thrd.join()
         assert set(log) == set(['"p1" --> 0',
         assert set(log) == set(['"p1" --> 0',
                                 '"p2" --> 1',
                                 '"p2" --> 1',
                                 '"p3" --> 5'])
                                 '"p3" --> 5'])
 
 
-        model_delete("RAMified")
-        model_delete("merged")
-        model_delete(".tmp")
-        model_delete("type mappings/RAMified")
-        model_delete("type mappings/merged")
-        model_delete("type mappings/.tmp")
-
     def test_process_model_trivial_pn_subfunction(self):
     def test_process_model_trivial_pn_subfunction(self):
-        model_add("test/PetriNet", "formalisms/SimpleClassDiagrams", open("integration/code/pn_design.mvc", "r").read())
-        model_add("test/ReachabilityGraph", "formalisms/SimpleClassDiagrams", open("integration/code/reachability_graph.mvc", "r").read())
-        model_add("test/pn_reachability", "formalisms/ProcessModel", open("integration/code/pm_pn_reachability.mvc", "r").read())
-        transformation_add_MT({}, {"PetriNet": "test/PetriNet"}, "test/initialize_PN", open("integration/code/initialize_PN.mvc", "r").read())
-        transformation_add_MANUAL({"PetriNet": "test/PetriNet"}, {"PetriNet": "test/PetriNet"}, "test/refine_PN")
-        transformation_add_AL({"PetriNet": "test/PetriNet"}, {"ReachabilityGraph": "test/ReachabilityGraph"}, "test/reachability", open("integration/code/reachability_subfunction.alc", "r").read())
-        transformation_add_MT({"ReachabilityGraph": "test/ReachabilityGraph"}, {}, "test/reachability_print", open("integration/code/reachabilitygraph_print.mvc", 'r').read())
+        model_add("users/user/test/PetriNet", "formalisms/SimpleClassDiagrams", open("integration/code/pn_design.mvc", "r").read())
+        model_add("users/user/test/ReachabilityGraph", "formalisms/SimpleClassDiagrams", open("integration/code/reachability_graph.mvc", "r").read())
+        model_add("users/user/test/pn_reachability", "formalisms/ProcessModel", open("integration/code/pm_pn_reachability.mvc", "r").read())
+        transformation_add_MT({}, {"PetriNet": "users/user/test/PetriNet"}, "users/user/test/initialize_PN", open("integration/code/initialize_PN.mvc", "r").read())
+        transformation_add_MANUAL({"PetriNet": "users/user/test/PetriNet"}, {"PetriNet": "users/user/test/PetriNet"}, "users/user/test/refine_PN")
+        transformation_add_AL({"PetriNet": "users/user/test/PetriNet"}, {"ReachabilityGraph": "users/user/test/ReachabilityGraph"}, "users/user/test/reachability", open("integration/code/reachability_subfunction.alc", "r").read())
+        transformation_add_MT({"ReachabilityGraph": "users/user/test/ReachabilityGraph"}, {}, "users/user/test/reachability_print", open("integration/code/reachabilitygraph_print.mvc", 'r').read())
 
 
         def callback_refine_PN(model):
         def callback_refine_PN(model):
             p1 = instantiate(model, "PetriNet/Place")
             p1 = instantiate(model, "PetriNet/Place")
@@ -450,54 +439,37 @@ class TestModelverse(unittest.TestCase):
         thrd.daemon = True
         thrd.daemon = True
         thrd.start()
         thrd.start()
 
 
-        process_execute("test/pn_reachability", {}, {"test/refine_PN": callback_refine_PN, "test/reachability_print": (ctrl, "inp", "outp")})
+        process_execute("users/user/test/pn_reachability", {}, {"users/user/test/refine_PN": callback_refine_PN, "users/user/test/reachability_print": (ctrl, "inp", "outp")})
         thrd.join()
         thrd.join()
 
 
         assert set(log) == set(['"0": {"p1": 1}',
         assert set(log) == set(['"0": {"p1": 1}',
                                 '"1": {"p1": 0}',
                                 '"1": {"p1": 0}',
                                 '"0" --["t1"]--> "1"'])
                                 '"0" --["t1"]--> "1"'])
 
 
-        model_delete(".tmp")
-        model_delete("RAMified")
-        model_delete("merged")
-        model_delete("type mappings/RAMified")
-        model_delete("type mappings/merged")
-        model_delete("type mappings/.tmp")
-
     def test_render(self):
     def test_render(self):
-        model_add("test/CausalBlockDiagrams", "formalisms/SimpleClassDiagrams", open("integration/code/cbd_design.mvc", 'r').read())
-        model_add("test/MM_rendered_graphical", "formalisms/SimpleClassDiagrams", open("integration/code/MM_rendered_graphical.mvc", 'r').read())
-        model_add("test/my_CBD", "test/CausalBlockDiagrams", open("integration/code/my_cbd.mvc", 'r').read())
+        model_add("users/user/test/CausalBlockDiagrams", "formalisms/SimpleClassDiagrams", open("integration/code/cbd_design.mvc", 'r').read())
+        model_add("users/user/test/MM_rendered_graphical", "formalisms/SimpleClassDiagrams", open("integration/code/MM_rendered_graphical.mvc", 'r').read())
+        model_add("users/user/test/my_CBD", "users/user/test/CausalBlockDiagrams", open("integration/code/my_cbd.mvc", 'r').read())
 
 
         def add_tracability(model):
         def add_tracability(model):
             instantiate(model, "Association", ("abstract/Block", "rendered/Group"), ID="TracabilityLink")
             instantiate(model, "Association", ("abstract/Block", "rendered/Group"), ID="TracabilityLink")
 
 
-        transformation_add_MT({"abstract": "test/CausalBlockDiagrams", "rendered": "test/MM_rendered_graphical"}, {"abstract": "test/CausalBlockDiagrams", "rendered": "test/MM_rendered_graphical"}, "test/render_graphical_CBD", open("integration/code/CBD_mapper.mvc", 'r').read(), add_tracability)
-        result = model_render("test/my_CBD", "test/render_graphical_CBD", "test/my_perceptualized_CBD")
+        transformation_add_MT({"abstract": "users/user/test/CausalBlockDiagrams", "rendered": "users/user/test/MM_rendered_graphical"}, {"abstract": "users/user/test/CausalBlockDiagrams", "rendered": "users/user/test/MM_rendered_graphical"}, "users/user/test/render_graphical_CBD", open("integration/code/CBD_mapper.mvc", 'r').read(), add_tracability)
+        result = model_render("users/user/test/my_CBD", "users/user/test/render_graphical_CBD", "users/user/test/my_perceptualized_CBD")
 
 
         assert len(result) == 23
         assert len(result) == 23
 
 
-        model_delete("RAMified")
-        model_delete("merged")
-        model_delete("type mappings/RAMified")
-        model_delete("type mappings/merged")
-        model_delete("tracability")
-        model_delete("type mappings/tracability")
-
     def test_SCCD_basic(self):
     def test_SCCD_basic(self):
-        model_add("test/SCCD", "formalisms/SimpleClassDiagrams", open("integration/code/SCCD.mvc", 'r').read())
-        model_add("test/SCCD_Trace", "formalisms/SimpleClassDiagrams", open("integration/code/SCCD_Trace.mvc", 'r').read())
-
-        model_add("test/my_SCCD", "test/SCCD", open("integration/code/SCCD_all.mvc", 'r').read())
+        model_add("users/user/test/SCCD", "formalisms/SimpleClassDiagrams", open("integration/code/SCCD.mvc", 'r').read())
+        model_add("users/user/test/SCCD_Trace", "formalisms/SimpleClassDiagrams", open("integration/code/SCCD_Trace.mvc", 'r').read())
 
 
-        transformation_add_AL({"SCCD": "test/SCCD"}, {"trace": "test/SCCD_Trace"}, "test/SCCD_execute_afap", open("integration/code/SCCD_execute.alc", 'r').read().replace("afap = False", "afap = True"))
-        transformation_execute_AL("test/SCCD_execute_afap", {"SCCD": "test/my_SCCD"}, {"trace": "test/my_SCCD_trace"})
+        model_add("users/user/test/my_SCCD", "users/user/test/SCCD", open("integration/code/SCCD_all.mvc", 'r').read())
 
 
-        alter_context("test/my_SCCD_trace", "test/SCCD_Trace")
-        lst = element_list_nice("test/my_SCCD_trace")
+        transformation_add_AL({"SCCD": "users/user/test/SCCD"}, {"trace": "users/user/test/SCCD_Trace"}, "users/user/test/SCCD_execute_afap", open("integration/code/SCCD_execute.alc", 'r').read().replace("afap = False", "afap = True"))
+        transformation_execute_AL("users/user/test/SCCD_execute_afap", {"SCCD": "users/user/test/my_SCCD"}, {"trace": "users/user/test/my_SCCD_trace"})
 
 
-        model_delete("merged")
-        model_delete("type mappings/merged")
+        alter_context("users/user/test/my_SCCD_trace", "users/user/test/SCCD_Trace")
+        lst = element_list_nice("users/user/test/my_SCCD_trace")
 
 
         lst.sort(key=lambda i: (i["timestamp"], i["name"]))
         lst.sort(key=lambda i: (i["timestamp"], i["name"]))
         result = [(i["timestamp"], str(i["name"])) for i in lst if i["name"] not in ["updateTimerValue", "updateTimerColour", "resetTimer"]]
         result = [(i["timestamp"], str(i["name"])) for i in lst if i["name"] not in ["updateTimerValue", "updateTimerColour", "resetTimer"]]
@@ -549,10 +521,10 @@ class TestModelverse(unittest.TestCase):
                          ]
                          ]
 
 
     def test_switch_MM(self):
     def test_switch_MM(self):
-        model_add("test/PetriNet", "formalisms/SimpleClassDiagrams", open("integration/code/pn_design.mvc", "r").read())
-        model_add("test/my_pn", "test/PetriNet", open("integration/code/pn_design_model.mvc", "r").read())
+        model_add("users/user/test/PetriNet", "formalisms/SimpleClassDiagrams", open("integration/code/pn_design.mvc", "r").read())
+        model_add("users/user/test/my_pn", "users/user/test/PetriNet", open("integration/code/pn_design_model.mvc", "r").read())
 
 
-        got = element_list_nice("test/PetriNet")
+        got = element_list_nice("users/user/test/PetriNet")
         expected = \
         expected = \
             [{'__id': 'Natural', '__type': 'SimpleAttribute', 'constraint': {'AL': ''}, 'name': 'Natural'},
             [{'__id': 'Natural', '__type': 'SimpleAttribute', 'constraint': {'AL': ''}, 'name': 'Natural'},
              {'__id': 'String', '__type': 'SimpleAttribute', 'constraint': {'AL': ''}, 'name': 'String'},
              {'__id': 'String', '__type': 'SimpleAttribute', 'constraint': {'AL': ''}, 'name': 'String'},
@@ -568,7 +540,7 @@ class TestModelverse(unittest.TestCase):
             ]
             ]
         compare_unordered_lists(got, expected)
         compare_unordered_lists(got, expected)
 
 
-        got = element_list_nice("test/my_pn")
+        got = element_list_nice("users/user/test/my_pn")
         expected = \
         expected = \
             [{'__id': 'p1', '__type': 'Place', 'tokens': 1, 'name': 'p1'},
             [{'__id': 'p1', '__type': 'Place', 'tokens': 1, 'name': 'p1'},
              {'__id': 'p2', '__type': 'Place', 'tokens': 2, 'name': 'p2'},
              {'__id': 'p2', '__type': 'Place', 'tokens': 2, 'name': 'p2'},
@@ -580,12 +552,12 @@ class TestModelverse(unittest.TestCase):
             ]
             ]
         compare_unordered_lists(got, expected)
         compare_unordered_lists(got, expected)
 
 
-        alter_context("test/PetriNet", "formalisms/Bottom")
-        alter_context("test/my_pn", "formalisms/Bottom")
+        alter_context("users/user/test/PetriNet", "formalisms/Bottom")
+        alter_context("users/user/test/my_pn", "formalisms/Bottom")
 
 
         count_nodes = 0
         count_nodes = 0
         count_edges = 0
         count_edges = 0
-        for entry in element_list_nice("test/PetriNet"):
+        for entry in element_list_nice("users/user/test/PetriNet"):
             print(entry)
             print(entry)
             assert entry["__type"] in ["Node", "Edge"]
             assert entry["__type"] in ["Node", "Edge"]
             if entry["__type"] == "Node":
             if entry["__type"] == "Node":
@@ -599,7 +571,7 @@ class TestModelverse(unittest.TestCase):
 
 
         count_nodes = 0
         count_nodes = 0
         count_edges = 0
         count_edges = 0
-        for entry in element_list_nice("test/my_pn"):
+        for entry in element_list_nice("users/user/test/my_pn"):
             assert entry["__type"] in ["Node", "Edge"]
             assert entry["__type"] in ["Node", "Edge"]
             if entry["__type"] == "Node":
             if entry["__type"] == "Node":
                 assert len(entry) == 2
                 assert len(entry) == 2
@@ -610,15 +582,15 @@ class TestModelverse(unittest.TestCase):
         assert count_nodes == 14
         assert count_nodes == 14
         assert count_edges == 13
         assert count_edges == 13
 
 
-        alter_context("test/PetriNet", "test/PetriNet")
-        alter_context("test/my_pn", "formalisms/SimpleClassDiagrams")
+        alter_context("users/user/test/PetriNet", "users/user/test/PetriNet")
+        alter_context("users/user/test/my_pn", "formalisms/SimpleClassDiagrams")
         try:
         try:
-            element_list_nice("test/PetriNet")
+            element_list_nice("users/user/test/PetriNet")
             self.fail()
             self.fail()
         except:
         except:
             pass
             pass
         try:
         try:
-            element_list_nice("test/my_pn")
+            element_list_nice("users/user/test/my_pn")
             self.fail()
             self.fail()
         except:
         except:
             pass
             pass

+ 1 - 1
wrappers/modelverse_SCCD.py

@@ -1,7 +1,7 @@
 """
 """
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 Generated by Statechart compiler by Glenn De Jonghe, Joeri Exelmans, Simon Van Mierlo, and Yentl Van Tendeloo (for the inspiration)
 
 
-Date:   Thu Jun  7 09:13:08 2018
+Date:   Thu Jun  7 11:00:24 2018
 
 
 Model author: Yentl Van Tendeloo
 Model author: Yentl Van Tendeloo
 Model name:   MvK Server
 Model name:   MvK Server