Browse Source

Basis of PowerWindow test added

Yentl Van Tendeloo 8 years ago
parent
commit
07cacac394
3 changed files with 79 additions and 26 deletions
  1. 73 20
      integration/test_mvc.py
  2. 1 1
      models/plant_PW.mvc
  3. 5 5
      models/plant_model.mvc

+ 73 - 20
integration/test_mvc.py

@@ -2147,10 +2147,6 @@ class TestModelverseCore(unittest.TestCase):
                     "SimpleClassDiagrams",
                     "SimpleClassDiagrams",
                     "Encapsulated_PetriNet",
                     "Encapsulated_PetriNet",
                     ] + get_model_constructor(open("models/petrinet_ports.mvc", "r").read()) + [
                     ] + get_model_constructor(open("models/petrinet_ports.mvc", "r").read()) + [
-                "model_add",
-                    "SimpleClassDiagrams",
-                    "Requirement",
-                    ] + get_model_constructor(open("models/requirements.mvc", "r").read()) + [
                 "model_add",
                 "model_add",
                     "SimpleClassDiagrams",
                     "SimpleClassDiagrams",
                     "PW_Plant",
                     "PW_Plant",
@@ -2164,7 +2160,7 @@ class TestModelverseCore(unittest.TestCase):
                     "PW_Environment",
                     "PW_Environment",
                     ] + get_model_constructor(open("models/environment_PW.mvc", "r").read()) + [
                     ] + get_model_constructor(open("models/environment_PW.mvc", "r").read()) + [
                 "model_add",
                 "model_add",
-                    "PW_Plant",
+                    "PW_Environment",
                     "environment_model",
                     "environment_model",
                     ] + get_model_constructor(open("models/environment_model.mvc", "r").read()) + [
                     ] + get_model_constructor(open("models/environment_model.mvc", "r").read()) + [
                 "model_add",
                 "model_add",
@@ -2172,7 +2168,7 @@ class TestModelverseCore(unittest.TestCase):
                     "PW_Control",
                     "PW_Control",
                     ] + get_model_constructor(open("models/control_PW.mvc", "r").read()) + [
                     ] + get_model_constructor(open("models/control_PW.mvc", "r").read()) + [
                 "model_add",
                 "model_add",
-                    "PW_Plant",
+                    "PW_Control",
                     "control_model",
                     "control_model",
                     ] + get_model_constructor(open("models/control_model.mvc", "r").read()) + [
                     ] + get_model_constructor(open("models/control_model.mvc", "r").read()) + [
                 "model_list",
                 "model_list",
@@ -2185,17 +2181,7 @@ class TestModelverseCore(unittest.TestCase):
                 "ReachabilityGraph",
                 "ReachabilityGraph",
                 "",
                 "",
                 "All_RAM",
                 "All_RAM",
-                "transformation_add_MT",
-                    "All_RAM",
-                    "",
-                    "PW_Plant",
-                    "PW_Control",
-                    "PW_Environment",
-                    "",
-                    "initialize_PN",
-                    ] + get_model_constructor(open("models/initialize_all.mvc", "r").read()) + [
                 "transformation_add_MANUAL",
                 "transformation_add_MANUAL",
-                    "Requirement",
                     "PW_Plant",
                     "PW_Plant",
                     "",
                     "",
                     "PW_Plant",
                     "PW_Plant",
@@ -2208,7 +2194,7 @@ class TestModelverseCore(unittest.TestCase):
                     "Encapsulated_PetriNet",
                     "Encapsulated_PetriNet",
                     "",
                     "",
                     "Plant2EPN",
                     "Plant2EPN",
-                    ] + get_model_constructor(open("models/plant_to_EPN", "r").read()) + [
+                    ] + get_model_constructor(open("models/plant_to_EPN.mvc", "r").read()) + [
                 "transformation_add_AL",
                 "transformation_add_AL",
                     "PetriNet",
                     "PetriNet",
                     "",
                     "",
@@ -2233,13 +2219,13 @@ 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_add * 10
+                # model_add * 9
                 ] + [   "Creating new model!",
                 ] + [   "Creating new model!",
                         "Model type?",
                         "Model type?",
                         "Model name?",
                         "Model name?",
                         "Waiting for model constructors...",
                         "Waiting for model constructors...",
                         "Model upload success!",
                         "Model upload success!",
-                        "Ready for command...", ] * 10 + [
+                        "Ready for command...", ] * 9 + [
                 # model_list
                 # model_list
                 model_list |
                 model_list |
                 set([
                 set([
@@ -2251,11 +2237,78 @@ class TestModelverseCore(unittest.TestCase):
                      "  plant_model : PW_Plant",
                      "  plant_model : PW_Plant",
                      "  control_model : PW_Control",
                      "  control_model : PW_Control",
                      "  environment_model : PW_Environment",
                      "  environment_model : PW_Environment",
-                     "  Requirement : SimpleClassDiagrams",
                      "  ReachabilityGraph : SimpleClassDiagrams",]),
                      "  ReachabilityGraph : SimpleClassDiagrams",]),
                 "Ready for command...",
                 "Ready for command...",
                 # transformation_add_MT_language
                 # transformation_add_MT_language
                 "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...",
+                # transformation_add_MANUAL
+                "Which metamodels do you want to use as source for the manual operation (empty string to finish)?",
+                "Model added as source",
+                "Which metamodels do you want to use as target for the manual operation (empty string to finish)?",
+                "Model added as target",
+                "Name of Manual operation model?",
+                "Ready for command...",
+                # transformation_add_MT
+                "RAMified metamodel to use?",
+                "Supported metamodels:",
+                set(["  PetriNet",
+                     "  Encapsulated_PetriNet",
+                     "  PW_Plant",
+                     "  PW_Environment",
+                     "  PW_Control",
+                     "  ReachabilityGraph",
+                    ]),
+                "",
+                "Which ones do you want to use as source (empty string to finish)?",
+                "Model added as source",
+                "Which ones do you want to use as target (empty string to finish)?",
+                "Model added as target",
+                "Name of new transformation?",
+                "Waiting for model constructors...",
+                "Ready for command...",
+                # transformation_add_AL
+                "Which metamodels do you want to use as source for the action code (empty string to finish)?",
+                "Model added as source",
+                "Which metamodels do you want to use as target for the action code (empty string to finish)?",
+                "Model added as target",
+                "Name of Action Language model?",
+                "Waiting for model constructors...",
+                "Ready for command...",
+                # transformation_add_MT
+                "RAMified metamodel to use?",
+                "Supported metamodels:",
+                set(["  PetriNet",
+                     "  Encapsulated_PetriNet",
+                     "  PW_Plant",
+                     "  PW_Environment",
+                     "  PW_Control",
+                     "  ReachabilityGraph",
+                    ]),
+                "",
+                "Which ones do you want to use as source (empty string to finish)?",
+                "Model added as source",
+                "Which ones do you want to use as target (empty string to finish)?",
+                "Name of new transformation?",
+                "Waiting for model constructors...",
+                "Ready for command...",
+                # model_list
+                model_list |
+                set([
+                     "  PetriNet : SimpleClassDiagrams",
+                     "  Encapsulated_PetriNet : SimpleClassDiagrams",
+                     "  PW_Plant : SimpleClassDiagrams",
+                     "  PW_Environment : SimpleClassDiagrams",
+                     "  PW_Control : SimpleClassDiagrams",
+                     "  plant_model : PW_Plant",
+                     "  control_model : PW_Control",
+                     "  reachability_analyse : ActionLanguage",
+                     "  reachability_print : All_RAM",
+                     "  Plant2EPN : All_RAM",
+                     "  refine_Plant : ManualOperation",
+                     "  environment_model : PW_Environment",
+                     "  __merge_All_RAM : SimpleClassDiagrams",
+                     "  ReachabilityGraph : SimpleClassDiagrams",]),
+                "Ready for command...",
             ]))
             ]))

+ 1 - 1
models/plant_PW.mvc

@@ -15,7 +15,7 @@ SimpleClassDiagrams Plant_PW{
         name : String
         name : String
     }
     }
     Class Port {
     Class Port {
-        objectName : String
+        name : String
     }
     }
 
 
     Class Switch : Named {}
     Class Switch : Named {}

+ 5 - 5
models/plant_model.mvc

@@ -2,19 +2,19 @@ Plant_PW plant_model_PW {
     Boundary plant_powerwindow_dsl{
     Boundary plant_powerwindow_dsl{
         name = "plant_powerwindow_dsl"
         name = "plant_powerwindow_dsl"
         Port driverWindowCommands {
         Port driverWindowCommands {
-            objectName = "driverWindowCommands"
+            name = "driverWindowCommands"
         }
         }
         Port lockCommands {
         Port lockCommands {
-            objectName = "lockCommands"
+            name = "lockCommands"
         }
         }
         Port detectObject {
         Port detectObject {
-            objectName = "detectObject"
+            name = "detectObject"
         }
         }
         Port controlPassengerWindowCommands {
         Port controlPassengerWindowCommands {
-            objectName = "controlPassengerWindowCommands"
+            name = "controlPassengerWindowCommands"
         }
         }
         Port passengerWindowCommands {
         Port passengerWindowCommands {
-            objectName = "passengerWindowCommands"
+            name = "passengerWindowCommands"
         }
         }
 
 
         Side driver {
         Side driver {