1
0

Helios-Commands-SUnit.js 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. define("helios/Helios-Commands-SUnit", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "helios/Helios-Commands-Tools"], function(smalltalk,nil,_st, globals){
  2. smalltalk.addPackage('Helios-Commands-SUnit');
  3. smalltalk.packages["Helios-Commands-SUnit"].transport = {"type":"amd","amdNamespace":"helios"};
  4. smalltalk.addClass('HLSUnitCommand', globals.HLToolCommand, [], 'Helios-Commands-SUnit');
  5. globals.HLSUnitCommand.comment="I group the commands pertaining to Helios-SUnit (`HLSUnitModel`)";
  6. smalltalk.addMethod(
  7. smalltalk.method({
  8. selector: "isValidFor:",
  9. protocol: 'testing',
  10. fn: function (aModel){
  11. var self=this;
  12. function $HLSUnitModel(){return globals.HLSUnitModel||(typeof HLSUnitModel=="undefined"?nil:HLSUnitModel)}
  13. return smalltalk.withContext(function($ctx1) {
  14. var $1;
  15. $1=_st(aModel)._isKindOf_($HLSUnitModel());
  16. return $1;
  17. }, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},globals.HLSUnitCommand.klass)})},
  18. args: ["aModel"],
  19. source: "isValidFor: aModel\x0a\x09^ aModel isKindOf: HLSUnitModel",
  20. messageSends: ["isKindOf:"],
  21. referencedClasses: ["HLSUnitModel"]
  22. }),
  23. globals.HLSUnitCommand.klass);
  24. smalltalk.addClass('HLSUnitInvertSelectedCommand', globals.HLSUnitCommand, [], 'Helios-Commands-SUnit');
  25. globals.HLSUnitInvertSelectedCommand.comment="I group the commands that invert selections";
  26. smalltalk.addMethod(
  27. smalltalk.method({
  28. selector: "key",
  29. protocol: 'accessing',
  30. fn: function (){
  31. var self=this;
  32. return "i";
  33. },
  34. args: [],
  35. source: "key\x0a\x09^ 'i'",
  36. messageSends: [],
  37. referencedClasses: []
  38. }),
  39. globals.HLSUnitInvertSelectedCommand.klass);
  40. smalltalk.addMethod(
  41. smalltalk.method({
  42. selector: "label",
  43. protocol: 'accessing',
  44. fn: function (){
  45. var self=this;
  46. return "Invert selection";
  47. },
  48. args: [],
  49. source: "label\x0a\x09^'Invert selection'",
  50. messageSends: [],
  51. referencedClasses: []
  52. }),
  53. globals.HLSUnitInvertSelectedCommand.klass);
  54. smalltalk.addClass('HLSUnitInvertSelectedClassesCommand', globals.HLSUnitInvertSelectedCommand, [], 'Helios-Commands-SUnit');
  55. globals.HLSUnitInvertSelectedClassesCommand.comment="Invert the currently selected classes on a `HLSUnitModel`";
  56. smalltalk.addMethod(
  57. smalltalk.method({
  58. selector: "category",
  59. protocol: 'accessing',
  60. fn: function (){
  61. var self=this;
  62. return "Classes";
  63. },
  64. args: [],
  65. source: "category\x0a\x09^'Classes'",
  66. messageSends: [],
  67. referencedClasses: []
  68. }),
  69. globals.HLSUnitInvertSelectedClassesCommand);
  70. smalltalk.addMethod(
  71. smalltalk.method({
  72. selector: "execute",
  73. protocol: 'executing',
  74. fn: function (){
  75. var self=this;
  76. return smalltalk.withContext(function($ctx1) {
  77. _st(self._model())._invertSelectedClasses();
  78. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLSUnitInvertSelectedClassesCommand)})},
  79. args: [],
  80. source: "execute\x0a\x09self model invertSelectedClasses",
  81. messageSends: ["invertSelectedClasses", "model"],
  82. referencedClasses: []
  83. }),
  84. globals.HLSUnitInvertSelectedClassesCommand);
  85. smalltalk.addMethod(
  86. smalltalk.method({
  87. selector: "isActive",
  88. protocol: 'testing',
  89. fn: function (){
  90. var self=this;
  91. return smalltalk.withContext(function($ctx1) {
  92. var $1;
  93. $1=_st(_st(self["@model"])._selectedPackages())._notEmpty();
  94. return $1;
  95. }, function($ctx1) {$ctx1.fill(self,"isActive",{},globals.HLSUnitInvertSelectedClassesCommand)})},
  96. args: [],
  97. source: "isActive\x0a\x09^model selectedPackages notEmpty",
  98. messageSends: ["notEmpty", "selectedPackages"],
  99. referencedClasses: []
  100. }),
  101. globals.HLSUnitInvertSelectedClassesCommand);
  102. smalltalk.addMethod(
  103. smalltalk.method({
  104. selector: "key",
  105. protocol: 'accessing',
  106. fn: function (){
  107. var self=this;
  108. return "c";
  109. },
  110. args: [],
  111. source: "key\x0a\x09^ 'c'",
  112. messageSends: [],
  113. referencedClasses: []
  114. }),
  115. globals.HLSUnitInvertSelectedClassesCommand.klass);
  116. smalltalk.addMethod(
  117. smalltalk.method({
  118. selector: "label",
  119. protocol: 'accessing',
  120. fn: function (){
  121. var self=this;
  122. return "Invert selected classes";
  123. },
  124. args: [],
  125. source: "label\x0a\x09^ 'Invert selected classes'",
  126. messageSends: [],
  127. referencedClasses: []
  128. }),
  129. globals.HLSUnitInvertSelectedClassesCommand.klass);
  130. smalltalk.addClass('HLSUnitInvertSelectedPackagesCommand', globals.HLSUnitInvertSelectedCommand, [], 'Helios-Commands-SUnit');
  131. globals.HLSUnitInvertSelectedPackagesCommand.comment="Invert the currently selected packages on a `HLSUnitModel`";
  132. smalltalk.addMethod(
  133. smalltalk.method({
  134. selector: "category",
  135. protocol: 'accessing',
  136. fn: function (){
  137. var self=this;
  138. return "Packages";
  139. },
  140. args: [],
  141. source: "category\x0a\x09^'Packages'",
  142. messageSends: [],
  143. referencedClasses: []
  144. }),
  145. globals.HLSUnitInvertSelectedPackagesCommand);
  146. smalltalk.addMethod(
  147. smalltalk.method({
  148. selector: "execute",
  149. protocol: 'executing',
  150. fn: function (){
  151. var self=this;
  152. return smalltalk.withContext(function($ctx1) {
  153. _st(self._model())._invertSelectedPackages();
  154. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLSUnitInvertSelectedPackagesCommand)})},
  155. args: [],
  156. source: "execute\x0a\x09self model invertSelectedPackages",
  157. messageSends: ["invertSelectedPackages", "model"],
  158. referencedClasses: []
  159. }),
  160. globals.HLSUnitInvertSelectedPackagesCommand);
  161. smalltalk.addMethod(
  162. smalltalk.method({
  163. selector: "isActive",
  164. protocol: 'testing',
  165. fn: function (){
  166. var self=this;
  167. return true;
  168. },
  169. args: [],
  170. source: "isActive\x0a\x09^true",
  171. messageSends: [],
  172. referencedClasses: []
  173. }),
  174. globals.HLSUnitInvertSelectedPackagesCommand);
  175. smalltalk.addMethod(
  176. smalltalk.method({
  177. selector: "key",
  178. protocol: 'accessing',
  179. fn: function (){
  180. var self=this;
  181. return "p";
  182. },
  183. args: [],
  184. source: "key\x0a\x09^ 'p'",
  185. messageSends: [],
  186. referencedClasses: []
  187. }),
  188. globals.HLSUnitInvertSelectedPackagesCommand.klass);
  189. smalltalk.addMethod(
  190. smalltalk.method({
  191. selector: "label",
  192. protocol: 'accessing',
  193. fn: function (){
  194. var self=this;
  195. return "Invert selected packages";
  196. },
  197. args: [],
  198. source: "label\x0a\x09^ 'Invert selected packages'",
  199. messageSends: [],
  200. referencedClasses: []
  201. }),
  202. globals.HLSUnitInvertSelectedPackagesCommand.klass);
  203. smalltalk.addClass('HLSUnitRunTests', globals.HLSUnitCommand, [], 'Helios-Commands-SUnit');
  204. globals.HLSUnitRunTests.comment="Run the test cases in the currently selected classes on a `HLSUnitModel`";
  205. smalltalk.addMethod(
  206. smalltalk.method({
  207. selector: "execute",
  208. protocol: 'executing',
  209. fn: function (){
  210. var self=this;
  211. return smalltalk.withContext(function($ctx1) {
  212. _st(self._model())._runTests();
  213. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLSUnitRunTests)})},
  214. args: [],
  215. source: "execute\x0a\x09self model runTests",
  216. messageSends: ["runTests", "model"],
  217. referencedClasses: []
  218. }),
  219. globals.HLSUnitRunTests);
  220. smalltalk.addMethod(
  221. smalltalk.method({
  222. selector: "isActive",
  223. protocol: 'testing',
  224. fn: function (){
  225. var self=this;
  226. return true;
  227. },
  228. args: [],
  229. source: "isActive\x0a\x09^true",
  230. messageSends: [],
  231. referencedClasses: []
  232. }),
  233. globals.HLSUnitRunTests);
  234. smalltalk.addMethod(
  235. smalltalk.method({
  236. selector: "key",
  237. protocol: 'accessing',
  238. fn: function (){
  239. var self=this;
  240. return "r";
  241. },
  242. args: [],
  243. source: "key\x0a\x09^'r'",
  244. messageSends: [],
  245. referencedClasses: []
  246. }),
  247. globals.HLSUnitRunTests.klass);
  248. smalltalk.addMethod(
  249. smalltalk.method({
  250. selector: "label",
  251. protocol: 'accessing',
  252. fn: function (){
  253. var self=this;
  254. return "Run Tests";
  255. },
  256. args: [],
  257. source: "label\x0a\x09^'Run Tests'",
  258. messageSends: [],
  259. referencedClasses: []
  260. }),
  261. globals.HLSUnitRunTests.klass);
  262. smalltalk.addClass('HLSUnitSelectAllCommand', globals.HLSUnitCommand, [], 'Helios-Commands-SUnit');
  263. globals.HLSUnitSelectAllCommand.comment="I group the select all commands";
  264. smalltalk.addMethod(
  265. smalltalk.method({
  266. selector: "key",
  267. protocol: 'accessing',
  268. fn: function (){
  269. var self=this;
  270. return "a";
  271. },
  272. args: [],
  273. source: "key\x0a\x09^ 'a'",
  274. messageSends: [],
  275. referencedClasses: []
  276. }),
  277. globals.HLSUnitSelectAllCommand.klass);
  278. smalltalk.addMethod(
  279. smalltalk.method({
  280. selector: "label",
  281. protocol: 'accessing',
  282. fn: function (){
  283. var self=this;
  284. return "Select all";
  285. },
  286. args: [],
  287. source: "label\x0a\x09^ 'Select all'",
  288. messageSends: [],
  289. referencedClasses: []
  290. }),
  291. globals.HLSUnitSelectAllCommand.klass);
  292. smalltalk.addClass('HLSUnitSelectAllClassesCommand', globals.HLSUnitSelectAllCommand, [], 'Helios-Commands-SUnit');
  293. globals.HLSUnitSelectAllClassesCommand.comment="Select all available test classes based on what packages are selected on a `HLSUnitModel`";
  294. smalltalk.addMethod(
  295. smalltalk.method({
  296. selector: "category",
  297. protocol: 'accessing',
  298. fn: function (){
  299. var self=this;
  300. return "Classes";
  301. },
  302. args: [],
  303. source: "category\x0a\x09^'Classes'",
  304. messageSends: [],
  305. referencedClasses: []
  306. }),
  307. globals.HLSUnitSelectAllClassesCommand);
  308. smalltalk.addMethod(
  309. smalltalk.method({
  310. selector: "execute",
  311. protocol: 'executing',
  312. fn: function (){
  313. var self=this;
  314. return smalltalk.withContext(function($ctx1) {
  315. _st(self._model())._selectAllClasses();
  316. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLSUnitSelectAllClassesCommand)})},
  317. args: [],
  318. source: "execute\x0a\x09self model selectAllClasses",
  319. messageSends: ["selectAllClasses", "model"],
  320. referencedClasses: []
  321. }),
  322. globals.HLSUnitSelectAllClassesCommand);
  323. smalltalk.addMethod(
  324. smalltalk.method({
  325. selector: "isActive",
  326. protocol: 'testing',
  327. fn: function (){
  328. var self=this;
  329. return smalltalk.withContext(function($ctx1) {
  330. var $1;
  331. $1=_st(_st(self["@model"])._selectedPackages())._notEmpty();
  332. return $1;
  333. }, function($ctx1) {$ctx1.fill(self,"isActive",{},globals.HLSUnitSelectAllClassesCommand)})},
  334. args: [],
  335. source: "isActive\x0a\x09^model selectedPackages notEmpty",
  336. messageSends: ["notEmpty", "selectedPackages"],
  337. referencedClasses: []
  338. }),
  339. globals.HLSUnitSelectAllClassesCommand);
  340. smalltalk.addMethod(
  341. smalltalk.method({
  342. selector: "key",
  343. protocol: 'accessing',
  344. fn: function (){
  345. var self=this;
  346. return "c";
  347. },
  348. args: [],
  349. source: "key\x0a\x09^ 'c'",
  350. messageSends: [],
  351. referencedClasses: []
  352. }),
  353. globals.HLSUnitSelectAllClassesCommand.klass);
  354. smalltalk.addMethod(
  355. smalltalk.method({
  356. selector: "label",
  357. protocol: 'accessing',
  358. fn: function (){
  359. var self=this;
  360. return "Select all classes";
  361. },
  362. args: [],
  363. source: "label\x0a\x09^ 'Select all classes'",
  364. messageSends: [],
  365. referencedClasses: []
  366. }),
  367. globals.HLSUnitSelectAllClassesCommand.klass);
  368. smalltalk.addClass('HLSUnitSelectAllPackagesCommand', globals.HLSUnitSelectAllCommand, [], 'Helios-Commands-SUnit');
  369. globals.HLSUnitSelectAllPackagesCommand.comment="Select all packages with test cases on a `HLSUnitModel`";
  370. smalltalk.addMethod(
  371. smalltalk.method({
  372. selector: "category",
  373. protocol: 'accessing',
  374. fn: function (){
  375. var self=this;
  376. return "Packages";
  377. },
  378. args: [],
  379. source: "category\x0a\x09^'Packages'",
  380. messageSends: [],
  381. referencedClasses: []
  382. }),
  383. globals.HLSUnitSelectAllPackagesCommand);
  384. smalltalk.addMethod(
  385. smalltalk.method({
  386. selector: "execute",
  387. protocol: 'executing',
  388. fn: function (){
  389. var self=this;
  390. return smalltalk.withContext(function($ctx1) {
  391. _st(self._model())._selectAllPackages();
  392. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLSUnitSelectAllPackagesCommand)})},
  393. args: [],
  394. source: "execute\x0a\x09self model selectAllPackages",
  395. messageSends: ["selectAllPackages", "model"],
  396. referencedClasses: []
  397. }),
  398. globals.HLSUnitSelectAllPackagesCommand);
  399. smalltalk.addMethod(
  400. smalltalk.method({
  401. selector: "isActive",
  402. protocol: 'testing',
  403. fn: function (){
  404. var self=this;
  405. return true;
  406. },
  407. args: [],
  408. source: "isActive\x0a\x09^true",
  409. messageSends: [],
  410. referencedClasses: []
  411. }),
  412. globals.HLSUnitSelectAllPackagesCommand);
  413. smalltalk.addMethod(
  414. smalltalk.method({
  415. selector: "key",
  416. protocol: 'accessing',
  417. fn: function (){
  418. var self=this;
  419. return "p";
  420. },
  421. args: [],
  422. source: "key\x0a\x09^ 'p'",
  423. messageSends: [],
  424. referencedClasses: []
  425. }),
  426. globals.HLSUnitSelectAllPackagesCommand.klass);
  427. smalltalk.addMethod(
  428. smalltalk.method({
  429. selector: "label",
  430. protocol: 'accessing',
  431. fn: function (){
  432. var self=this;
  433. return "Select all packages";
  434. },
  435. args: [],
  436. source: "label\x0a\x09^ 'Select all packages'",
  437. messageSends: [],
  438. referencedClasses: []
  439. }),
  440. globals.HLSUnitSelectAllPackagesCommand.klass);
  441. });