Jelajahi Sumber

Fixed MvC tests with the popping of sets

Yentl Van Tendeloo 8 tahun lalu
induk
melakukan
74e9c4e88c
2 mengubah file dengan 37 tambahan dan 35 penghapusan
  1. 2 1
      integration/code/reachabilitygraph_print.mvc
  2. 35 34
      integration/test_mvc.py

+ 2 - 1
integration/code/reachabilitygraph_print.mvc

@@ -17,7 +17,6 @@ ReachabilityGraph_RAM reachabilitygraph_print {
                     label = "0"
                     label = "0"
                     action = $
                     action = $
                         Void function action(model : Element, name : String, mapping : Element):
                         Void function action(model : Element, name : String, mapping : Element):
-                            log("State action")
                             Element dict_values
                             Element dict_values
                             Element all_values
                             Element all_values
                             String place
                             String place
@@ -27,6 +26,7 @@ ReachabilityGraph_RAM reachabilitygraph_print {
                                 place = set_pop(all_values)
                                 place = set_pop(all_values)
                                 dict_add(dict_values, read_attribute(model, place, "name"), read_attribute(model, place, "tokens"))
                                 dict_add(dict_values, read_attribute(model, place, "name"), read_attribute(model, place, "tokens"))
                             log((cast_v2s(read_attribute(model, name, "name")) + ": ") + dict_to_string(dict_values))
                             log((cast_v2s(read_attribute(model, name, "name")) + ": ") + dict_to_string(dict_values))
+                            output((cast_v2s(read_attribute(model, name, "name")) + ": ") + dict_to_string(dict_values))
                             return!
                             return!
                         $
                         $
                 }
                 }
@@ -57,6 +57,7 @@ ReachabilityGraph_RAM reachabilitygraph_print {
                     action = $
                     action = $
                         Void function action(model : Element, name : String, mapping : Element):
                         Void function action(model : Element, name : String, mapping : Element):
                             log((((cast_v2s(read_attribute(model, mapping["0"], "name")) + " --[") + cast_v2s(read_attribute(model, name, "name"))) + "]--> ") + cast_v2s(read_attribute(model, mapping["1"], "name")))
                             log((((cast_v2s(read_attribute(model, mapping["0"], "name")) + " --[") + cast_v2s(read_attribute(model, name, "name"))) + "]--> ") + cast_v2s(read_attribute(model, mapping["1"], "name")))
+                            output((((cast_v2s(read_attribute(model, mapping["0"], "name")) + " --[") + cast_v2s(read_attribute(model, name, "name"))) + "]--> ") + cast_v2s(read_attribute(model, mapping["1"], "name")))
                             return!
                             return!
                         $
                         $
                 }
                 }

+ 35 - 34
integration/test_mvc.py

@@ -47,7 +47,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Welcome to the Model Management Interface v2.0!",
                 "Welcome to the Model Management Interface v2.0!",
                 "Use the 'help' command for a list of possible commands",
                 "Use the 'help' command for a list of possible commands",
                 "Ready for command...",
                 "Ready for command...",
-                model_list,
+                set(model_list),
             ]))
             ]))
 
 
     def test_list_full(self):
     def test_list_full(self):
@@ -62,7 +62,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Welcome to the Model Management Interface v2.0!",
                 "Welcome to the Model Management Interface v2.0!",
                 "Use the 'help' command for a list of possible commands",
                 "Use the 'help' command for a list of possible commands",
                 "Ready for command...",
                 "Ready for command...",
-                model_full_list,
+                set(model_full_list),
             ]))
             ]))
 
 
     def test_model_add_empty(self):
     def test_model_add_empty(self):
@@ -88,10 +88,10 @@ class TestModelverseCore(unittest.TestCase):
                 "Waiting for model constructors...",
                 "Waiting for model constructors...",
                 "Model upload success!",
                 "Model upload success!",
                 "Ready for command...",
                 "Ready for command...",
-                model_list | 
+                set(model_list) | 
                 set(["  Empty : SimpleClassDiagrams",]),
                 set(["  Empty : SimpleClassDiagrams",]),
                 "Ready for command...",
                 "Ready for command...",
-                model_full_list |
+                set(model_full_list) |
                 set(["  200  root nobody   Empty : SimpleClassDiagrams",]),
                 set(["  200  root nobody   Empty : SimpleClassDiagrams",]),
             ]))
             ]))
 
 
@@ -125,10 +125,10 @@ class TestModelverseCore(unittest.TestCase):
                 "Waiting for model constructors...",
                 "Waiting for model constructors...",
                 "Model upload success!",
                 "Model upload success!",
                 "Ready for command...",
                 "Ready for command...",
-                model_list |
+                set(model_list) |
                 set(["  Empty : SimpleClassDiagrams",]),
                 set(["  Empty : SimpleClassDiagrams",]),
                 "Ready for command...",
                 "Ready for command...",
-                model_full_list |
+                set(model_full_list) |
                 set(["  200  root nobody   Empty : SimpleClassDiagrams",]),
                 set(["  200  root nobody   Empty : SimpleClassDiagrams",]),
                 "Ready for command...",
                 "Ready for command...",
                 "Which model do you want to modify?",
                 "Which model do you want to modify?",
@@ -140,7 +140,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Instantiation successful!",
                 "Instantiation successful!",
                 "Please give your command.",
                 "Please give your command.",
                 "Ready for command...",
                 "Ready for command...",
-                model_full_list |
+                set(model_full_list) |
                 set(["  200  root nobody   Empty : SimpleClassDiagrams",]),
                 set(["  200  root nobody   Empty : SimpleClassDiagrams",]),
                 "Ready for command...",
                 "Ready for command...",
             ]))
             ]))
@@ -190,7 +190,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Waiting for model constructors...",
                 "Waiting for model constructors...",
                 "Model upload success!",
                 "Model upload success!",
                 "Ready for command...",
                 "Ready for command...",
-                model_full_list |
+                set(model_full_list) |
                 set(["  200  root nobody   Empty : SimpleClassDiagrams",]),
                 set(["  200  root nobody   Empty : SimpleClassDiagrams",]),
                 "Ready for command...",
                 "Ready for command...",
                 "Which model do you want to modify?",
                 "Which model do you want to modify?",
@@ -202,14 +202,14 @@ class TestModelverseCore(unittest.TestCase):
                 "Instantiation successful!",
                 "Instantiation successful!",
                 "Please give your command.",
                 "Please give your command.",
                 "Ready for command...",
                 "Ready for command...",
-                model_full_list |
+                set(model_full_list) |
                 set(["  200  root nobody   Empty : SimpleClassDiagrams",]),
                 set(["  200  root nobody   Empty : SimpleClassDiagrams",]),
                 "Ready for command...",
                 "Ready for command...",
                 "Which model to overwrite?",
                 "Which model to overwrite?",
                 "Waiting for model constructors...",
                 "Waiting for model constructors...",
                 "Model overwrite success!",
                 "Model overwrite success!",
                 "Ready for command...",
                 "Ready for command...",
-                model_full_list |
+                set(model_full_list) |
                 set(["  200  root nobody   Empty : SimpleClassDiagrams",]),
                 set(["  200  root nobody   Empty : SimpleClassDiagrams",]),
                 "Ready for command...",
                 "Ready for command...",
                 "Which model do you want to modify?",
                 "Which model do you want to modify?",
@@ -250,13 +250,13 @@ class TestModelverseCore(unittest.TestCase):
                 "Waiting for model constructors...",
                 "Waiting for model constructors...",
                 "Model upload success!",
                 "Model upload success!",
                 "Ready for command...",
                 "Ready for command...",
-                model_full_list |
+                set(model_full_list) |
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",]),
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",]),
                 "Ready for command...",
                 "Ready for command...",
                 "Formalisms to include (terminate with empty string)?",
                 "Formalisms to include (terminate with empty string)?",
                 "Name of the RAMified transformation metamodel?",
                 "Name of the RAMified transformation metamodel?",
                 "Ready for command...",
                 "Ready for command...",
-                model_full_list |
+                set(model_full_list) |
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",
                      "  200  root nobody   __merged_PetriNets_RAM : SimpleClassDiagrams",
                      "  200  root nobody   __merged_PetriNets_RAM : SimpleClassDiagrams",
                      "  200  root nobody   PetriNets_RAM : SimpleClassDiagrams",]),
                      "  200  root nobody   PetriNets_RAM : SimpleClassDiagrams",]),
@@ -300,13 +300,13 @@ class TestModelverseCore(unittest.TestCase):
                 "Waiting for model constructors...",
                 "Waiting for model constructors...",
                 "Model upload success!",
                 "Model upload success!",
                 "Ready for command...",
                 "Ready for command...",
-                model_full_list |
+                set(model_full_list) |
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",]),
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",]),
                 "Ready for command...",
                 "Ready for command...",
                 "Formalisms to include (terminate with empty string)?",
                 "Formalisms to include (terminate with empty string)?",
                 "Name of the RAMified transformation metamodel?",
                 "Name of the RAMified transformation metamodel?",
                 "Ready for command...",
                 "Ready for command...",
-                model_full_list |
+                set(model_full_list) |
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",
                      "  200  root nobody   __merged_PetriNets_RAM : SimpleClassDiagrams",
                      "  200  root nobody   __merged_PetriNets_RAM : SimpleClassDiagrams",
                      "  200  root nobody   PetriNets_RAM : SimpleClassDiagrams",]),
                      "  200  root nobody   PetriNets_RAM : SimpleClassDiagrams",]),
@@ -322,7 +322,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Name of new transformation?",
                 "Name of new transformation?",
                 "Waiting for model constructors...",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 "Ready for command...",
-                model_full_list |
+                set(model_full_list) |
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",
                      "  200  root nobody   __merged_PetriNets_RAM : SimpleClassDiagrams",
                      "  200  root nobody   __merged_PetriNets_RAM : SimpleClassDiagrams",
                      "  200  root nobody   PetriNets_RAM : SimpleClassDiagrams",
                      "  200  root nobody   PetriNets_RAM : SimpleClassDiagrams",
@@ -371,13 +371,13 @@ class TestModelverseCore(unittest.TestCase):
                 "Waiting for model constructors...",
                 "Waiting for model constructors...",
                 "Model upload success!",
                 "Model upload success!",
                 "Ready for command...",
                 "Ready for command...",
-                model_full_list |
+                set(model_full_list) |
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",]),
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",]),
                 "Ready for command...",
                 "Ready for command...",
                 "Formalisms to include (terminate with empty string)?",
                 "Formalisms to include (terminate with empty string)?",
                 "Name of the RAMified transformation metamodel?",
                 "Name of the RAMified transformation metamodel?",
                 "Ready for command...",
                 "Ready for command...",
-                model_full_list |
+                set(model_full_list) |
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",
                      "  200  root nobody   __merged_PetriNets_RAM : SimpleClassDiagrams",
                      "  200  root nobody   __merged_PetriNets_RAM : SimpleClassDiagrams",
                      "  200  root nobody   PetriNets_RAM : SimpleClassDiagrams",]),
                      "  200  root nobody   PetriNets_RAM : SimpleClassDiagrams",]),
@@ -447,14 +447,14 @@ class TestModelverseCore(unittest.TestCase):
                 "Waiting for model constructors...",
                 "Waiting for model constructors...",
                 "Model upload success!",
                 "Model upload success!",
                 "Ready for command...",
                 "Ready for command...",
-                model_full_list |
+                set(model_full_list) |
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",
                      "  200  root nobody   my_pn : PetriNets",]),
                      "  200  root nobody   my_pn : PetriNets",]),
                 "Ready for command...",
                 "Ready for command...",
                 "Formalisms to include (terminate with empty string)?",
                 "Formalisms to include (terminate with empty string)?",
                 "Name of the RAMified transformation metamodel?",
                 "Name of the RAMified transformation metamodel?",
                 "Ready for command...",
                 "Ready for command...",
-                model_full_list |
+                set(model_full_list) |
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",
                 set(["  200  root nobody   PetriNets : SimpleClassDiagrams",
                      "  200  root nobody   __merged_PetriNets_RAM : SimpleClassDiagrams",
                      "  200  root nobody   __merged_PetriNets_RAM : SimpleClassDiagrams",
                      "  200  root nobody   PetriNets_RAM : SimpleClassDiagrams",
                      "  200  root nobody   PetriNets_RAM : SimpleClassDiagrams",
@@ -627,7 +627,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Model upload success!",
                 "Model upload success!",
                 "Ready for command...",
                 "Ready for command...",
                 # model_list
                 # model_list
-                model_list |
+                set(model_list) |
                 set([
                 set([
                      "  PetriNets : SimpleClassDiagrams",
                      "  PetriNets : SimpleClassDiagrams",
                      "  my_pn : PetriNets",
                      "  my_pn : PetriNets",
@@ -638,7 +638,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Name of the RAMified transformation metamodel?",
                 "Name of the RAMified transformation metamodel?",
                 "Ready for command...",
                 "Ready for command...",
                 # model_list
                 # model_list
-                model_list |
+                set(model_list) |
                 set([
                 set([
                      "  PetriNets : SimpleClassDiagrams",
                      "  PetriNets : SimpleClassDiagrams",
                      "  my_pn : PetriNets",
                      "  my_pn : PetriNets",
@@ -740,7 +740,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Waiting for model constructors...",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 "Ready for command...",
                 # model_list
                 # model_list
-                model_list |
+                set(model_list) |
                 set([
                 set([
                      "  PetriNets : SimpleClassDiagrams",
                      "  PetriNets : SimpleClassDiagrams",
                      "  my_pn : PetriNets",
                      "  my_pn : PetriNets",
@@ -952,7 +952,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Model upload success!",
                 "Model upload success!",
                 "Ready for command...",
                 "Ready for command...",
                 # model_list
                 # model_list
-                model_list |
+                set(model_list) |
                 set([
                 set([
                      "  PetriNets : SimpleClassDiagrams",
                      "  PetriNets : SimpleClassDiagrams",
                      "  my_pn : PetriNets",
                      "  my_pn : PetriNets",
@@ -963,7 +963,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Name of the RAMified transformation metamodel?",
                 "Name of the RAMified transformation metamodel?",
                 "Ready for command...",
                 "Ready for command...",
                 # model_list
                 # model_list
-                model_list |
+                set(model_list) |
                 set([
                 set([
                      "  PetriNets : SimpleClassDiagrams",
                      "  PetriNets : SimpleClassDiagrams",
                      "  my_pn : PetriNets",
                      "  my_pn : PetriNets",
@@ -1065,7 +1065,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Waiting for model constructors...",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 "Ready for command...",
                 # model_list
                 # model_list
-                model_list |
+                set(model_list) |
                 set([
                 set([
                      "  PetriNets : SimpleClassDiagrams",
                      "  PetriNets : SimpleClassDiagrams",
                      "  my_pn : PetriNets",
                      "  my_pn : PetriNets",
@@ -1231,7 +1231,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Model upload success!",
                 "Model upload success!",
                 "Ready for command...",
                 "Ready for command...",
                 # model_list
                 # model_list
-                model_list |
+                set(model_list) |
                 set(["  PetriNets : SimpleClassDiagrams",
                 set(["  PetriNets : SimpleClassDiagrams",
                      "  my_pn : PetriNets",
                      "  my_pn : PetriNets",
                      "  PetriNets_Runtime : SimpleClassDiagrams",]),
                      "  PetriNets_Runtime : SimpleClassDiagrams",]),
@@ -1241,7 +1241,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Name of the RAMified transformation metamodel?",
                 "Name of the RAMified transformation metamodel?",
                 "Ready for command...",
                 "Ready for command...",
                 # model_list
                 # model_list
-                model_list |
+                set(model_list) |
                 set([
                 set([
                      "  PetriNets_Runtime : SimpleClassDiagrams",
                      "  PetriNets_Runtime : SimpleClassDiagrams",
                      "  PetriNets : SimpleClassDiagrams",
                      "  PetriNets : SimpleClassDiagrams",
@@ -1337,7 +1337,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Waiting for model constructors...",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 "Ready for command...",
                 # model_list
                 # model_list
-                model_list |
+                set(model_list) |
                 set([
                 set([
                      "  PetriNets_Runtime : SimpleClassDiagrams",
                      "  PetriNets_Runtime : SimpleClassDiagrams",
                      "  PetriNets : SimpleClassDiagrams",
                      "  PetriNets : SimpleClassDiagrams",
@@ -1539,7 +1539,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Model upload success!",
                 "Model upload success!",
                 "Ready for command...",
                 "Ready for command...",
                 # model_list
                 # model_list
-                model_list |
+                set(model_list) |
                 set([
                 set([
                      "  PetriNets : SimpleClassDiagrams",
                      "  PetriNets : SimpleClassDiagrams",
                      "  my_pn : PetriNets",
                      "  my_pn : PetriNets",
@@ -1550,7 +1550,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Name of the RAMified transformation metamodel?",
                 "Name of the RAMified transformation metamodel?",
                 "Ready for command...",
                 "Ready for command...",
                 # model_list
                 # model_list
-                model_list |
+                set(model_list) |
                 set([
                 set([
                      "  PetriNets_Runtime : SimpleClassDiagrams",
                      "  PetriNets_Runtime : SimpleClassDiagrams",
                      "  PetriNets : SimpleClassDiagrams",
                      "  PetriNets : SimpleClassDiagrams",
@@ -1645,7 +1645,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Waiting for model constructors...",
                 "Waiting for model constructors...",
                 "Ready for command...",
                 "Ready for command...",
                 # model_list
                 # model_list
-                model_list |
+                set(model_list) |
                 set([
                 set([
                      "  PetriNets_Runtime : SimpleClassDiagrams",
                      "  PetriNets_Runtime : SimpleClassDiagrams",
                      "  PetriNets : SimpleClassDiagrams",
                      "  PetriNets : SimpleClassDiagrams",
@@ -1903,7 +1903,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Model upload success!",
                 "Model upload success!",
                 "Ready for command...",
                 "Ready for command...",
                 # model_list
                 # model_list
-                model_list |
+                set(model_list) |
                 set([
                 set([
                      "  PetriNet : SimpleClassDiagrams",
                      "  PetriNet : SimpleClassDiagrams",
                      "  ReachabilityGraph : SimpleClassDiagrams",]),
                      "  ReachabilityGraph : SimpleClassDiagrams",]),
@@ -1961,7 +1961,7 @@ class TestModelverseCore(unittest.TestCase):
                 "Model upload success!",
                 "Model upload success!",
                 "Ready for command...",
                 "Ready for command...",
                 # model_list
                 # model_list
-                model_list |
+                set(model_list) |
                 set([
                 set([
                      "  PetriNet : SimpleClassDiagrams",
                      "  PetriNet : SimpleClassDiagrams",
                      "  ReachabilityGraph : SimpleClassDiagrams",
                      "  ReachabilityGraph : SimpleClassDiagrams",
@@ -1980,6 +1980,7 @@ class TestModelverseCore(unittest.TestCase):
                 # process_execute
                 # process_execute
                 "Which process model do you want to execute?",
                 "Which process model do you want to execute?",
                 "Model prefix to use?",
                 "Model prefix to use?",
+                    "Please perform manual transformation \"refine_PN\"",
                     "Model loaded, ready for commands!",
                     "Model loaded, ready for commands!",
                     "Use 'help' command for a list of possible commands",
                     "Use 'help' command for a list of possible commands",
                     "Please give your command.",
                     "Please give your command.",
@@ -2027,7 +2028,7 @@ class TestModelverseCore(unittest.TestCase):
                     ]),
                     ]),
                 "Ready for command...",
                 "Ready for command...",
                 # model_list
                 # model_list
-                model_list |
+                set(model_list) |
                 set([
                 set([
                      "  PetriNet : SimpleClassDiagrams",
                      "  PetriNet : SimpleClassDiagrams",
                      "  ReachabilityGraph : SimpleClassDiagrams",
                      "  ReachabilityGraph : SimpleClassDiagrams",