1
0

Helios-Commands-SUnit.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. define(["amber/boot", "require", "helios/Helios-Commands-Tools"], function($boot,requirejs){"use strict";
  2. var $core=$boot.api,nil=$boot.nilAsValue,$nil=$boot.nilAsReceiver,$recv=$boot.asReceiver,$globals=$boot.globals;
  3. var $pkg = $core.addPackage("Helios-Commands-SUnit");
  4. $pkg.innerEval = function (expr) { return eval(expr); };
  5. $pkg.transport = {"type":"amd","amdNamespace":"helios"};
  6. $core.addClass("HLSUnitCommand", $globals.HLToolCommand, [], "Helios-Commands-SUnit");
  7. //>>excludeStart("ide", pragmas.excludeIdeData);
  8. $globals.HLSUnitCommand.comment="I group the commands pertaining to Helios-SUnit (`HLSUnitModel`)";
  9. //>>excludeEnd("ide");
  10. $core.addMethod(
  11. $core.method({
  12. selector: "isValidFor:",
  13. protocol: "testing",
  14. fn: function (aModel){
  15. var self=this,$self=this;
  16. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  17. return $core.withContext(function($ctx1) {
  18. //>>excludeEnd("ctx");
  19. return $recv(aModel)._isKindOf_($globals.HLSUnitModel);
  20. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  21. }, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},$globals.HLSUnitCommand.a$cls)});
  22. //>>excludeEnd("ctx");
  23. },
  24. //>>excludeStart("ide", pragmas.excludeIdeData);
  25. args: ["aModel"],
  26. source: "isValidFor: aModel\x0a\x09^ aModel isKindOf: HLSUnitModel",
  27. referencedClasses: ["HLSUnitModel"],
  28. //>>excludeEnd("ide");
  29. messageSends: ["isKindOf:"]
  30. }),
  31. $globals.HLSUnitCommand.a$cls);
  32. $core.addClass("HLSUnitInvertSelectedCommand", $globals.HLSUnitCommand, [], "Helios-Commands-SUnit");
  33. //>>excludeStart("ide", pragmas.excludeIdeData);
  34. $globals.HLSUnitInvertSelectedCommand.comment="I group the commands that invert selections";
  35. //>>excludeEnd("ide");
  36. $core.addMethod(
  37. $core.method({
  38. selector: "key",
  39. protocol: "accessing",
  40. fn: function (){
  41. var self=this,$self=this;
  42. return "i";
  43. },
  44. //>>excludeStart("ide", pragmas.excludeIdeData);
  45. args: [],
  46. source: "key\x0a\x09^ 'i'",
  47. referencedClasses: [],
  48. //>>excludeEnd("ide");
  49. messageSends: []
  50. }),
  51. $globals.HLSUnitInvertSelectedCommand.a$cls);
  52. $core.addMethod(
  53. $core.method({
  54. selector: "label",
  55. protocol: "accessing",
  56. fn: function (){
  57. var self=this,$self=this;
  58. return "Invert selection";
  59. },
  60. //>>excludeStart("ide", pragmas.excludeIdeData);
  61. args: [],
  62. source: "label\x0a\x09^'Invert selection'",
  63. referencedClasses: [],
  64. //>>excludeEnd("ide");
  65. messageSends: []
  66. }),
  67. $globals.HLSUnitInvertSelectedCommand.a$cls);
  68. $core.addClass("HLSUnitInvertSelectedClassesCommand", $globals.HLSUnitInvertSelectedCommand, [], "Helios-Commands-SUnit");
  69. //>>excludeStart("ide", pragmas.excludeIdeData);
  70. $globals.HLSUnitInvertSelectedClassesCommand.comment="Invert the currently selected classes on a `HLSUnitModel`";
  71. //>>excludeEnd("ide");
  72. $core.addMethod(
  73. $core.method({
  74. selector: "category",
  75. protocol: "accessing",
  76. fn: function (){
  77. var self=this,$self=this;
  78. return "Classes";
  79. },
  80. //>>excludeStart("ide", pragmas.excludeIdeData);
  81. args: [],
  82. source: "category\x0a\x09^'Classes'",
  83. referencedClasses: [],
  84. //>>excludeEnd("ide");
  85. messageSends: []
  86. }),
  87. $globals.HLSUnitInvertSelectedClassesCommand);
  88. $core.addMethod(
  89. $core.method({
  90. selector: "execute",
  91. protocol: "executing",
  92. fn: function (){
  93. var self=this,$self=this;
  94. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  95. return $core.withContext(function($ctx1) {
  96. //>>excludeEnd("ctx");
  97. $recv($self._model())._invertSelectedClasses();
  98. return self;
  99. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  100. }, function($ctx1) {$ctx1.fill(self,"execute",{},$globals.HLSUnitInvertSelectedClassesCommand)});
  101. //>>excludeEnd("ctx");
  102. },
  103. //>>excludeStart("ide", pragmas.excludeIdeData);
  104. args: [],
  105. source: "execute\x0a\x09self model invertSelectedClasses",
  106. referencedClasses: [],
  107. //>>excludeEnd("ide");
  108. messageSends: ["invertSelectedClasses", "model"]
  109. }),
  110. $globals.HLSUnitInvertSelectedClassesCommand);
  111. $core.addMethod(
  112. $core.method({
  113. selector: "isActive",
  114. protocol: "testing",
  115. fn: function (){
  116. var self=this,$self=this;
  117. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  118. return $core.withContext(function($ctx1) {
  119. //>>excludeEnd("ctx");
  120. return $recv($recv($self.model)._selectedPackages())._notEmpty();
  121. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  122. }, function($ctx1) {$ctx1.fill(self,"isActive",{},$globals.HLSUnitInvertSelectedClassesCommand)});
  123. //>>excludeEnd("ctx");
  124. },
  125. //>>excludeStart("ide", pragmas.excludeIdeData);
  126. args: [],
  127. source: "isActive\x0a\x09^model selectedPackages notEmpty",
  128. referencedClasses: [],
  129. //>>excludeEnd("ide");
  130. messageSends: ["notEmpty", "selectedPackages"]
  131. }),
  132. $globals.HLSUnitInvertSelectedClassesCommand);
  133. $core.addMethod(
  134. $core.method({
  135. selector: "key",
  136. protocol: "accessing",
  137. fn: function (){
  138. var self=this,$self=this;
  139. return "c";
  140. },
  141. //>>excludeStart("ide", pragmas.excludeIdeData);
  142. args: [],
  143. source: "key\x0a\x09^ 'c'",
  144. referencedClasses: [],
  145. //>>excludeEnd("ide");
  146. messageSends: []
  147. }),
  148. $globals.HLSUnitInvertSelectedClassesCommand.a$cls);
  149. $core.addMethod(
  150. $core.method({
  151. selector: "label",
  152. protocol: "accessing",
  153. fn: function (){
  154. var self=this,$self=this;
  155. return "Invert selected classes";
  156. },
  157. //>>excludeStart("ide", pragmas.excludeIdeData);
  158. args: [],
  159. source: "label\x0a\x09^ 'Invert selected classes'",
  160. referencedClasses: [],
  161. //>>excludeEnd("ide");
  162. messageSends: []
  163. }),
  164. $globals.HLSUnitInvertSelectedClassesCommand.a$cls);
  165. $core.addClass("HLSUnitInvertSelectedPackagesCommand", $globals.HLSUnitInvertSelectedCommand, [], "Helios-Commands-SUnit");
  166. //>>excludeStart("ide", pragmas.excludeIdeData);
  167. $globals.HLSUnitInvertSelectedPackagesCommand.comment="Invert the currently selected packages on a `HLSUnitModel`";
  168. //>>excludeEnd("ide");
  169. $core.addMethod(
  170. $core.method({
  171. selector: "category",
  172. protocol: "accessing",
  173. fn: function (){
  174. var self=this,$self=this;
  175. return "Packages";
  176. },
  177. //>>excludeStart("ide", pragmas.excludeIdeData);
  178. args: [],
  179. source: "category\x0a\x09^'Packages'",
  180. referencedClasses: [],
  181. //>>excludeEnd("ide");
  182. messageSends: []
  183. }),
  184. $globals.HLSUnitInvertSelectedPackagesCommand);
  185. $core.addMethod(
  186. $core.method({
  187. selector: "execute",
  188. protocol: "executing",
  189. fn: function (){
  190. var self=this,$self=this;
  191. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  192. return $core.withContext(function($ctx1) {
  193. //>>excludeEnd("ctx");
  194. $recv($self._model())._invertSelectedPackages();
  195. return self;
  196. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  197. }, function($ctx1) {$ctx1.fill(self,"execute",{},$globals.HLSUnitInvertSelectedPackagesCommand)});
  198. //>>excludeEnd("ctx");
  199. },
  200. //>>excludeStart("ide", pragmas.excludeIdeData);
  201. args: [],
  202. source: "execute\x0a\x09self model invertSelectedPackages",
  203. referencedClasses: [],
  204. //>>excludeEnd("ide");
  205. messageSends: ["invertSelectedPackages", "model"]
  206. }),
  207. $globals.HLSUnitInvertSelectedPackagesCommand);
  208. $core.addMethod(
  209. $core.method({
  210. selector: "isActive",
  211. protocol: "testing",
  212. fn: function (){
  213. var self=this,$self=this;
  214. return true;
  215. },
  216. //>>excludeStart("ide", pragmas.excludeIdeData);
  217. args: [],
  218. source: "isActive\x0a\x09^true",
  219. referencedClasses: [],
  220. //>>excludeEnd("ide");
  221. messageSends: []
  222. }),
  223. $globals.HLSUnitInvertSelectedPackagesCommand);
  224. $core.addMethod(
  225. $core.method({
  226. selector: "key",
  227. protocol: "accessing",
  228. fn: function (){
  229. var self=this,$self=this;
  230. return "p";
  231. },
  232. //>>excludeStart("ide", pragmas.excludeIdeData);
  233. args: [],
  234. source: "key\x0a\x09^ 'p'",
  235. referencedClasses: [],
  236. //>>excludeEnd("ide");
  237. messageSends: []
  238. }),
  239. $globals.HLSUnitInvertSelectedPackagesCommand.a$cls);
  240. $core.addMethod(
  241. $core.method({
  242. selector: "label",
  243. protocol: "accessing",
  244. fn: function (){
  245. var self=this,$self=this;
  246. return "Invert selected packages";
  247. },
  248. //>>excludeStart("ide", pragmas.excludeIdeData);
  249. args: [],
  250. source: "label\x0a\x09^ 'Invert selected packages'",
  251. referencedClasses: [],
  252. //>>excludeEnd("ide");
  253. messageSends: []
  254. }),
  255. $globals.HLSUnitInvertSelectedPackagesCommand.a$cls);
  256. $core.addClass("HLSUnitRunTests", $globals.HLSUnitCommand, [], "Helios-Commands-SUnit");
  257. //>>excludeStart("ide", pragmas.excludeIdeData);
  258. $globals.HLSUnitRunTests.comment="Run the test cases in the currently selected classes on a `HLSUnitModel`";
  259. //>>excludeEnd("ide");
  260. $core.addMethod(
  261. $core.method({
  262. selector: "execute",
  263. protocol: "executing",
  264. fn: function (){
  265. var self=this,$self=this;
  266. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  267. return $core.withContext(function($ctx1) {
  268. //>>excludeEnd("ctx");
  269. $recv($self._model())._runTests();
  270. return self;
  271. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  272. }, function($ctx1) {$ctx1.fill(self,"execute",{},$globals.HLSUnitRunTests)});
  273. //>>excludeEnd("ctx");
  274. },
  275. //>>excludeStart("ide", pragmas.excludeIdeData);
  276. args: [],
  277. source: "execute\x0a\x09self model runTests",
  278. referencedClasses: [],
  279. //>>excludeEnd("ide");
  280. messageSends: ["runTests", "model"]
  281. }),
  282. $globals.HLSUnitRunTests);
  283. $core.addMethod(
  284. $core.method({
  285. selector: "isActive",
  286. protocol: "testing",
  287. fn: function (){
  288. var self=this,$self=this;
  289. return true;
  290. },
  291. //>>excludeStart("ide", pragmas.excludeIdeData);
  292. args: [],
  293. source: "isActive\x0a\x09^true",
  294. referencedClasses: [],
  295. //>>excludeEnd("ide");
  296. messageSends: []
  297. }),
  298. $globals.HLSUnitRunTests);
  299. $core.addMethod(
  300. $core.method({
  301. selector: "key",
  302. protocol: "accessing",
  303. fn: function (){
  304. var self=this,$self=this;
  305. return "r";
  306. },
  307. //>>excludeStart("ide", pragmas.excludeIdeData);
  308. args: [],
  309. source: "key\x0a\x09^'r'",
  310. referencedClasses: [],
  311. //>>excludeEnd("ide");
  312. messageSends: []
  313. }),
  314. $globals.HLSUnitRunTests.a$cls);
  315. $core.addMethod(
  316. $core.method({
  317. selector: "label",
  318. protocol: "accessing",
  319. fn: function (){
  320. var self=this,$self=this;
  321. return "Run Tests";
  322. },
  323. //>>excludeStart("ide", pragmas.excludeIdeData);
  324. args: [],
  325. source: "label\x0a\x09^'Run Tests'",
  326. referencedClasses: [],
  327. //>>excludeEnd("ide");
  328. messageSends: []
  329. }),
  330. $globals.HLSUnitRunTests.a$cls);
  331. $core.addClass("HLSUnitSelectAllCommand", $globals.HLSUnitCommand, [], "Helios-Commands-SUnit");
  332. //>>excludeStart("ide", pragmas.excludeIdeData);
  333. $globals.HLSUnitSelectAllCommand.comment="I group the select all commands";
  334. //>>excludeEnd("ide");
  335. $core.addMethod(
  336. $core.method({
  337. selector: "key",
  338. protocol: "accessing",
  339. fn: function (){
  340. var self=this,$self=this;
  341. return "a";
  342. },
  343. //>>excludeStart("ide", pragmas.excludeIdeData);
  344. args: [],
  345. source: "key\x0a\x09^ 'a'",
  346. referencedClasses: [],
  347. //>>excludeEnd("ide");
  348. messageSends: []
  349. }),
  350. $globals.HLSUnitSelectAllCommand.a$cls);
  351. $core.addMethod(
  352. $core.method({
  353. selector: "label",
  354. protocol: "accessing",
  355. fn: function (){
  356. var self=this,$self=this;
  357. return "Select all";
  358. },
  359. //>>excludeStart("ide", pragmas.excludeIdeData);
  360. args: [],
  361. source: "label\x0a\x09^ 'Select all'",
  362. referencedClasses: [],
  363. //>>excludeEnd("ide");
  364. messageSends: []
  365. }),
  366. $globals.HLSUnitSelectAllCommand.a$cls);
  367. $core.addClass("HLSUnitSelectAllClassesCommand", $globals.HLSUnitSelectAllCommand, [], "Helios-Commands-SUnit");
  368. //>>excludeStart("ide", pragmas.excludeIdeData);
  369. $globals.HLSUnitSelectAllClassesCommand.comment="Select all available test classes based on what packages are selected on a `HLSUnitModel`";
  370. //>>excludeEnd("ide");
  371. $core.addMethod(
  372. $core.method({
  373. selector: "category",
  374. protocol: "accessing",
  375. fn: function (){
  376. var self=this,$self=this;
  377. return "Classes";
  378. },
  379. //>>excludeStart("ide", pragmas.excludeIdeData);
  380. args: [],
  381. source: "category\x0a\x09^'Classes'",
  382. referencedClasses: [],
  383. //>>excludeEnd("ide");
  384. messageSends: []
  385. }),
  386. $globals.HLSUnitSelectAllClassesCommand);
  387. $core.addMethod(
  388. $core.method({
  389. selector: "execute",
  390. protocol: "executing",
  391. fn: function (){
  392. var self=this,$self=this;
  393. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  394. return $core.withContext(function($ctx1) {
  395. //>>excludeEnd("ctx");
  396. $recv($self._model())._selectAllClasses();
  397. return self;
  398. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  399. }, function($ctx1) {$ctx1.fill(self,"execute",{},$globals.HLSUnitSelectAllClassesCommand)});
  400. //>>excludeEnd("ctx");
  401. },
  402. //>>excludeStart("ide", pragmas.excludeIdeData);
  403. args: [],
  404. source: "execute\x0a\x09self model selectAllClasses",
  405. referencedClasses: [],
  406. //>>excludeEnd("ide");
  407. messageSends: ["selectAllClasses", "model"]
  408. }),
  409. $globals.HLSUnitSelectAllClassesCommand);
  410. $core.addMethod(
  411. $core.method({
  412. selector: "isActive",
  413. protocol: "testing",
  414. fn: function (){
  415. var self=this,$self=this;
  416. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  417. return $core.withContext(function($ctx1) {
  418. //>>excludeEnd("ctx");
  419. return $recv($recv($self.model)._selectedPackages())._notEmpty();
  420. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  421. }, function($ctx1) {$ctx1.fill(self,"isActive",{},$globals.HLSUnitSelectAllClassesCommand)});
  422. //>>excludeEnd("ctx");
  423. },
  424. //>>excludeStart("ide", pragmas.excludeIdeData);
  425. args: [],
  426. source: "isActive\x0a\x09^model selectedPackages notEmpty",
  427. referencedClasses: [],
  428. //>>excludeEnd("ide");
  429. messageSends: ["notEmpty", "selectedPackages"]
  430. }),
  431. $globals.HLSUnitSelectAllClassesCommand);
  432. $core.addMethod(
  433. $core.method({
  434. selector: "key",
  435. protocol: "accessing",
  436. fn: function (){
  437. var self=this,$self=this;
  438. return "c";
  439. },
  440. //>>excludeStart("ide", pragmas.excludeIdeData);
  441. args: [],
  442. source: "key\x0a\x09^ 'c'",
  443. referencedClasses: [],
  444. //>>excludeEnd("ide");
  445. messageSends: []
  446. }),
  447. $globals.HLSUnitSelectAllClassesCommand.a$cls);
  448. $core.addMethod(
  449. $core.method({
  450. selector: "label",
  451. protocol: "accessing",
  452. fn: function (){
  453. var self=this,$self=this;
  454. return "Select all classes";
  455. },
  456. //>>excludeStart("ide", pragmas.excludeIdeData);
  457. args: [],
  458. source: "label\x0a\x09^ 'Select all classes'",
  459. referencedClasses: [],
  460. //>>excludeEnd("ide");
  461. messageSends: []
  462. }),
  463. $globals.HLSUnitSelectAllClassesCommand.a$cls);
  464. $core.addClass("HLSUnitSelectAllPackagesCommand", $globals.HLSUnitSelectAllCommand, [], "Helios-Commands-SUnit");
  465. //>>excludeStart("ide", pragmas.excludeIdeData);
  466. $globals.HLSUnitSelectAllPackagesCommand.comment="Select all packages with test cases on a `HLSUnitModel`";
  467. //>>excludeEnd("ide");
  468. $core.addMethod(
  469. $core.method({
  470. selector: "category",
  471. protocol: "accessing",
  472. fn: function (){
  473. var self=this,$self=this;
  474. return "Packages";
  475. },
  476. //>>excludeStart("ide", pragmas.excludeIdeData);
  477. args: [],
  478. source: "category\x0a\x09^'Packages'",
  479. referencedClasses: [],
  480. //>>excludeEnd("ide");
  481. messageSends: []
  482. }),
  483. $globals.HLSUnitSelectAllPackagesCommand);
  484. $core.addMethod(
  485. $core.method({
  486. selector: "execute",
  487. protocol: "executing",
  488. fn: function (){
  489. var self=this,$self=this;
  490. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  491. return $core.withContext(function($ctx1) {
  492. //>>excludeEnd("ctx");
  493. $recv($self._model())._selectAllPackages();
  494. return self;
  495. //>>excludeStart("ctx", pragmas.excludeDebugContexts);
  496. }, function($ctx1) {$ctx1.fill(self,"execute",{},$globals.HLSUnitSelectAllPackagesCommand)});
  497. //>>excludeEnd("ctx");
  498. },
  499. //>>excludeStart("ide", pragmas.excludeIdeData);
  500. args: [],
  501. source: "execute\x0a\x09self model selectAllPackages",
  502. referencedClasses: [],
  503. //>>excludeEnd("ide");
  504. messageSends: ["selectAllPackages", "model"]
  505. }),
  506. $globals.HLSUnitSelectAllPackagesCommand);
  507. $core.addMethod(
  508. $core.method({
  509. selector: "isActive",
  510. protocol: "testing",
  511. fn: function (){
  512. var self=this,$self=this;
  513. return true;
  514. },
  515. //>>excludeStart("ide", pragmas.excludeIdeData);
  516. args: [],
  517. source: "isActive\x0a\x09^true",
  518. referencedClasses: [],
  519. //>>excludeEnd("ide");
  520. messageSends: []
  521. }),
  522. $globals.HLSUnitSelectAllPackagesCommand);
  523. $core.addMethod(
  524. $core.method({
  525. selector: "key",
  526. protocol: "accessing",
  527. fn: function (){
  528. var self=this,$self=this;
  529. return "p";
  530. },
  531. //>>excludeStart("ide", pragmas.excludeIdeData);
  532. args: [],
  533. source: "key\x0a\x09^ 'p'",
  534. referencedClasses: [],
  535. //>>excludeEnd("ide");
  536. messageSends: []
  537. }),
  538. $globals.HLSUnitSelectAllPackagesCommand.a$cls);
  539. $core.addMethod(
  540. $core.method({
  541. selector: "label",
  542. protocol: "accessing",
  543. fn: function (){
  544. var self=this,$self=this;
  545. return "Select all packages";
  546. },
  547. //>>excludeStart("ide", pragmas.excludeIdeData);
  548. args: [],
  549. source: "label\x0a\x09^ 'Select all packages'",
  550. referencedClasses: [],
  551. //>>excludeEnd("ide");
  552. messageSends: []
  553. }),
  554. $globals.HLSUnitSelectAllPackagesCommand.a$cls);
  555. });