test_mvc_print_upload.py 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. import unittest
  2. import utils
  3. all_files = [
  4. "core/mini_modify.alc",
  5. "core/core_formalism.mvc",
  6. "core/core_algorithm.alc",
  7. "primitives.alc",
  8. "object_operations.alc",
  9. "conformance_scd.alc",
  10. "library.alc",
  11. "transform.alc",
  12. "model_management.alc",
  13. "ramify.alc",
  14. "metamodels.alc",
  15. "random.alc",
  16. "constructors.alc",
  17. "modelling.alc",
  18. "compilation_manager.alc",
  19. ]
  20. class TestMvCPrintUpload(unittest.TestCase):
  21. def print_upload(self, optimization_level):
  22. utils.write_total_runtime_to_file(
  23. 'mvc_print_upload', optimization_level,
  24. utils.run_correctness_test(all_files, [
  25. "root",
  26. "root",
  27. "root",
  28. "model_add",
  29. "SimpleClassDiagrams",
  30. "PetriNets",
  31. ] + utils.get_model_constructor(
  32. open("integration/code/pn_runtime.mvc", "r").read()
  33. ) + [
  34. "model_list_full",
  35. "transformation_add_MT_language",
  36. "PetriNets",
  37. "",
  38. "PetriNets_RAM",
  39. "model_list_full",
  40. "transformation_add_MT",
  41. "PetriNets_RAM",
  42. "PetriNets",
  43. "",
  44. "",
  45. "PetriNets_Print",
  46. ] + utils.get_model_constructor(
  47. open("integration/code/pn_print.mvc", "r").read()
  48. ) + [
  49. "transformation_list_full",
  50. ], [
  51. "Desired username for admin user?",
  52. "Desired password for admin user?",
  53. "Please repeat the password",
  54. "Passwords match!",
  55. "Welcome to the Model Management Interface v2.0!",
  56. "Use the 'help' command for a list of possible commands",
  57. "Ready for command...",
  58. "Creating new model!",
  59. "Model type?",
  60. "Model name?",
  61. "Waiting for model constructors...",
  62. "Model upload success!",
  63. "Ready for command...",
  64. set([
  65. " 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  66. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  67. " 200 root nobody PetriNets : SimpleClassDiagrams",
  68. " 200 root admin core : CoreFormalism"
  69. ]),
  70. "Ready for command...",
  71. "Formalisms to include (terminate with empty string)?",
  72. "Name of the RAMified transformation metamodel?",
  73. "Ready for command...",
  74. set([
  75. " 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  76. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  77. " 200 root nobody PetriNets : SimpleClassDiagrams",
  78. " 200 root nobody __merged_PetriNets_RAM : SimpleClassDiagrams",
  79. " 200 root nobody PetriNets_RAM : SimpleClassDiagrams",
  80. " 200 root admin core : CoreFormalism"
  81. ]),
  82. "Ready for command...",
  83. "RAMified metamodel to use?",
  84. "Supported metamodels:",
  85. set([
  86. " PetriNets",
  87. ]),
  88. "",
  89. "Which ones do you want to use as source (empty string to finish)?",
  90. "Model added as source",
  91. "Which ones do you want to use as target (empty string to finish)?",
  92. "Name of new transformation?",
  93. "Waiting for model constructors...",
  94. "Ready for command...",
  95. set([
  96. " 200 root nobody [ModelTransformation] PetriNets_Print : PetriNets_RAM"
  97. ]),
  98. "Ready for command...",
  99. ], optimization_level))
  100. utils.define_perf_tests(TestMvCPrintUpload, TestMvCPrintUpload.print_upload)