test_mvc_model_overwrite.py 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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 TestMvCModelOverwrite(unittest.TestCase):
  21. def model_overwrite(self, optimization_level):
  22. utils.write_total_runtime_to_file(
  23. 'mvc_model_overwrite', optimization_level,
  24. utils.run_correctness_test(all_files, [
  25. "root",
  26. "root",
  27. "root",
  28. "model_add",
  29. "SimpleClassDiagrams",
  30. "Empty",
  31. "exit",
  32. "model_list_full",
  33. "model_modify",
  34. "Empty",
  35. "instantiate",
  36. "Class",
  37. "A",
  38. "exit",
  39. "model_list_full",
  40. "model_overwrite",
  41. "Empty",
  42. "instantiate_node",
  43. "",
  44. "Class",
  45. "B",
  46. "instantiate_node",
  47. "",
  48. "Class",
  49. "C",
  50. "exit",
  51. "model_list_full",
  52. "model_modify",
  53. "Empty",
  54. "list",
  55. "exit",
  56. ], [
  57. "Desired username for admin user?",
  58. "Desired password for admin user?",
  59. "Please repeat the password",
  60. "Passwords match!",
  61. "Welcome to the Model Management Interface v2.0!",
  62. "Use the 'help' command for a list of possible commands",
  63. "Ready for command...",
  64. "Creating new model!",
  65. "Model type?",
  66. "Model name?",
  67. "Waiting for model constructors...",
  68. "Model upload success!",
  69. "Ready for command...",
  70. set([
  71. " 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  72. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  73. " 200 root nobody Empty : SimpleClassDiagrams",
  74. " 200 root admin core : CoreFormalism"
  75. ]),
  76. "Ready for command...",
  77. "Which model do you want to modify?",
  78. "Model loaded, ready for commands!",
  79. "Use 'help' command for a list of possible commands",
  80. "Please give your command.",
  81. "Type to instantiate?",
  82. "Name of new element?",
  83. "Instantiation successful!",
  84. "Please give your command.",
  85. "Ready for command...",
  86. set([
  87. " 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  88. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  89. " 200 root nobody Empty : SimpleClassDiagrams",
  90. " 200 root admin core : CoreFormalism"
  91. ]),
  92. "Ready for command...",
  93. "Which model to overwrite?",
  94. "Waiting for model constructors...",
  95. "Model overwrite success!",
  96. "Ready for command...",
  97. set([
  98. " 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  99. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  100. " 200 root nobody Empty : SimpleClassDiagrams",
  101. " 200 root admin core : CoreFormalism"
  102. ]),
  103. "Ready for command...",
  104. "Which model do you want to modify?",
  105. "Model loaded, ready for commands!",
  106. "Use 'help' command for a list of possible commands",
  107. "Please give your command.",
  108. "List of all elements:",
  109. set([" B : Class", " C : Class"]),
  110. "Please give your command.",
  111. "Ready for command...",
  112. ], optimization_level))
  113. utils.define_perf_tests(TestMvCModelOverwrite,
  114. TestMvCModelOverwrite.model_overwrite)