test_mvc.py 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442
  1. import unittest
  2. from utils import *
  3. all_files = [ "core/mini_modify.alc",
  4. "core/core_formalism.mvc",
  5. "core/core_algorithm.alc",
  6. "primitives.alc",
  7. "object_operations.alc",
  8. "conformance_scd.alc",
  9. "library.alc",
  10. "transform.alc",
  11. "model_management.alc",
  12. "ramify.alc",
  13. "metamodels.alc",
  14. "random.alc",
  15. "constructors.alc",
  16. "modelling.alc",
  17. "compilation_manager.alc",
  18. ]
  19. class TestModelverseCore(unittest.TestCase):
  20. def test_list(self):
  21. self.assertTrue(run_file(all_files,
  22. [ "root", "root", "root",
  23. "model_list",
  24. ],
  25. [ "Desired username for admin user?",
  26. "Desired password for admin user?",
  27. "Please repeat the password",
  28. "Passwords match!",
  29. "Welcome to the Model Management Interface v2.0!",
  30. "Use the 'help' command for a list of possible commands",
  31. "Ready for command...",
  32. set([" SimpleClassDiagrams : SimpleClassDiagrams",
  33. " CoreFormalism : SimpleClassDiagrams",
  34. " ActionLanguage : SimpleClassDiagrams",
  35. " core : CoreFormalism"]),
  36. ]))
  37. def test_list_full(self):
  38. self.assertTrue(run_file(all_files,
  39. [ "root", "root", "root",
  40. "model_list_full",
  41. ],
  42. [ "Desired username for admin user?",
  43. "Desired password for admin user?",
  44. "Please repeat the password",
  45. "Passwords match!",
  46. "Welcome to the Model Management Interface v2.0!",
  47. "Use the 'help' command for a list of possible commands",
  48. "Ready for command...",
  49. set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  50. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  51. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  52. " 200 root admin core : CoreFormalism"]),
  53. ]))
  54. def test_model_add_empty(self):
  55. self.assertTrue(run_file(all_files,
  56. [ "root", "root", "root",
  57. "model_add",
  58. "SimpleClassDiagrams",
  59. "Empty",
  60. "exit",
  61. "model_list",
  62. "model_list_full",
  63. ],
  64. [ "Desired username for admin user?",
  65. "Desired password for admin user?",
  66. "Please repeat the password",
  67. "Passwords match!",
  68. "Welcome to the Model Management Interface v2.0!",
  69. "Use the 'help' command for a list of possible commands",
  70. "Ready for command...",
  71. "Creating new model!",
  72. "Model type?",
  73. "Model name?",
  74. "Waiting for model constructors...",
  75. "Model upload success!",
  76. "Ready for command...",
  77. set([" SimpleClassDiagrams : SimpleClassDiagrams",
  78. " CoreFormalism : SimpleClassDiagrams",
  79. " ActionLanguage : SimpleClassDiagrams",
  80. " Empty : SimpleClassDiagrams",
  81. " core : CoreFormalism"]),
  82. "Ready for command...",
  83. set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  84. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  85. " 200 root nobody Empty : SimpleClassDiagrams",
  86. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  87. " 200 root admin core : CoreFormalism"]),
  88. ]))
  89. def test_model_empty_modify(self):
  90. self.assertTrue(run_file(all_files,
  91. [ "root", "root", "root",
  92. "model_add",
  93. "SimpleClassDiagrams",
  94. "Empty",
  95. "exit",
  96. "model_list",
  97. "model_list_full",
  98. "model_modify",
  99. "Empty",
  100. "instantiate",
  101. "Class",
  102. "A",
  103. "exit",
  104. "model_list_full",
  105. ],
  106. [ "Desired username for admin user?",
  107. "Desired password for admin user?",
  108. "Please repeat the password",
  109. "Passwords match!",
  110. "Welcome to the Model Management Interface v2.0!",
  111. "Use the 'help' command for a list of possible commands",
  112. "Ready for command...",
  113. "Creating new model!",
  114. "Model type?",
  115. "Model name?",
  116. "Waiting for model constructors...",
  117. "Model upload success!",
  118. "Ready for command...",
  119. set([" SimpleClassDiagrams : SimpleClassDiagrams",
  120. " CoreFormalism : SimpleClassDiagrams",
  121. " Empty : SimpleClassDiagrams",
  122. " ActionLanguage : SimpleClassDiagrams",
  123. " core : CoreFormalism"]),
  124. "Ready for command...",
  125. set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  126. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  127. " 200 root nobody Empty : SimpleClassDiagrams",
  128. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  129. " 200 root admin core : CoreFormalism"]),
  130. "Ready for command...",
  131. "Which model do you want to modify?",
  132. "Model loaded, ready for commands!",
  133. "Use 'help' command for a list of possible commands",
  134. "Please give your command.",
  135. "Type to instantiate?",
  136. "Name of new element?",
  137. "Instantiation successful!",
  138. "Please give your command.",
  139. "Ready for command...",
  140. set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  141. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  142. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  143. " 200 root nobody Empty : SimpleClassDiagrams",
  144. " 200 root admin core : CoreFormalism"]),
  145. "Ready for command...",
  146. ]))
  147. def test_model_overwrite(self):
  148. self.assertTrue(run_file(all_files,
  149. [ "root", "root", "root",
  150. "model_add",
  151. "SimpleClassDiagrams",
  152. "Empty",
  153. "exit",
  154. "model_list_full",
  155. "model_modify",
  156. "Empty",
  157. "instantiate",
  158. "Class",
  159. "A",
  160. "exit",
  161. "model_list_full",
  162. "model_overwrite",
  163. "Empty",
  164. "instantiate_node",
  165. "",
  166. "Class",
  167. "B",
  168. "instantiate_node",
  169. "",
  170. "Class",
  171. "C",
  172. "exit",
  173. "model_list_full",
  174. "model_modify",
  175. "Empty",
  176. "list",
  177. "exit",
  178. ],
  179. [ "Desired username for admin user?",
  180. "Desired password for admin user?",
  181. "Please repeat the password",
  182. "Passwords match!",
  183. "Welcome to the Model Management Interface v2.0!",
  184. "Use the 'help' command for a list of possible commands",
  185. "Ready for command...",
  186. "Creating new model!",
  187. "Model type?",
  188. "Model name?",
  189. "Waiting for model constructors...",
  190. "Model upload success!",
  191. "Ready for command...",
  192. set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  193. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  194. " 200 root nobody Empty : SimpleClassDiagrams",
  195. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  196. " 200 root admin core : CoreFormalism"]),
  197. "Ready for command...",
  198. "Which model do you want to modify?",
  199. "Model loaded, ready for commands!",
  200. "Use 'help' command for a list of possible commands",
  201. "Please give your command.",
  202. "Type to instantiate?",
  203. "Name of new element?",
  204. "Instantiation successful!",
  205. "Please give your command.",
  206. "Ready for command...",
  207. set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  208. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  209. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  210. " 200 root nobody Empty : SimpleClassDiagrams",
  211. " 200 root admin core : CoreFormalism"]),
  212. "Ready for command...",
  213. "Which model to overwrite?",
  214. "Waiting for model constructors...",
  215. "Model overwrite success!",
  216. "Ready for command...",
  217. set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  218. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  219. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  220. " 200 root nobody Empty : SimpleClassDiagrams",
  221. " 200 root admin core : CoreFormalism"]),
  222. "Ready for command...",
  223. "Which model do you want to modify?",
  224. "Model loaded, ready for commands!",
  225. "Use 'help' command for a list of possible commands",
  226. "Please give your command.",
  227. "List of all elements:",
  228. set([" B : Class",
  229. " C : Class"]),
  230. "Please give your command.",
  231. "Ready for command...",
  232. ]))
  233. def test_transform_add_MT_language(self):
  234. self.assertTrue(run_file(all_files,
  235. [ "root", "root", "root",
  236. "model_add",
  237. "SimpleClassDiagrams",
  238. "PetriNets",
  239. ] + get_model_constructor(open("integration/code/petrinets.mvc", "r").read()) + [
  240. "model_list_full",
  241. "transformation_add_MT_language",
  242. "PetriNets",
  243. "",
  244. "PetriNets_RAM",
  245. "model_list_full",
  246. ],
  247. [ "Desired username for admin user?",
  248. "Desired password for admin user?",
  249. "Please repeat the password",
  250. "Passwords match!",
  251. "Welcome to the Model Management Interface v2.0!",
  252. "Use the 'help' command for a list of possible commands",
  253. "Ready for command...",
  254. "Creating new model!",
  255. "Model type?",
  256. "Model name?",
  257. "Waiting for model constructors...",
  258. "Model upload success!",
  259. "Ready for command...",
  260. set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  261. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  262. " 200 root nobody PetriNets : SimpleClassDiagrams",
  263. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  264. " 200 root admin core : CoreFormalism"]),
  265. "Ready for command...",
  266. "Formalisms to include (terminate with empty string)?",
  267. "Name of the RAMified transformation metamodel?",
  268. "Ready for command...",
  269. set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  270. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  271. " 200 root nobody PetriNets : SimpleClassDiagrams",
  272. " 200 root nobody __merged_PetriNets_RAM : SimpleClassDiagrams",
  273. " 200 root nobody PetriNets_RAM : SimpleClassDiagrams",
  274. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  275. " 200 root admin core : CoreFormalism"]),
  276. "Ready for command...",
  277. ]))
  278. def test_transform_add_MT_instance(self):
  279. self.assertTrue(run_file(all_files,
  280. [ "root", "root", "root",
  281. "model_add",
  282. "SimpleClassDiagrams",
  283. "PetriNets",
  284. ] + get_model_constructor(open("integration/code/petrinets.mvc", "r").read()) + [
  285. "model_list_full",
  286. "transformation_add_MT_language",
  287. "PetriNets",
  288. "",
  289. "PetriNets_RAM",
  290. "model_list_full",
  291. "transformation_add_MT",
  292. "PetriNets_RAM",
  293. "PetriNets",
  294. "",
  295. "",
  296. "PetriNets_Print",
  297. "exit",
  298. "model_list_full",
  299. "transformation_list",
  300. "transformation_list_full",
  301. ],
  302. [ "Desired username for admin user?",
  303. "Desired password for admin user?",
  304. "Please repeat the password",
  305. "Passwords match!",
  306. "Welcome to the Model Management Interface v2.0!",
  307. "Use the 'help' command for a list of possible commands",
  308. "Ready for command...",
  309. "Creating new model!",
  310. "Model type?",
  311. "Model name?",
  312. "Waiting for model constructors...",
  313. "Model upload success!",
  314. "Ready for command...",
  315. set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  316. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  317. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  318. " 200 root nobody PetriNets : SimpleClassDiagrams",
  319. " 200 root admin core : CoreFormalism"]),
  320. "Ready for command...",
  321. "Formalisms to include (terminate with empty string)?",
  322. "Name of the RAMified transformation metamodel?",
  323. "Ready for command...",
  324. set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  325. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  326. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  327. " 200 root nobody PetriNets : SimpleClassDiagrams",
  328. " 200 root nobody __merged_PetriNets_RAM : SimpleClassDiagrams",
  329. " 200 root nobody PetriNets_RAM : SimpleClassDiagrams",
  330. " 200 root admin core : CoreFormalism"]),
  331. "Ready for command...",
  332. "RAMified metamodel to use?",
  333. "Supported metamodels:",
  334. set([" PetriNets",
  335. ]),
  336. "",
  337. "Which ones do you want to use as source (empty string to finish)?",
  338. "Model added as source",
  339. "Which ones do you want to use as target (empty string to finish)?",
  340. "Name of new transformation?",
  341. "Waiting for model constructors...",
  342. "Ready for command...",
  343. set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  344. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  345. " 200 root nobody PetriNets : SimpleClassDiagrams",
  346. " 200 root nobody __merged_PetriNets_RAM : SimpleClassDiagrams",
  347. " 200 root nobody PetriNets_RAM : SimpleClassDiagrams",
  348. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  349. " 200 root nobody PetriNets_Print : PetriNets_RAM",
  350. " 200 root admin core : CoreFormalism"]),
  351. "Ready for command...",
  352. set(["[ModelTransformation] PetriNets_Print : PetriNets_RAM",
  353. ]),
  354. "Ready for command...",
  355. set([" 200 root nobody [ModelTransformation] PetriNets_Print : PetriNets_RAM"
  356. ]),
  357. "Ready for command...",
  358. ]))
  359. def test_transform_add_MT_pn_print_upload(self):
  360. self.assertTrue(run_file(all_files,
  361. [ "root", "root", "root",
  362. "model_add",
  363. "SimpleClassDiagrams",
  364. "PetriNets",
  365. ] + get_model_constructor(open("integration/code/pn_runtime.mvc", "r").read()) + [
  366. "model_list_full",
  367. "transformation_add_MT_language",
  368. "PetriNets",
  369. "",
  370. "PetriNets_RAM",
  371. "model_list_full",
  372. "transformation_add_MT",
  373. "PetriNets_RAM",
  374. "PetriNets",
  375. "",
  376. "",
  377. "PetriNets_Print",
  378. ] + get_model_constructor(open("integration/code/pn_print.mvc", "r").read()) + [
  379. "transformation_list_full",
  380. ],
  381. [ "Desired username for admin user?",
  382. "Desired password for admin user?",
  383. "Please repeat the password",
  384. "Passwords match!",
  385. "Welcome to the Model Management Interface v2.0!",
  386. "Use the 'help' command for a list of possible commands",
  387. "Ready for command...",
  388. "Creating new model!",
  389. "Model type?",
  390. "Model name?",
  391. "Waiting for model constructors...",
  392. "Model upload success!",
  393. "Ready for command...",
  394. set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  395. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  396. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  397. " 200 root nobody PetriNets : SimpleClassDiagrams",
  398. " 200 root admin core : CoreFormalism"]),
  399. "Ready for command...",
  400. "Formalisms to include (terminate with empty string)?",
  401. "Name of the RAMified transformation metamodel?",
  402. "Ready for command...",
  403. set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  404. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  405. " 200 root nobody PetriNets : SimpleClassDiagrams",
  406. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  407. " 200 root nobody __merged_PetriNets_RAM : SimpleClassDiagrams",
  408. " 200 root nobody PetriNets_RAM : SimpleClassDiagrams",
  409. " 200 root admin core : CoreFormalism"]),
  410. "Ready for command...",
  411. "RAMified metamodel to use?",
  412. "Supported metamodels:",
  413. set([" PetriNets",
  414. ]),
  415. "",
  416. "Which ones do you want to use as source (empty string to finish)?",
  417. "Model added as source",
  418. "Which ones do you want to use as target (empty string to finish)?",
  419. "Name of new transformation?",
  420. "Waiting for model constructors...",
  421. "Ready for command...",
  422. set([" 200 root nobody [ModelTransformation] PetriNets_Print : PetriNets_RAM"
  423. ]),
  424. "Ready for command...",
  425. ]))
  426. def test_transform_add_MT_pn_print_exec(self):
  427. self.assertTrue(run_file(all_files,
  428. [ "root", "root", "root",
  429. "model_add",
  430. "SimpleClassDiagrams",
  431. "PetriNets",
  432. ] + get_model_constructor(open("integration/code/pn_runtime.mvc", "r").read()) + [
  433. "model_add",
  434. "PetriNets",
  435. "my_pn",
  436. ] + get_model_constructor(open("integration/code/pn_runtime_model.mvc", "r").read()) + [
  437. "model_list_full",
  438. "transformation_add_MT_language",
  439. "PetriNets",
  440. "",
  441. "PetriNets_RAM",
  442. "model_list_full",
  443. "transformation_add_MT",
  444. "PetriNets_RAM",
  445. "PetriNets",
  446. "",
  447. "",
  448. "PetriNets_Print",
  449. ] + get_model_constructor(open("integration/code/pn_print.mvc", "r").read()) + [
  450. "transformation_list_full",
  451. "transformation_execute",
  452. "PetriNets_Print",
  453. "my_pn",
  454. "transformation_list_full",
  455. ],
  456. [ "Desired username for admin user?",
  457. "Desired password for admin user?",
  458. "Please repeat the password",
  459. "Passwords match!",
  460. "Welcome to the Model Management Interface v2.0!",
  461. "Use the 'help' command for a list of possible commands",
  462. "Ready for command...",
  463. "Creating new model!",
  464. "Model type?",
  465. "Model name?",
  466. "Waiting for model constructors...",
  467. "Model upload success!",
  468. "Ready for command...",
  469. "Creating new model!",
  470. "Model type?",
  471. "Model name?",
  472. "Waiting for model constructors...",
  473. "Model upload success!",
  474. "Ready for command...",
  475. set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  476. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  477. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  478. " 200 root nobody PetriNets : SimpleClassDiagrams",
  479. " 200 root nobody my_pn : PetriNets",
  480. " 200 root admin core : CoreFormalism"]),
  481. "Ready for command...",
  482. "Formalisms to include (terminate with empty string)?",
  483. "Name of the RAMified transformation metamodel?",
  484. "Ready for command...",
  485. set([" 221 root admin SimpleClassDiagrams : SimpleClassDiagrams",
  486. " 221 root admin ActionLanguage : SimpleClassDiagrams",
  487. " 221 root admin CoreFormalism : SimpleClassDiagrams",
  488. " 200 root nobody PetriNets : SimpleClassDiagrams",
  489. " 200 root nobody __merged_PetriNets_RAM : SimpleClassDiagrams",
  490. " 200 root nobody PetriNets_RAM : SimpleClassDiagrams",
  491. " 200 root nobody my_pn : PetriNets",
  492. " 200 root admin core : CoreFormalism"]),
  493. "Ready for command...",
  494. "RAMified metamodel to use?",
  495. "Supported metamodels:",
  496. set([" PetriNets",
  497. ]),
  498. "",
  499. "Which ones do you want to use as source (empty string to finish)?",
  500. "Model added as source",
  501. "Which ones do you want to use as target (empty string to finish)?",
  502. "Name of new transformation?",
  503. "Waiting for model constructors...",
  504. "Ready for command...",
  505. set([" 200 root nobody [ModelTransformation] PetriNets_Print : PetriNets_RAM"
  506. ]),
  507. "Ready for command...",
  508. "Which transformation do you want to execute?",
  509. "Which model to bind for source element PetriNets",
  510. set(['"p1" --> 1',
  511. '"p2" --> 2',
  512. '"p3" --> 3',
  513. ]),
  514. "Transformation executed with result: True",
  515. "Ready for command...",
  516. ]))
  517. def test_transform_add_MT_pn_simulate(self):
  518. self.assertTrue(run_file(all_files,
  519. [ "root", "root", "root",
  520. "model_add",
  521. "SimpleClassDiagrams",
  522. "PetriNets",
  523. ] + get_model_constructor(open("integration/code/pn_design.mvc", "r").read()) + [
  524. "model_add",
  525. "SimpleClassDiagrams",
  526. "PetriNets_Runtime",
  527. ] + get_model_constructor(open("integration/code/pn_runtime.mvc", "r").read()) + [
  528. "model_add",
  529. "PetriNets",
  530. "my_pn",
  531. ] + get_model_constructor(open("integration/code/pn_design_model.mvc", "r").read()) + [
  532. "model_list",
  533. "transformation_add_MT_language",
  534. "PetriNets_Runtime",
  535. "PetriNets",
  536. "",
  537. "PetriNets_RAM",
  538. "model_list",
  539. "model_modify",
  540. "__merged_PetriNets_RAM",
  541. "instantiate",
  542. "Association",
  543. "D2R_PlaceLink",
  544. "PetriNets/Place",
  545. "PetriNets_Runtime/Place",
  546. "instantiate",
  547. "Association",
  548. "D2R_TransitionLink",
  549. "PetriNets/Transition",
  550. "PetriNets_Runtime/Transition",
  551. "instantiate",
  552. "Association",
  553. "R2D_PlaceLink",
  554. "PetriNets_Runtime/Place",
  555. "PetriNets/Place",
  556. "instantiate",
  557. "Association",
  558. "R2D_TransitionLink",
  559. "PetriNets_Runtime/Transition",
  560. "PetriNets/Transition",
  561. "exit",
  562. "transformation_RAMify",
  563. "__merged_PetriNets_RAM",
  564. "PetriNets_RAM",
  565. "transformation_add_MT",
  566. "PetriNets_RAM",
  567. "PetriNets",
  568. "",
  569. "PetriNets_Runtime",
  570. "",
  571. "pn_design_to_runtime",
  572. ] + get_model_constructor(open("integration/code/pn_design_to_runtime.mvc", "r").read()) + [
  573. "transformation_add_MT",
  574. "PetriNets_RAM",
  575. "PetriNets_Runtime",
  576. "",
  577. "PetriNets",
  578. "",
  579. "pn_runtime_to_design",
  580. ] + get_model_constructor(open("integration/code/pn_runtime_to_design.mvc", "r").read()) + [
  581. "transformation_add_MT",
  582. "PetriNets_RAM",
  583. "PetriNets_Runtime",
  584. "",
  585. "PetriNets_Runtime",
  586. "",
  587. "pn_step",
  588. ] + get_model_constructor(open("integration/code/pn_simulate.mvc", "r").read()) + [
  589. "transformation_add_MT",
  590. "PetriNets_RAM",
  591. "PetriNets",
  592. "",
  593. "",
  594. "pn_print",
  595. ] + get_model_constructor(open("integration/code/pn_print.mvc", "r").read()) + [
  596. "model_list",
  597. "transformation_list",
  598. "transformation_execute",
  599. "pn_print",
  600. "my_pn",
  601. "transformation_execute",
  602. "pn_design_to_runtime",
  603. "my_pn",
  604. "my_pn_runtime",
  605. "transformation_execute",
  606. "pn_step",
  607. "my_pn_runtime",
  608. "my_pn_runtime",
  609. "transformation_execute",
  610. "pn_runtime_to_design",
  611. "my_pn_runtime",
  612. "my_pn",
  613. "transformation_execute",
  614. "pn_print",
  615. "my_pn",
  616. ],
  617. [ # bootup phase
  618. "Desired username for admin user?",
  619. "Desired password for admin user?",
  620. "Please repeat the password",
  621. "Passwords match!",
  622. "Welcome to the Model Management Interface v2.0!",
  623. "Use the 'help' command for a list of possible commands",
  624. "Ready for command...",
  625. # model_add
  626. "Creating new model!",
  627. "Model type?",
  628. "Model name?",
  629. "Waiting for model constructors...",
  630. "Model upload success!",
  631. "Ready for command...",
  632. # model_add
  633. "Creating new model!",
  634. "Model type?",
  635. "Model name?",
  636. "Waiting for model constructors...",
  637. "Model upload success!",
  638. "Ready for command...",
  639. # model_add
  640. "Creating new model!",
  641. "Model type?",
  642. "Model name?",
  643. "Waiting for model constructors...",
  644. "Model upload success!",
  645. "Ready for command...",
  646. # model_list
  647. set([" SimpleClassDiagrams : SimpleClassDiagrams",
  648. " ActionLanguage : SimpleClassDiagrams",
  649. " CoreFormalism : SimpleClassDiagrams",
  650. " PetriNets : SimpleClassDiagrams",
  651. " my_pn : PetriNets",
  652. " PetriNets_Runtime : SimpleClassDiagrams",
  653. " core : CoreFormalism"]),
  654. "Ready for command...",
  655. # transformation_add_MT_language
  656. "Formalisms to include (terminate with empty string)?",
  657. "Name of the RAMified transformation metamodel?",
  658. "Ready for command...",
  659. # model_list
  660. set([" SimpleClassDiagrams : SimpleClassDiagrams",
  661. " ActionLanguage : SimpleClassDiagrams",
  662. " CoreFormalism : SimpleClassDiagrams",
  663. " PetriNets_Runtime : SimpleClassDiagrams",
  664. " PetriNets : SimpleClassDiagrams",
  665. " __merged_PetriNets_RAM : SimpleClassDiagrams",
  666. " PetriNets_RAM : SimpleClassDiagrams",
  667. " my_pn : PetriNets",
  668. " core : CoreFormalism"]),
  669. "Ready for command...",
  670. # model_modify
  671. "Which model do you want to modify?",
  672. "Model loaded, ready for commands!",
  673. "Use 'help' command for a list of possible commands",
  674. "Please give your command.",
  675. # instantiate 1
  676. "Type to instantiate?",
  677. "Name of new element?",
  678. "Source name?",
  679. "Destination name?",
  680. "Instantiation successful!",
  681. "Please give your command.",
  682. # instantiate 2
  683. "Type to instantiate?",
  684. "Name of new element?",
  685. "Source name?",
  686. "Destination name?",
  687. "Instantiation successful!",
  688. "Please give your command.",
  689. # instantiate 3
  690. "Type to instantiate?",
  691. "Name of new element?",
  692. "Source name?",
  693. "Destination name?",
  694. "Instantiation successful!",
  695. "Please give your command.",
  696. # instantiate 4
  697. "Type to instantiate?",
  698. "Name of new element?",
  699. "Source name?",
  700. "Destination name?",
  701. "Instantiation successful!",
  702. "Please give your command.",
  703. "Ready for command...",
  704. # transformation_RAMify
  705. "Which metamodel do you want to RAMify?",
  706. "Where do you want to store the RAMified metamodel?",
  707. "Ready for command...",
  708. # transformation_add_MT
  709. "RAMified metamodel to use?",
  710. "Supported metamodels:",
  711. set([" PetriNets",
  712. " PetriNets_Runtime",
  713. ]),
  714. "",
  715. "Which ones do you want to use as source (empty string to finish)?",
  716. "Model added as source",
  717. "Which ones do you want to use as target (empty string to finish)?",
  718. "Model added as target",
  719. "Name of new transformation?",
  720. "Waiting for model constructors...",
  721. "Ready for command...",
  722. # transformation_add_MT
  723. "RAMified metamodel to use?",
  724. "Supported metamodels:",
  725. set([" PetriNets",
  726. " PetriNets_Runtime",
  727. ]),
  728. "",
  729. "Which ones do you want to use as source (empty string to finish)?",
  730. "Model added as source",
  731. "Which ones do you want to use as target (empty string to finish)?",
  732. "Model added as target",
  733. "Name of new transformation?",
  734. "Waiting for model constructors...",
  735. "Ready for command...",
  736. # transformation_add_MT
  737. "RAMified metamodel to use?",
  738. "Supported metamodels:",
  739. set([" PetriNets",
  740. " PetriNets_Runtime",
  741. ]),
  742. "",
  743. "Which ones do you want to use as source (empty string to finish)?",
  744. "Model added as source",
  745. "Which ones do you want to use as target (empty string to finish)?",
  746. "Model added as target",
  747. "Name of new transformation?",
  748. "Waiting for model constructors...",
  749. "Ready for command...",
  750. # transformation_add_MT
  751. "RAMified metamodel to use?",
  752. "Supported metamodels:",
  753. set([" PetriNets",
  754. " PetriNets_Runtime",
  755. ]),
  756. "",
  757. "Which ones do you want to use as source (empty string to finish)?",
  758. "Model added as source",
  759. "Which ones do you want to use as target (empty string to finish)?",
  760. "Name of new transformation?",
  761. "Waiting for model constructors...",
  762. "Ready for command...",
  763. # model_list
  764. set([" SimpleClassDiagrams : SimpleClassDiagrams",
  765. " CoreFormalism : SimpleClassDiagrams",
  766. " PetriNets_Runtime : SimpleClassDiagrams",
  767. " PetriNets : SimpleClassDiagrams",
  768. " pn_print : PetriNets_RAM",
  769. " pn_design_to_runtime : PetriNets_RAM",
  770. " pn_runtime_to_design : PetriNets_RAM",
  771. " pn_step : PetriNets_RAM",
  772. " __merged_PetriNets_RAM : SimpleClassDiagrams",
  773. " PetriNets_RAM : SimpleClassDiagrams",
  774. " my_pn : PetriNets",
  775. " ActionLanguage : SimpleClassDiagrams",
  776. " core : CoreFormalism"]),
  777. "Ready for command...",
  778. # transformation_list
  779. set(["[ModelTransformation] pn_print : PetriNets_RAM",
  780. "[ModelTransformation] pn_design_to_runtime : PetriNets_RAM",
  781. "[ModelTransformation] pn_runtime_to_design : PetriNets_RAM",
  782. "[ModelTransformation] pn_step : PetriNets_RAM"]),
  783. "Ready for command...",
  784. # transformation_execute (pn_print)
  785. "Which transformation do you want to execute?",
  786. "Which model to bind for source element PetriNets",
  787. set(['"p1" --> 1',
  788. '"p2" --> 2',
  789. '"p3" --> 3',
  790. ]),
  791. "Transformation executed with result: True",
  792. "Ready for command...",
  793. # transformation_execute (pn_design_to_runtime)
  794. "Which transformation do you want to execute?",
  795. "Which model to bind for source element PetriNets",
  796. "Which model to create for target element PetriNets_Runtime",
  797. "Transformation executed with result: True",
  798. "Ready for command...",
  799. # transformation_execute (pn_step)
  800. "Which transformation do you want to execute?",
  801. "Which model to bind for source element PetriNets_Runtime",
  802. "Which model to create for target element PetriNets_Runtime",
  803. "Transformation executed with result: True",
  804. "Ready for command...",
  805. # transformation_execute (pn_runtime_to_design)
  806. "Which transformation do you want to execute?",
  807. "Which model to bind for source element PetriNets_Runtime",
  808. "Which model to create for target element PetriNets",
  809. "Transformation executed with result: True",
  810. "Ready for command...",
  811. # transformation_execute (pn_print)
  812. "Which transformation do you want to execute?",
  813. "Which model to bind for source element PetriNets",
  814. set(['"p1" --> 0',
  815. '"p2" --> 1',
  816. '"p3" --> 5',
  817. ]),
  818. "Transformation executed with result: True",
  819. "Ready for command...",
  820. ]))
  821. @slow
  822. def test_transform_add_MT_pn_simulate_larger(self):
  823. def step_and_print():
  824. return [ \
  825. # transformation_execute (pn_step)
  826. "Which transformation do you want to execute?",
  827. "Which model to bind for source element PetriNets_Runtime",
  828. "Which model to create for target element PetriNets_Runtime",
  829. "Transformation executed with result: True",
  830. "Ready for command...",
  831. # transformation_execute (pn_runtime_to_design)
  832. "Which transformation do you want to execute?",
  833. "Which model to bind for source element PetriNets_Runtime",
  834. "Which model to create for target element PetriNets",
  835. "Transformation executed with result: True",
  836. "Ready for command...",
  837. # transformation_execute (pn_print)
  838. "Which transformation do you want to execute?",
  839. "Which model to bind for source element PetriNets",
  840. None,
  841. None,
  842. None,
  843. "Transformation executed with result: True",
  844. "Ready for command...",
  845. ]
  846. self.assertTrue(run_file(all_files,
  847. [ "root", "root", "root",
  848. "model_add",
  849. "SimpleClassDiagrams",
  850. "PetriNets",
  851. ] + get_model_constructor(open("integration/code/pn_design.mvc", "r").read()) + [
  852. "model_add",
  853. "SimpleClassDiagrams",
  854. "PetriNets_Runtime",
  855. ] + get_model_constructor(open("integration/code/pn_runtime.mvc", "r").read()) + [
  856. "model_add",
  857. "PetriNets",
  858. "my_pn",
  859. ] + get_model_constructor(open("integration/code/pn_design_model_larger.mvc", "r").read()) + [
  860. "model_list",
  861. "transformation_add_MT_language",
  862. "PetriNets_Runtime",
  863. "PetriNets",
  864. "",
  865. "PetriNets_RAM",
  866. "model_list",
  867. "model_modify",
  868. "__merged_PetriNets_RAM",
  869. "instantiate",
  870. "Association",
  871. "D2R_PlaceLink",
  872. "PetriNets/Place",
  873. "PetriNets_Runtime/Place",
  874. "instantiate",
  875. "Association",
  876. "D2R_TransitionLink",
  877. "PetriNets/Transition",
  878. "PetriNets_Runtime/Transition",
  879. "instantiate",
  880. "Association",
  881. "R2D_PlaceLink",
  882. "PetriNets_Runtime/Place",
  883. "PetriNets/Place",
  884. "instantiate",
  885. "Association",
  886. "R2D_TransitionLink",
  887. "PetriNets_Runtime/Transition",
  888. "PetriNets/Transition",
  889. "exit",
  890. "transformation_RAMify",
  891. "__merged_PetriNets_RAM",
  892. "PetriNets_RAM",
  893. "transformation_add_MT",
  894. "PetriNets_RAM",
  895. "PetriNets",
  896. "",
  897. "PetriNets_Runtime",
  898. "",
  899. "pn_design_to_runtime",
  900. ] + get_model_constructor(open("integration/code/pn_design_to_runtime.mvc", "r").read()) + [
  901. "transformation_add_MT",
  902. "PetriNets_RAM",
  903. "PetriNets_Runtime",
  904. "",
  905. "PetriNets",
  906. "",
  907. "pn_runtime_to_design",
  908. ] + get_model_constructor(open("integration/code/pn_runtime_to_design.mvc", "r").read()) + [
  909. "transformation_add_MT",
  910. "PetriNets_RAM",
  911. "PetriNets_Runtime",
  912. "",
  913. "PetriNets_Runtime",
  914. "",
  915. "pn_step",
  916. ] + get_model_constructor(open("integration/code/pn_simulate.mvc", "r").read()) + [
  917. "transformation_add_MT",
  918. "PetriNets_RAM",
  919. "PetriNets",
  920. "",
  921. "",
  922. "pn_print",
  923. ] + get_model_constructor(open("integration/code/pn_print.mvc", "r").read()) + [
  924. "model_list",
  925. "transformation_list",
  926. "transformation_execute",
  927. "pn_print",
  928. "my_pn",
  929. "transformation_execute",
  930. "pn_design_to_runtime",
  931. "my_pn",
  932. "my_pn_runtime", ] + [
  933. "transformation_execute",
  934. "pn_step",
  935. "my_pn_runtime",
  936. "my_pn_runtime",
  937. "transformation_execute",
  938. "pn_runtime_to_design",
  939. "my_pn_runtime",
  940. "my_pn",
  941. "transformation_execute",
  942. "pn_print",
  943. "my_pn",
  944. ] * 10 + [
  945. ],
  946. [ # bootup phase
  947. "Desired username for admin user?",
  948. "Desired password for admin user?",
  949. "Please repeat the password",
  950. "Passwords match!",
  951. "Welcome to the Model Management Interface v2.0!",
  952. "Use the 'help' command for a list of possible commands",
  953. "Ready for command...",
  954. # model_add
  955. "Creating new model!",
  956. "Model type?",
  957. "Model name?",
  958. "Waiting for model constructors...",
  959. "Model upload success!",
  960. "Ready for command...",
  961. # model_add
  962. "Creating new model!",
  963. "Model type?",
  964. "Model name?",
  965. "Waiting for model constructors...",
  966. "Model upload success!",
  967. "Ready for command...",
  968. # model_add
  969. "Creating new model!",
  970. "Model type?",
  971. "Model name?",
  972. "Waiting for model constructors...",
  973. "Model upload success!",
  974. "Ready for command...",
  975. # model_list
  976. set([" SimpleClassDiagrams : SimpleClassDiagrams",
  977. " CoreFormalism : SimpleClassDiagrams",
  978. " PetriNets : SimpleClassDiagrams",
  979. " my_pn : PetriNets",
  980. " ActionLanguage : SimpleClassDiagrams",
  981. " PetriNets_Runtime : SimpleClassDiagrams",
  982. " core : CoreFormalism"]),
  983. "Ready for command...",
  984. # transformation_add_MT_language
  985. "Formalisms to include (terminate with empty string)?",
  986. "Name of the RAMified transformation metamodel?",
  987. "Ready for command...",
  988. # model_list
  989. set([" SimpleClassDiagrams : SimpleClassDiagrams",
  990. " CoreFormalism : SimpleClassDiagrams",
  991. " PetriNets_Runtime : SimpleClassDiagrams",
  992. " PetriNets : SimpleClassDiagrams",
  993. " ActionLanguage : SimpleClassDiagrams",
  994. " __merged_PetriNets_RAM : SimpleClassDiagrams",
  995. " PetriNets_RAM : SimpleClassDiagrams",
  996. " my_pn : PetriNets",
  997. " core : CoreFormalism"]),
  998. "Ready for command...",
  999. # model_modify
  1000. "Which model do you want to modify?",
  1001. "Model loaded, ready for commands!",
  1002. "Use 'help' command for a list of possible commands",
  1003. "Please give your command.",
  1004. # instantiate 1
  1005. "Type to instantiate?",
  1006. "Name of new element?",
  1007. "Source name?",
  1008. "Destination name?",
  1009. "Instantiation successful!",
  1010. "Please give your command.",
  1011. # instantiate 2
  1012. "Type to instantiate?",
  1013. "Name of new element?",
  1014. "Source name?",
  1015. "Destination name?",
  1016. "Instantiation successful!",
  1017. "Please give your command.",
  1018. # instantiate 3
  1019. "Type to instantiate?",
  1020. "Name of new element?",
  1021. "Source name?",
  1022. "Destination name?",
  1023. "Instantiation successful!",
  1024. "Please give your command.",
  1025. # instantiate 4
  1026. "Type to instantiate?",
  1027. "Name of new element?",
  1028. "Source name?",
  1029. "Destination name?",
  1030. "Instantiation successful!",
  1031. "Please give your command.",
  1032. "Ready for command...",
  1033. # transformation_RAMify
  1034. "Which metamodel do you want to RAMify?",
  1035. "Where do you want to store the RAMified metamodel?",
  1036. "Ready for command...",
  1037. # transformation_add_MT
  1038. "RAMified metamodel to use?",
  1039. "Supported metamodels:",
  1040. set([" PetriNets",
  1041. " PetriNets_Runtime",
  1042. ]),
  1043. "",
  1044. "Which ones do you want to use as source (empty string to finish)?",
  1045. "Model added as source",
  1046. "Which ones do you want to use as target (empty string to finish)?",
  1047. "Model added as target",
  1048. "Name of new transformation?",
  1049. "Waiting for model constructors...",
  1050. "Ready for command...",
  1051. # transformation_add_MT
  1052. "RAMified metamodel to use?",
  1053. "Supported metamodels:",
  1054. set([" PetriNets",
  1055. " PetriNets_Runtime",
  1056. ]),
  1057. "",
  1058. "Which ones do you want to use as source (empty string to finish)?",
  1059. "Model added as source",
  1060. "Which ones do you want to use as target (empty string to finish)?",
  1061. "Model added as target",
  1062. "Name of new transformation?",
  1063. "Waiting for model constructors...",
  1064. "Ready for command...",
  1065. # transformation_add_MT
  1066. "RAMified metamodel to use?",
  1067. "Supported metamodels:",
  1068. set([" PetriNets",
  1069. " PetriNets_Runtime",
  1070. ]),
  1071. "",
  1072. "Which ones do you want to use as source (empty string to finish)?",
  1073. "Model added as source",
  1074. "Which ones do you want to use as target (empty string to finish)?",
  1075. "Model added as target",
  1076. "Name of new transformation?",
  1077. "Waiting for model constructors...",
  1078. "Ready for command...",
  1079. # transformation_add_MT
  1080. "RAMified metamodel to use?",
  1081. "Supported metamodels:",
  1082. set([" PetriNets",
  1083. " PetriNets_Runtime",
  1084. ]),
  1085. "",
  1086. "Which ones do you want to use as source (empty string to finish)?",
  1087. "Model added as source",
  1088. "Which ones do you want to use as target (empty string to finish)?",
  1089. "Name of new transformation?",
  1090. "Waiting for model constructors...",
  1091. "Ready for command...",
  1092. # model_list
  1093. set([" SimpleClassDiagrams : SimpleClassDiagrams",
  1094. " CoreFormalism : SimpleClassDiagrams",
  1095. " PetriNets_Runtime : SimpleClassDiagrams",
  1096. " PetriNets : SimpleClassDiagrams",
  1097. " ActionLanguage : SimpleClassDiagrams",
  1098. " pn_print : PetriNets_RAM",
  1099. " pn_design_to_runtime : PetriNets_RAM",
  1100. " pn_runtime_to_design : PetriNets_RAM",
  1101. " pn_step : PetriNets_RAM",
  1102. " __merged_PetriNets_RAM : SimpleClassDiagrams",
  1103. " PetriNets_RAM : SimpleClassDiagrams",
  1104. " my_pn : PetriNets",
  1105. " core : CoreFormalism"]),
  1106. "Ready for command...",
  1107. # transformation_list
  1108. set(["[ModelTransformation] pn_print : PetriNets_RAM",
  1109. "[ModelTransformation] pn_design_to_runtime : PetriNets_RAM",
  1110. "[ModelTransformation] pn_runtime_to_design : PetriNets_RAM",
  1111. "[ModelTransformation] pn_step : PetriNets_RAM"]),
  1112. "Ready for command...",
  1113. # transformation_execute (pn_print)
  1114. "Which transformation do you want to execute?",
  1115. "Which model to bind for source element PetriNets",
  1116. set(['"lock_available" --> 1',
  1117. '"critical_section_1" --> 0',
  1118. '"critical_section_2" --> 0',
  1119. ]),
  1120. "Transformation executed with result: True",
  1121. "Ready for command...",
  1122. # transformation_execute (pn_design_to_runtime)
  1123. "Which transformation do you want to execute?",
  1124. "Which model to bind for source element PetriNets",
  1125. "Which model to create for target element PetriNets_Runtime",
  1126. "Transformation executed with result: True",
  1127. "Ready for command...",
  1128. ] + \
  1129. step_and_print() * 10 +
  1130. []))
  1131. def test_transform_add_AL_pn_simulate(self):
  1132. self.assertTrue(run_file(all_files,
  1133. [ "root", "root", "root",
  1134. "model_add",
  1135. "SimpleClassDiagrams",
  1136. "PetriNets",
  1137. ] + get_model_constructor(open("integration/code/pn_design.mvc", "r").read()) + [
  1138. "model_add",
  1139. "SimpleClassDiagrams",
  1140. "PetriNets_Runtime",
  1141. ] + get_model_constructor(open("integration/code/pn_runtime.mvc", "r").read()) + [
  1142. "model_add",
  1143. "PetriNets",
  1144. "my_pn",
  1145. ] + get_model_constructor(open("integration/code/pn_design_model.mvc", "r").read()) + [
  1146. "model_list",
  1147. "transformation_add_MT_language",
  1148. "PetriNets_Runtime",
  1149. "PetriNets",
  1150. "",
  1151. "PetriNets_RAM",
  1152. "model_list",
  1153. "model_modify",
  1154. "__merged_PetriNets_RAM",
  1155. "instantiate",
  1156. "Association",
  1157. "D2R_PlaceLink",
  1158. "PetriNets/Place",
  1159. "PetriNets_Runtime/Place",
  1160. "instantiate",
  1161. "Association",
  1162. "D2R_TransitionLink",
  1163. "PetriNets/Transition",
  1164. "PetriNets_Runtime/Transition",
  1165. "instantiate",
  1166. "Association",
  1167. "R2D_PlaceLink",
  1168. "PetriNets_Runtime/Place",
  1169. "PetriNets/Place",
  1170. "instantiate",
  1171. "Association",
  1172. "R2D_TransitionLink",
  1173. "PetriNets_Runtime/Transition",
  1174. "PetriNets/Transition",
  1175. "exit",
  1176. "transformation_RAMify",
  1177. "__merged_PetriNets_RAM",
  1178. "PetriNets_RAM",
  1179. "transformation_add_MT",
  1180. "PetriNets_RAM",
  1181. "PetriNets",
  1182. "",
  1183. "PetriNets_Runtime",
  1184. "",
  1185. "pn_design_to_runtime",
  1186. ] + get_model_constructor(open("integration/code/pn_design_to_runtime.mvc", "r").read()) + [
  1187. "transformation_add_MT",
  1188. "PetriNets_RAM",
  1189. "PetriNets_Runtime",
  1190. "",
  1191. "PetriNets",
  1192. "",
  1193. "pn_runtime_to_design",
  1194. ] + get_model_constructor(open("integration/code/pn_runtime_to_design.mvc", "r").read()) + [
  1195. "transformation_add_AL",
  1196. "PetriNets_Runtime",
  1197. "",
  1198. "PetriNets_Runtime",
  1199. "",
  1200. "pn_step",
  1201. ] + get_constructor(open("integration/code/pn_simulate.alc", "r").read()) + [
  1202. "transformation_add_MT",
  1203. "PetriNets_RAM",
  1204. "PetriNets",
  1205. "",
  1206. "",
  1207. "pn_print",
  1208. ] + get_model_constructor(open("integration/code/pn_print.mvc", "r").read()) + [
  1209. "model_list",
  1210. "transformation_list",
  1211. "transformation_execute",
  1212. "pn_print",
  1213. "my_pn",
  1214. "transformation_execute",
  1215. "pn_design_to_runtime",
  1216. "my_pn",
  1217. "my_pn_runtime",
  1218. "transformation_execute",
  1219. "pn_step",
  1220. "my_pn_runtime",
  1221. "my_pn_runtime",
  1222. "transformation_execute",
  1223. "pn_runtime_to_design",
  1224. "my_pn_runtime",
  1225. "my_pn",
  1226. "transformation_execute",
  1227. "pn_print",
  1228. "my_pn",
  1229. ],
  1230. [ # bootup phase
  1231. "Desired username for admin user?",
  1232. "Desired password for admin user?",
  1233. "Please repeat the password",
  1234. "Passwords match!",
  1235. "Welcome to the Model Management Interface v2.0!",
  1236. "Use the 'help' command for a list of possible commands",
  1237. "Ready for command...",
  1238. # model_add
  1239. "Creating new model!",
  1240. "Model type?",
  1241. "Model name?",
  1242. "Waiting for model constructors...",
  1243. "Model upload success!",
  1244. "Ready for command...",
  1245. # model_add
  1246. "Creating new model!",
  1247. "Model type?",
  1248. "Model name?",
  1249. "Waiting for model constructors...",
  1250. "Model upload success!",
  1251. "Ready for command...",
  1252. # model_add
  1253. "Creating new model!",
  1254. "Model type?",
  1255. "Model name?",
  1256. "Waiting for model constructors...",
  1257. "Model upload success!",
  1258. "Ready for command...",
  1259. # model_list
  1260. set([" SimpleClassDiagrams : SimpleClassDiagrams",
  1261. " ActionLanguage : SimpleClassDiagrams",
  1262. " CoreFormalism : SimpleClassDiagrams",
  1263. " PetriNets : SimpleClassDiagrams",
  1264. " my_pn : PetriNets",
  1265. " PetriNets_Runtime : SimpleClassDiagrams",
  1266. " core : CoreFormalism"]),
  1267. "Ready for command...",
  1268. # transformation_add_MT_language
  1269. "Formalisms to include (terminate with empty string)?",
  1270. "Name of the RAMified transformation metamodel?",
  1271. "Ready for command...",
  1272. # model_list
  1273. set([" SimpleClassDiagrams : SimpleClassDiagrams",
  1274. " ActionLanguage : SimpleClassDiagrams",
  1275. " CoreFormalism : SimpleClassDiagrams",
  1276. " PetriNets_Runtime : SimpleClassDiagrams",
  1277. " PetriNets : SimpleClassDiagrams",
  1278. " __merged_PetriNets_RAM : SimpleClassDiagrams",
  1279. " PetriNets_RAM : SimpleClassDiagrams",
  1280. " my_pn : PetriNets",
  1281. " core : CoreFormalism"]),
  1282. "Ready for command...",
  1283. # model_modify
  1284. "Which model do you want to modify?",
  1285. "Model loaded, ready for commands!",
  1286. "Use 'help' command for a list of possible commands",
  1287. "Please give your command.",
  1288. # instantiate 1
  1289. "Type to instantiate?",
  1290. "Name of new element?",
  1291. "Source name?",
  1292. "Destination name?",
  1293. "Instantiation successful!",
  1294. "Please give your command.",
  1295. # instantiate 2
  1296. "Type to instantiate?",
  1297. "Name of new element?",
  1298. "Source name?",
  1299. "Destination name?",
  1300. "Instantiation successful!",
  1301. "Please give your command.",
  1302. # instantiate 3
  1303. "Type to instantiate?",
  1304. "Name of new element?",
  1305. "Source name?",
  1306. "Destination name?",
  1307. "Instantiation successful!",
  1308. "Please give your command.",
  1309. # instantiate 4
  1310. "Type to instantiate?",
  1311. "Name of new element?",
  1312. "Source name?",
  1313. "Destination name?",
  1314. "Instantiation successful!",
  1315. "Please give your command.",
  1316. "Ready for command...",
  1317. # transformation_RAMify
  1318. "Which metamodel do you want to RAMify?",
  1319. "Where do you want to store the RAMified metamodel?",
  1320. "Ready for command...",
  1321. # transformation_add_MT
  1322. "RAMified metamodel to use?",
  1323. "Supported metamodels:",
  1324. set([" PetriNets",
  1325. " PetriNets_Runtime",
  1326. ]),
  1327. "",
  1328. "Which ones do you want to use as source (empty string to finish)?",
  1329. "Model added as source",
  1330. "Which ones do you want to use as target (empty string to finish)?",
  1331. "Model added as target",
  1332. "Name of new transformation?",
  1333. "Waiting for model constructors...",
  1334. "Ready for command...",
  1335. # transformation_add_MT
  1336. "RAMified metamodel to use?",
  1337. "Supported metamodels:",
  1338. set([" PetriNets",
  1339. " PetriNets_Runtime",
  1340. ]),
  1341. "",
  1342. "Which ones do you want to use as source (empty string to finish)?",
  1343. "Model added as source",
  1344. "Which ones do you want to use as target (empty string to finish)?",
  1345. "Model added as target",
  1346. "Name of new transformation?",
  1347. "Waiting for model constructors...",
  1348. "Ready for command...",
  1349. # transformation_add_AL
  1350. "Which metamodels do you want to use as source for the action code (empty string to finish)?",
  1351. "Model added as source",
  1352. "Which metamodels do you want to use as target for the action code (empty string to finish)?",
  1353. "Model added as target",
  1354. "Name of Action Language model?",
  1355. "Waiting for model constructors...",
  1356. "Ready for command...",
  1357. # transformation_add_MT
  1358. "RAMified metamodel to use?",
  1359. "Supported metamodels:",
  1360. set([" PetriNets",
  1361. " PetriNets_Runtime",
  1362. ]),
  1363. "",
  1364. "Which ones do you want to use as source (empty string to finish)?",
  1365. "Model added as source",
  1366. "Which ones do you want to use as target (empty string to finish)?",
  1367. "Name of new transformation?",
  1368. "Waiting for model constructors...",
  1369. "Ready for command...",
  1370. # model_list
  1371. set([" SimpleClassDiagrams : SimpleClassDiagrams",
  1372. " CoreFormalism : SimpleClassDiagrams",
  1373. " PetriNets_Runtime : SimpleClassDiagrams",
  1374. " PetriNets : SimpleClassDiagrams",
  1375. " pn_print : PetriNets_RAM",
  1376. " pn_design_to_runtime : PetriNets_RAM",
  1377. " pn_runtime_to_design : PetriNets_RAM",
  1378. " pn_step : ActionLanguage",
  1379. " __merged_PetriNets_RAM : SimpleClassDiagrams",
  1380. " PetriNets_RAM : SimpleClassDiagrams",
  1381. " my_pn : PetriNets",
  1382. " ActionLanguage : SimpleClassDiagrams",
  1383. " core : CoreFormalism"]),
  1384. "Ready for command...",
  1385. # transformation_list
  1386. set(["[ModelTransformation] pn_print : PetriNets_RAM",
  1387. "[ModelTransformation] pn_design_to_runtime : PetriNets_RAM",
  1388. "[ModelTransformation] pn_runtime_to_design : PetriNets_RAM",
  1389. "[ActionLanguage] pn_step : ActionLanguage"]),
  1390. "Ready for command...",
  1391. # transformation_execute (pn_print)
  1392. "Which transformation do you want to execute?",
  1393. "Which model to bind for source element PetriNets",
  1394. set(['"p1" --> 1',
  1395. '"p2" --> 2',
  1396. '"p3" --> 3',
  1397. ]),
  1398. "Transformation executed with result: True",
  1399. "Ready for command...",
  1400. # transformation_execute (pn_design_to_runtime)
  1401. "Which transformation do you want to execute?",
  1402. "Which model to bind for source element PetriNets",
  1403. "Which model to create for target element PetriNets_Runtime",
  1404. "Transformation executed with result: True",
  1405. "Ready for command...",
  1406. # transformation_execute (pn_step)
  1407. "Which transformation do you want to execute?",
  1408. "Which model to bind for source element PetriNets_Runtime",
  1409. "Which model to create for target element PetriNets_Runtime",
  1410. "Ready for command...",
  1411. # transformation_execute (pn_runtime_to_design)
  1412. "Which transformation do you want to execute?",
  1413. "Which model to bind for source element PetriNets_Runtime",
  1414. "Which model to create for target element PetriNets",
  1415. "Transformation executed with result: True",
  1416. "Ready for command...",
  1417. # transformation_execute (pn_print)
  1418. "Which transformation do you want to execute?",
  1419. "Which model to bind for source element PetriNets",
  1420. set(['"p1" --> 0',
  1421. '"p2" --> 1',
  1422. '"p3" --> 5',
  1423. ]),
  1424. "Transformation executed with result: True",
  1425. "Ready for command...",
  1426. ]))