step4_controller_test.js 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. App = require('app');
  19. require('controllers/main/service/reassign/step4_controller');
  20. describe('App.ReassignMasterWizardStep4Controller', function () {
  21. var controller = App.ReassignMasterWizardStep4Controller.create({
  22. content: Em.Object.create({
  23. reassign: Em.Object.create(),
  24. reassignHosts: Em.Object.create()
  25. })
  26. });
  27. beforeEach(function () {
  28. sinon.stub(App.ajax, 'send', Em.K);
  29. });
  30. afterEach(function () {
  31. App.ajax.send.restore();
  32. });
  33. describe('#setAdditionalConfigs()', function () {
  34. it('Component is absent', function () {
  35. controller.set('additionalConfigsMap', []);
  36. var configs = {};
  37. expect(controller.setAdditionalConfigs(configs, 'COMP1', '')).to.be.false;
  38. expect(configs).to.eql({});
  39. });
  40. it('configs for Hadoop 2 is present', function () {
  41. controller.set('additionalConfigsMap', [
  42. {
  43. componentName: 'COMP1',
  44. configs: {
  45. 'test-site': {
  46. 'property1': '<replace-value>:1111'
  47. }
  48. },
  49. configs_Hadoop2: {
  50. 'test-site': {
  51. 'property2': '<replace-value>:2222'
  52. }
  53. }
  54. }
  55. ]);
  56. var configs = {
  57. 'test-site': {}
  58. };
  59. expect(controller.setAdditionalConfigs(configs, 'COMP1', 'host1')).to.be.true;
  60. expect(configs).to.eql({
  61. 'test-site': {
  62. 'property2': 'host1:2222'
  63. }
  64. });
  65. });
  66. });
  67. describe('#getHostComponentsNames()', function () {
  68. it('No host-components', function () {
  69. controller.set('hostComponents', []);
  70. expect(controller.getHostComponentsNames()).to.be.empty;
  71. });
  72. it('one host-components', function () {
  73. controller.set('hostComponents', ['COMP1']);
  74. expect(controller.getHostComponentsNames()).to.equal('Comp1');
  75. });
  76. it('ZKFC host-components', function () {
  77. controller.set('hostComponents', ['COMP1', 'ZKFC']);
  78. expect(controller.getHostComponentsNames()).to.equal('Comp1+ZKFC');
  79. });
  80. });
  81. describe('#testDBConnection', function() {
  82. beforeEach(function() {
  83. controller.set('requiredProperties', Em.A([]));
  84. controller.set('content.serviceProperties', Em.Object.create({'javax.jdo.option.ConnectionDriverName': 'mysql'}));
  85. controller.set('content.reassign.component_name', 'HIVE_SERVER');
  86. sinon.stub(controller, 'getConnectionProperty', Em.K);
  87. sinon.stub(App.router, 'get', Em.K);
  88. });
  89. afterEach(function() {
  90. controller.getConnectionProperty.restore();
  91. App.router.get.restore();
  92. });
  93. it('tests database connection', function() {
  94. sinon.stub(controller, 'prepareDBCheckAction', Em.K);
  95. controller.testDBConnection();
  96. expect(controller.prepareDBCheckAction.calledOnce).to.be.true;
  97. controller.prepareDBCheckAction.restore();
  98. });
  99. it('tests prepareDBCheckAction', function() {
  100. controller.prepareDBCheckAction();
  101. expect(App.ajax.send.calledOnce).to.be.true;
  102. });
  103. });
  104. describe('#removeUnneededTasks()', function () {
  105. var isHaEnabled = false;
  106. beforeEach(function () {
  107. sinon.stub(App, 'get', function () {
  108. return isHaEnabled;
  109. });
  110. controller.set('tasks', [
  111. {id: 1, command: 'stopServices'},
  112. {id: 2, command: 'cleanMySqlServer'},
  113. {id: 3, command: 'createHostComponents'},
  114. {id: 4, command: 'putHostComponentsInMaintenanceMode'},
  115. {id: 5, command: 'reconfigure'},
  116. {id: 6, command: 'installHostComponents'},
  117. {id: 7, command: 'startZooKeeperServers'},
  118. {id: 8, command: 'startNameNode'},
  119. {id: 9, command: 'deleteHostComponents'},
  120. {id: 10, command: 'configureMySqlServer'},
  121. {id: 11, command: 'startMySqlServer'},
  122. {id: 12, command: 'startServices'}
  123. ]);
  124. });
  125. afterEach(function () {
  126. App.get.restore();
  127. });
  128. it('hasManualSteps is false', function () {
  129. controller.set('content.hasManualSteps', false);
  130. controller.removeUnneededTasks();
  131. expect(controller.get('tasks').mapProperty('id')).to.eql([1,3,4,5,6,9,12]);
  132. });
  133. it('reassign component is not NameNode and HA disabled', function () {
  134. controller.set('content.hasManualSteps', true);
  135. controller.set('content.reassign.component_name', 'COMP1');
  136. isHaEnabled = false;
  137. console.log(controller.get('tasks').mapProperty('id'))
  138. controller.removeUnneededTasks();
  139. console.log(controller.get('tasks').mapProperty('id'))
  140. expect(controller.get('tasks').mapProperty('id')).to.eql([1, 3, 4, 5, 6]);
  141. });
  142. it('reassign component is not NameNode and HA enabled', function () {
  143. controller.set('content.hasManualSteps', true);
  144. controller.set('content.reassign.component_name', 'COMP1');
  145. isHaEnabled = true;
  146. controller.removeUnneededTasks();
  147. expect(controller.get('tasks').mapProperty('id')).to.eql([1, 3, 4, 5, 6]);
  148. });
  149. it('reassign component is NameNode and HA disabled', function () {
  150. controller.set('content.hasManualSteps', true);
  151. controller.set('content.reassign.component_name', 'NAMENODE');
  152. isHaEnabled = false;
  153. controller.removeUnneededTasks();
  154. expect(controller.get('tasks').mapProperty('id')).to.eql([1, 3, 4, 5, 6]);
  155. });
  156. it('reassign component is NameNode and HA enabled', function () {
  157. controller.set('content.hasManualSteps', true);
  158. controller.set('content.reassign.component_name', 'NAMENODE');
  159. isHaEnabled = true;
  160. controller.removeUnneededTasks();
  161. expect(controller.get('tasks').mapProperty('id')).to.eql([1, 3, 4, 5, 6, 7, 8]);
  162. });
  163. it('reassign component is HiveServer and db type is mysql', function () {
  164. controller.set('content.hasManualSteps', false);
  165. controller.set('content.databaseType', 'mysql');
  166. controller.set('content.reassign.component_name', 'HIVE_SERVER');
  167. isHaEnabled = false;
  168. controller.removeUnneededTasks();
  169. expect(controller.get('tasks').mapProperty('id')).to.eql([1, 2, 3, 4, 5, 6, 9, 10, 11, 12]);
  170. });
  171. it('reassign component is HiveServer and db type is not mysql', function () {
  172. controller.set('content.hasManualSteps', false);
  173. controller.set('content.databaseType', 'derby');
  174. controller.set('content.reassign.component_name', 'HIVE_SERVER');
  175. isHaEnabled = false;
  176. controller.removeUnneededTasks();
  177. expect(controller.get('tasks').mapProperty('id')).to.eql([1, 3, 4, 5, 6, 9, 12]);
  178. });
  179. it('reassign component is Oozie Server and db type is derby', function () {
  180. controller.set('content.hasManualSteps', true);
  181. controller.set('content.databaseType', 'derby');
  182. controller.set('content.reassign.component_name', 'OOZIE_SERVER');
  183. isHaEnabled = false;
  184. controller.removeUnneededTasks();
  185. expect(controller.get('tasks').mapProperty('id')).to.eql([1,3,4,5,6]);
  186. });
  187. it('reassign component is Oozie Server and db type is mysql', function () {
  188. controller.set('content.hasManualSteps', false);
  189. controller.set('content.databaseType', 'mysql');
  190. controller.set('content.reassign.component_name', 'OOZIE_SERVER');
  191. isHaEnabled = false;
  192. controller.removeUnneededTasks();
  193. expect(controller.get('tasks').mapProperty('id')).to.eql([1,2,3,4,5,6,9,10,11,12]);
  194. });
  195. });
  196. describe('#initializeTasks()', function () {
  197. beforeEach(function () {
  198. controller.set('tasks', []);
  199. sinon.stub(controller, 'getHostComponentsNames', Em.K);
  200. sinon.stub(controller, 'removeUnneededTasks', Em.K);
  201. });
  202. afterEach(function () {
  203. controller.removeUnneededTasks.restore();
  204. controller.getHostComponentsNames.restore();
  205. });
  206. it('No commands', function () {
  207. controller.set('commands', []);
  208. controller.set('commandsForDB', []);
  209. controller.initializeTasks();
  210. expect(controller.get('tasks')).to.be.empty;
  211. });
  212. it('One command', function () {
  213. controller.set('commands', ['COMMAND1']);
  214. controller.set('commandsForDB', ['COMMAND1']);
  215. controller.initializeTasks();
  216. expect(controller.get('tasks')[0].get('id')).to.equal(0);
  217. expect(controller.get('tasks')[0].get('command')).to.equal('COMMAND1');
  218. });
  219. });
  220. describe('#hideRollbackButton()', function () {
  221. it('No showRollback command', function () {
  222. controller.set('tasks', [Em.Object.create({
  223. showRollback: false
  224. })]);
  225. controller.hideRollbackButton();
  226. expect(controller.get('tasks')[0].get('showRollback')).to.be.false;
  227. });
  228. it('showRollback command is present', function () {
  229. controller.set('tasks', [Em.Object.create({
  230. showRollback: true
  231. })]);
  232. controller.hideRollbackButton();
  233. expect(controller.get('tasks')[0].get('showRollback')).to.be.false;
  234. });
  235. });
  236. describe('#onComponentsTasksSuccess()', function () {
  237. beforeEach(function () {
  238. sinon.stub(controller, 'onTaskCompleted', Em.K);
  239. });
  240. afterEach(function () {
  241. controller.onTaskCompleted.restore();
  242. });
  243. it('No host-components', function () {
  244. controller.set('multiTaskCounter', 0);
  245. controller.set('hostComponents', []);
  246. controller.onComponentsTasksSuccess();
  247. expect(controller.get('multiTaskCounter')).to.equal(1);
  248. expect(controller.onTaskCompleted.calledOnce).to.be.true;
  249. });
  250. it('One host-component', function () {
  251. controller.set('multiTaskCounter', 0);
  252. controller.set('hostComponents', [
  253. {}
  254. ]);
  255. controller.onComponentsTasksSuccess();
  256. expect(controller.get('multiTaskCounter')).to.equal(1);
  257. expect(controller.onTaskCompleted.calledOnce).to.be.true;
  258. });
  259. it('two host-components', function () {
  260. controller.set('multiTaskCounter', 0);
  261. controller.set('hostComponents', [
  262. {},
  263. {}
  264. ]);
  265. controller.onComponentsTasksSuccess();
  266. expect(controller.get('multiTaskCounter')).to.equal(1);
  267. expect(controller.onTaskCompleted.called).to.be.false;
  268. });
  269. });
  270. describe('#getStopServicesData()', function () {
  271. it('restarting YARN component', function () {
  272. controller.set('content.reassign.component_name', 'RESOURCEMANAGER');
  273. sinon.stub(App.Service, 'find', function () {
  274. return [
  275. {
  276. serviceName: 'HDFS'
  277. },
  278. {
  279. serviceName: 'SERVICE1'
  280. }
  281. ];
  282. });
  283. expect(controller.getStopServicesData()).to.eql({
  284. "ServiceInfo": {
  285. "state": "INSTALLED"
  286. },
  287. "context": "Stop required services",
  288. "urlParams": "ServiceInfo/service_name.in(SERVICE1)"
  289. });
  290. App.Service.find.restore();
  291. });
  292. it('restarting non-YARN component', function () {
  293. controller.set('content.reassign.component_name', 'NAMENODE');
  294. expect(controller.getStopServicesData()).to.eql({
  295. "ServiceInfo": {
  296. "state": "INSTALLED"
  297. },
  298. "context": "Stop all services"
  299. });
  300. });
  301. });
  302. describe('#stopServices()', function () {
  303. it('', function () {
  304. sinon.stub(controller, 'getStopServicesData', Em.K);
  305. controller.stopServices();
  306. expect(App.ajax.send.calledOnce).to.be.true;
  307. expect(controller.getStopServicesData.calledOnce).to.be.true;
  308. controller.getStopServicesData.restore();
  309. });
  310. });
  311. describe('#createHostComponents()', function () {
  312. beforeEach(function () {
  313. sinon.stub(controller, 'createComponent', Em.K);
  314. });
  315. afterEach(function () {
  316. controller.createComponent.restore();
  317. });
  318. it('No host-components', function () {
  319. controller.set('hostComponents', []);
  320. controller.createHostComponents();
  321. expect(controller.get('multiTaskCounter')).to.equal(0);
  322. expect(controller.createComponent.called).to.be.false;
  323. });
  324. it('One host-component', function () {
  325. controller.set('hostComponents', ['COMP1']);
  326. controller.set('content.reassignHosts.target', 'host1');
  327. controller.set('content.reassign.service_id', 'SERVICE1');
  328. controller.createHostComponents();
  329. expect(controller.get('multiTaskCounter')).to.equal(0);
  330. expect(controller.createComponent.calledWith('COMP1', 'host1', 'SERVICE1')).to.be.true;
  331. });
  332. });
  333. describe('#onCreateComponent()', function () {
  334. it('', function () {
  335. sinon.stub(controller, 'onComponentsTasksSuccess', Em.K);
  336. controller.onCreateComponent();
  337. expect(controller.onComponentsTasksSuccess.calledOnce).to.be.true;
  338. controller.onComponentsTasksSuccess.restore();
  339. });
  340. });
  341. describe('#putHostComponentsInMaintenanceMode()', function () {
  342. beforeEach(function(){
  343. sinon.stub(controller, 'onComponentsTasksSuccess', Em.K);
  344. controller.set('content.reassignHosts.source', 'source');
  345. });
  346. afterEach(function(){
  347. controller.onComponentsTasksSuccess.restore();
  348. });
  349. it('No host-components', function () {
  350. controller.set('hostComponents', []);
  351. controller.putHostComponentsInMaintenanceMode();
  352. expect(App.ajax.send.called).to.be.false;
  353. expect(controller.get('multiTaskCounter')).to.equal(0);
  354. });
  355. it('One host-components', function () {
  356. controller.set('hostComponents', [{}]);
  357. controller.putHostComponentsInMaintenanceMode();
  358. expect(App.ajax.send.calledOnce).to.be.true;
  359. expect(controller.get('multiTaskCounter')).to.equal(0);
  360. });
  361. });
  362. describe('#installHostComponents()', function () {
  363. beforeEach(function () {
  364. sinon.stub(controller, 'updateComponent', Em.K);
  365. });
  366. afterEach(function () {
  367. controller.updateComponent.restore();
  368. });
  369. it('No host-components', function () {
  370. controller.set('hostComponents', []);
  371. controller.installHostComponents();
  372. expect(controller.get('multiTaskCounter')).to.equal(0);
  373. expect(controller.updateComponent.called).to.be.false;
  374. });
  375. it('One host-component', function () {
  376. controller.set('hostComponents', ['COMP1']);
  377. controller.set('content.reassignHosts.target', 'host1');
  378. controller.set('content.reassign.service_id', 'SERVICE1');
  379. controller.installHostComponents();
  380. expect(controller.get('multiTaskCounter')).to.equal(0);
  381. expect(controller.updateComponent.calledWith('COMP1', 'host1', 'SERVICE1', 'Install', 1)).to.be.true;
  382. });
  383. });
  384. describe('#reconfigure()', function () {
  385. it('', function () {
  386. sinon.stub(controller, 'loadConfigsTags', Em.K);
  387. controller.reconfigure();
  388. expect(controller.loadConfigsTags.calledOnce).to.be.true;
  389. controller.loadConfigsTags.restore();
  390. });
  391. });
  392. describe('#loadConfigsTags()', function () {
  393. it('', function () {
  394. controller.loadConfigsTags();
  395. expect(App.ajax.send.calledOnce).to.be.true;
  396. });
  397. });
  398. describe('#getConfigUrlParams()', function () {
  399. var testCases = [
  400. {
  401. componentName: 'NAMENODE',
  402. result: [
  403. "(type=hdfs-site&tag=1)",
  404. "(type=core-site&tag=2)"
  405. ]
  406. },
  407. {
  408. componentName: 'SECONDARY_NAMENODE',
  409. result: [
  410. "(type=hdfs-site&tag=1)",
  411. "(type=core-site&tag=2)"
  412. ]
  413. },
  414. {
  415. componentName: 'JOBTRACKER',
  416. result: [
  417. "(type=mapred-site&tag=4)"
  418. ]
  419. },
  420. {
  421. componentName: 'RESOURCEMANAGER',
  422. result: [
  423. "(type=yarn-site&tag=5)"
  424. ]
  425. },
  426. {
  427. componentName: 'APP_TIMELINE_SERVER',
  428. result: [
  429. "(type=yarn-site&tag=5)",
  430. "(type=yarn-env&tag=8)",
  431. ]
  432. },
  433. {
  434. componentName: 'OOZIE_SERVER',
  435. result: [
  436. "(type=oozie-site&tag=6)",
  437. "(type=core-site&tag=2)"
  438. ]
  439. },
  440. {
  441. componentName: 'WEBHCAT_SERVER',
  442. result: [
  443. "(type=webhcat-site&tag=7)"
  444. ]
  445. }
  446. ];
  447. var data = {
  448. Clusters: {
  449. desired_configs: {
  450. 'hdfs-site': {tag: 1},
  451. 'core-site': {tag: 2},
  452. 'hbase-site': {tag: 3},
  453. 'mapred-site': {tag: 4},
  454. 'yarn-site': {tag: 5},
  455. 'oozie-site': {tag: 6},
  456. 'webhcat-site': {tag: 7},
  457. 'yarn-env': {tag: 8}
  458. }
  459. }
  460. };
  461. var services = [];
  462. beforeEach(function () {
  463. sinon.stub(App.Service, 'find', function () {
  464. return services;
  465. })
  466. });
  467. afterEach(function () {
  468. App.Service.find.restore();
  469. });
  470. testCases.forEach(function (test) {
  471. it('get config of ' + test.componentName, function () {
  472. expect(controller.getConfigUrlParams(test.componentName, data)).to.eql(test.result);
  473. })
  474. });
  475. it('get config of NAMENODE when HBASE installed', function () {
  476. services = [
  477. {
  478. serviceName: 'HBASE'
  479. }
  480. ];
  481. expect(controller.getConfigUrlParams('NAMENODE', data)).to.eql([
  482. "(type=hdfs-site&tag=1)",
  483. "(type=core-site&tag=2)",
  484. "(type=hbase-site&tag=3)"
  485. ]);
  486. })
  487. });
  488. describe('#onLoadConfigsTags()', function () {
  489. it('', function () {
  490. sinon.stub(controller, 'getConfigUrlParams', function () {
  491. return [];
  492. });
  493. controller.set('content.reassign.component_name', 'COMP1');
  494. controller.onLoadConfigsTags({});
  495. expect(App.ajax.send.calledOnce).to.be.true;
  496. expect(controller.getConfigUrlParams.calledWith('COMP1', {})).to.be.true;
  497. controller.getConfigUrlParams.restore();
  498. });
  499. });
  500. describe('#onLoadConfigs()', function () {
  501. beforeEach(function () {
  502. sinon.stub(controller, 'setAdditionalConfigs', Em.K);
  503. sinon.stub(controller, 'setSecureConfigs', Em.K);
  504. sinon.stub(controller, 'setSpecificNamenodeConfigs', Em.K);
  505. sinon.stub(controller, 'setSpecificResourceMangerConfigs', Em.K);
  506. sinon.stub(controller, 'getComponentDir', Em.K);
  507. sinon.stub(controller, 'saveClusterStatus', Em.K);
  508. sinon.stub(controller, 'saveConfigsToServer', Em.K);
  509. sinon.stub(controller, 'saveServiceProperties', Em.K);
  510. controller.set('content.reassignHosts.target', 'host1');
  511. });
  512. afterEach(function () {
  513. controller.setAdditionalConfigs.restore();
  514. controller.setSecureConfigs.restore();
  515. controller.setSpecificNamenodeConfigs.restore();
  516. controller.setSpecificResourceMangerConfigs.restore();
  517. controller.getComponentDir.restore();
  518. controller.saveClusterStatus.restore();
  519. controller.saveConfigsToServer.restore();
  520. controller.saveServiceProperties.restore();
  521. });
  522. it('component is not NAMENODE', function () {
  523. controller.set('content.reassign.component_name', 'COMP1');
  524. controller.onLoadConfigs({items: []});
  525. expect(controller.setAdditionalConfigs.calledWith({}, 'COMP1', 'host1')).to.be.true;
  526. expect(controller.setSecureConfigs.calledWith([], {}, 'COMP1')).to.be.true;
  527. expect(controller.setSpecificNamenodeConfigs.called).to.be.false;
  528. expect(controller.getComponentDir.calledWith({}, 'COMP1')).to.be.true;
  529. expect(controller.saveClusterStatus.calledWith([])).to.be.true;
  530. expect(controller.saveConfigsToServer.calledWith({})).to.be.true;
  531. expect(controller.saveServiceProperties.calledWith({})).to.be.true;
  532. });
  533. it('component is NAMENODE, has configs', function () {
  534. controller.set('content.reassign.component_name', 'NAMENODE');
  535. controller.onLoadConfigs({items: [
  536. {
  537. type: 'hdfs-site',
  538. properties: {}
  539. }
  540. ]});
  541. expect(controller.setAdditionalConfigs.calledWith({'hdfs-site': {}}, 'NAMENODE', 'host1')).to.be.true;
  542. expect(controller.setSecureConfigs.calledWith([], {'hdfs-site': {}}, 'NAMENODE')).to.be.true;
  543. expect(controller.setSpecificNamenodeConfigs.calledWith({'hdfs-site': {}}, 'host1')).to.be.true;
  544. expect(controller.getComponentDir.calledWith({'hdfs-site': {}}, 'NAMENODE')).to.be.true;
  545. expect(controller.saveClusterStatus.calledWith([])).to.be.true;
  546. expect(controller.saveConfigsToServer.calledWith({'hdfs-site': {}})).to.be.true;
  547. expect(controller.saveServiceProperties.calledWith({'hdfs-site': {}})).to.be.true;
  548. });
  549. it('component is RESOURCEMANAGER, has configs', function () {
  550. controller.set('content.reassign.component_name', 'RESOURCEMANAGER');
  551. controller.onLoadConfigs({items: [
  552. {
  553. type: 'hdfs-site',
  554. properties: {}
  555. }
  556. ]});
  557. expect(controller.setAdditionalConfigs.calledWith({'hdfs-site': {}}, 'RESOURCEMANAGER', 'host1')).to.be.true;
  558. expect(controller.setSecureConfigs.calledWith([], {'hdfs-site': {}}, 'RESOURCEMANAGER')).to.be.true;
  559. expect(controller.setSpecificResourceMangerConfigs.calledWith({'hdfs-site': {}}, 'host1')).to.be.true;
  560. expect(controller.getComponentDir.calledWith({'hdfs-site': {}}, 'RESOURCEMANAGER')).to.be.true;
  561. expect(controller.saveClusterStatus.calledWith([])).to.be.true;
  562. expect(controller.saveConfigsToServer.calledWith({'hdfs-site': {}})).to.be.true;
  563. expect(controller.saveServiceProperties.calledWith({'hdfs-site': {}})).to.be.true;
  564. });
  565. });
  566. describe('#loadStep()', function () {
  567. var isHaEnabled = true;
  568. beforeEach(function () {
  569. controller.set('content.reassign.service_id', 'service1');
  570. sinon.stub(controller, 'onTaskStatusChange', Em.K);
  571. sinon.stub(controller, 'initializeTasks', Em.K);
  572. sinon.stub(App, 'get', function () {
  573. return isHaEnabled;
  574. });
  575. });
  576. afterEach(function () {
  577. controller.onTaskStatusChange.restore();
  578. controller.initializeTasks.restore();
  579. App.get.restore();
  580. });
  581. it('reassign component is NameNode and HA enabled', function () {
  582. isHaEnabled = true;
  583. controller.set('content.reassign.component_name', 'NAMENODE');
  584. controller.loadStep();
  585. expect(controller.get('hostComponents')).to.eql(['NAMENODE', 'ZKFC']);
  586. expect(controller.get('serviceName')).to.eql(['service1']);
  587. });
  588. it('reassign component is NameNode and HA disabled', function () {
  589. isHaEnabled = false;
  590. controller.set('content.reassign.component_name', 'NAMENODE');
  591. controller.loadStep();
  592. expect(controller.get('hostComponents')).to.eql(['NAMENODE']);
  593. expect(controller.get('serviceName')).to.eql(['service1']);
  594. });
  595. it('reassign component is JOBTRACKER and HA enabled', function () {
  596. isHaEnabled = true;
  597. controller.set('content.reassign.component_name', 'JOBTRACKER');
  598. controller.loadStep();
  599. expect(controller.get('hostComponents')).to.eql(['JOBTRACKER']);
  600. expect(controller.get('serviceName')).to.eql(['service1']);
  601. });
  602. it('reassign component is RESOURCEMANAGER and HA enabled', function () {
  603. isHaEnabled = true;
  604. controller.set('content.reassign.component_name', 'RESOURCEMANAGER');
  605. controller.loadStep();
  606. expect(controller.get('hostComponents')).to.eql(['RESOURCEMANAGER']);
  607. expect(controller.get('serviceName')).to.eql(['service1']);
  608. });
  609. });
  610. describe('#saveConfigsToServer()', function () {
  611. beforeEach(function () {
  612. sinon.stub(controller, 'getServiceConfigData', Em.K);
  613. });
  614. afterEach(function () {
  615. controller.getServiceConfigData.restore();
  616. });
  617. it('', function () {
  618. controller.saveConfigsToServer([1]);
  619. expect(controller.getServiceConfigData.calledWith([1])).to.be.true;
  620. expect(App.ajax.send.calledOnce).to.be.true;
  621. });
  622. });
  623. describe('#setSpecificNamenodeConfigs()', function () {
  624. var isHaEnabled = false;
  625. var service = Em.Object.create();
  626. beforeEach(function () {
  627. sinon.stub(App, 'get', function () {
  628. return isHaEnabled;
  629. });
  630. sinon.stub(App.Service, 'find', function () {
  631. return service;
  632. });
  633. controller.set('content.reassignHosts.source', 'host1');
  634. });
  635. afterEach(function () {
  636. App.get.restore();
  637. App.Service.find.restore();
  638. });
  639. it('HA isn\'t enabled and no HBASE service', function () {
  640. isHaEnabled = false;
  641. var configs = {};
  642. controller.setSpecificNamenodeConfigs(configs, 'host1');
  643. expect(configs).to.eql({});
  644. });
  645. it('HA isn\'t enabled and HBASE service', function () {
  646. isHaEnabled = false;
  647. service = Em.Object.create({
  648. isLoaded: true
  649. });
  650. var configs = {
  651. 'hbase-site': {
  652. 'hbase.rootdir': 'hdfs://localhost:8020/apps/hbase/data'
  653. }
  654. };
  655. controller.setSpecificNamenodeConfigs(configs, 'host1');
  656. expect(configs['hbase-site']['hbase.rootdir']).to.equal('hdfs://host1:8020/apps/hbase/data');
  657. });
  658. it('HA enabled and namenode 1', function () {
  659. isHaEnabled = true;
  660. var configs = {
  661. 'hdfs-site': {
  662. 'dfs.nameservices': 's',
  663. 'dfs.namenode.http-address.s.nn1': 'host1:50070',
  664. 'dfs.namenode.https-address.s.nn1': '',
  665. 'dfs.namenode.rpc-address.s.nn1': ''
  666. }
  667. };
  668. controller.setSpecificNamenodeConfigs(configs, 'host2');
  669. expect(configs['hdfs-site']).to.eql({
  670. "dfs.nameservices": "s",
  671. "dfs.namenode.http-address.s.nn1": "host2:50070",
  672. "dfs.namenode.https-address.s.nn1": "host2:50470",
  673. "dfs.namenode.rpc-address.s.nn1": "host2:8020"
  674. });
  675. });
  676. it('HA enabled and namenode 2', function () {
  677. isHaEnabled = true;
  678. var configs = {
  679. 'hdfs-site': {
  680. 'dfs.nameservices': 's',
  681. 'dfs.namenode.http-address.s.nn2': 'host2:50070',
  682. 'dfs.namenode.https-address.s.nn2': '',
  683. 'dfs.namenode.rpc-address.s.nn2': ''
  684. }
  685. };
  686. controller.setSpecificNamenodeConfigs(configs, 'host1');
  687. expect(configs['hdfs-site']).to.eql({
  688. "dfs.nameservices": "s",
  689. "dfs.namenode.http-address.s.nn2": "host1:50070",
  690. "dfs.namenode.https-address.s.nn2": "host1:50470",
  691. "dfs.namenode.rpc-address.s.nn2": "host1:8020"
  692. });
  693. });
  694. });
  695. describe('#setSpecificResourceMangerConfigs()', function () {
  696. var isRMHaEnabled = false;
  697. var service = Em.Object.create();
  698. beforeEach(function () {
  699. sinon.stub(App, 'get', function () {
  700. return isRMHaEnabled;
  701. });
  702. controller.set('content.reassignHosts.source', 'host1');
  703. });
  704. afterEach(function () {
  705. App.get.restore();
  706. });
  707. it('HA isn\'t enabled', function () {
  708. isRMHaEnabled = false;
  709. var configs = {};
  710. controller.setSpecificResourceMangerConfigs(configs, 'host1');
  711. expect(configs).to.eql({});
  712. });
  713. it('HA enabled and resource manager 1', function () {
  714. isRMHaEnabled = true;
  715. var configs = {
  716. 'yarn-site': {
  717. 'yarn.resourcemanager.hostname.rm1': 'host1'
  718. }
  719. };
  720. controller.setSpecificResourceMangerConfigs(configs, 'host2');
  721. expect(configs['yarn-site']).to.eql({
  722. 'yarn.resourcemanager.hostname.rm1': 'host2'
  723. });
  724. });
  725. it('HA enabled and resource manager 2', function () {
  726. isRMHaEnabled = true;
  727. var configs = {
  728. 'yarn-site': {
  729. 'yarn.resourcemanager.hostname.rm2': 'host2'
  730. }
  731. };
  732. controller.setSpecificResourceMangerConfigs(configs, 'host1');
  733. expect(configs['yarn-site']).to.eql({
  734. 'yarn.resourcemanager.hostname.rm2': 'host1'
  735. });
  736. });
  737. });
  738. describe('#setSecureConfigs()', function () {
  739. it('undefined component and security disabled', function () {
  740. var secureConfigs = [];
  741. controller.set('content.securityEnabled', false);
  742. controller.set('secureConfigsMap', []);
  743. expect(controller.setSecureConfigs(secureConfigs, {}, 'COMP1')).to.be.false;
  744. expect(secureConfigs).to.eql([]);
  745. });
  746. it('undefined component and security enabled', function () {
  747. var secureConfigs = [];
  748. controller.set('content.securityEnabled', true);
  749. controller.set('secureConfigsMap', []);
  750. expect(controller.setSecureConfigs(secureConfigs, {}, 'COMP1')).to.be.false;
  751. expect(secureConfigs).to.eql([]);
  752. });
  753. it('component exist and security disabled', function () {
  754. var secureConfigs = [];
  755. controller.set('content.securityEnabled', false);
  756. controller.set('secureConfigsMap', [{
  757. componentName: 'COMP1'
  758. }]);
  759. expect(controller.setSecureConfigs(secureConfigs, {}, 'COMP1')).to.be.false;
  760. expect(secureConfigs).to.eql([]);
  761. });
  762. it('component exist and security enabled', function () {
  763. var secureConfigs = [];
  764. var configs = {'s1': {
  765. 'k1': 'kValue',
  766. 'p1': 'pValue'
  767. }};
  768. controller.set('content.securityEnabled', true);
  769. controller.set('secureConfigsMap', [{
  770. componentName: 'COMP1',
  771. configs: [{
  772. site: 's1',
  773. keytab: 'k1',
  774. principal: 'p1'
  775. }]
  776. }]);
  777. expect(controller.setSecureConfigs(secureConfigs, configs, 'COMP1')).to.be.true;
  778. expect(secureConfigs).to.eql([
  779. {
  780. "keytab": "kValue",
  781. "principal": "pValue"
  782. }
  783. ]);
  784. });
  785. });
  786. describe('#getComponentDir()', function () {
  787. var configs = {
  788. 'hdfs-site': {
  789. 'dfs.name.dir': 'case1',
  790. 'dfs.namenode.name.dir': 'case2',
  791. 'dfs.namenode.checkpoint.dir': 'case3'
  792. },
  793. 'core-site': {
  794. 'fs.checkpoint.dir': 'case4'
  795. }
  796. };
  797. it('unknown component name', function () {
  798. expect(controller.getComponentDir(configs, 'COMP1')).to.be.empty;
  799. });
  800. it('NAMENODE component', function () {
  801. expect(controller.getComponentDir(configs, 'NAMENODE')).to.equal('case2');
  802. });
  803. it('SECONDARY_NAMENODE component', function () {
  804. expect(controller.getComponentDir(configs, 'SECONDARY_NAMENODE')).to.equal('case3');
  805. });
  806. });
  807. describe('#saveClusterStatus()', function () {
  808. var mock = {
  809. saveComponentDir: Em.K,
  810. saveSecureConfigs: Em.K
  811. };
  812. beforeEach(function () {
  813. sinon.stub(App.clusterStatus, 'setClusterStatus', Em.K);
  814. sinon.stub(App.router, 'get', function() {
  815. return mock;
  816. });
  817. sinon.spy(mock, 'saveComponentDir');
  818. sinon.spy(mock, 'saveSecureConfigs');
  819. });
  820. afterEach(function () {
  821. App.clusterStatus.setClusterStatus.restore();
  822. App.router.get.restore();
  823. mock.saveSecureConfigs.restore();
  824. mock.saveComponentDir.restore();
  825. });
  826. it('componentDir undefined and secureConfigs is empty', function () {
  827. expect(controller.saveClusterStatus([], null)).to.be.false;
  828. });
  829. it('componentDir defined and secureConfigs is empty', function () {
  830. expect(controller.saveClusterStatus([], 'dir1')).to.be.true;
  831. expect(mock.saveComponentDir.calledWith('dir1')).to.be.true;
  832. expect(mock.saveSecureConfigs.calledWith([])).to.be.true;
  833. });
  834. it('componentDir undefined and secureConfigs has data', function () {
  835. expect(controller.saveClusterStatus([1], null)).to.be.true;
  836. expect(mock.saveComponentDir.calledWith(null)).to.be.true;
  837. expect(mock.saveSecureConfigs.calledWith([1])).to.be.true;
  838. });
  839. it('componentDir defined and secureConfigs has data', function () {
  840. expect(controller.saveClusterStatus([1], 'dir1')).to.be.true;
  841. expect(mock.saveComponentDir.calledWith('dir1')).to.be.true;
  842. expect(mock.saveSecureConfigs.calledWith([1])).to.be.true;
  843. });
  844. });
  845. describe('#onSaveConfigs()', function () {
  846. beforeEach(function () {
  847. sinon.stub(controller, 'onTaskCompleted', Em.K);
  848. });
  849. afterEach(function () {
  850. controller.onTaskCompleted.restore();
  851. });
  852. it('', function () {
  853. controller.onSaveConfigs();
  854. expect(controller.onTaskCompleted.calledOnce).to.be.true;
  855. });
  856. });
  857. describe('#startZooKeeperServers()', function () {
  858. beforeEach(function () {
  859. sinon.stub(controller, 'updateComponent', Em.K);
  860. });
  861. afterEach(function () {
  862. controller.updateComponent.restore();
  863. });
  864. it('', function () {
  865. controller.set('content.masterComponentHosts', [{
  866. component: 'ZOOKEEPER_SERVER',
  867. hostName: 'host1'
  868. }]);
  869. controller.startZooKeeperServers();
  870. expect(controller.updateComponent.calledWith('ZOOKEEPER_SERVER', ['host1'], 'ZOOKEEPER', 'Start')).to.be.true;
  871. });
  872. });
  873. describe('#startNameNode()', function () {
  874. beforeEach(function () {
  875. sinon.stub(controller, 'updateComponent', Em.K);
  876. });
  877. afterEach(function () {
  878. controller.updateComponent.restore();
  879. });
  880. it('reassign host does not match current', function () {
  881. controller.set('content.masterComponentHosts', [{
  882. component: 'NAMENODE',
  883. hostName: 'host1'
  884. }]);
  885. controller.set('content.reassignHosts.source', 'host2');
  886. controller.startNameNode();
  887. expect(controller.updateComponent.calledWith('NAMENODE', ['host1'], 'HDFS', 'Start')).to.be.true;
  888. });
  889. it('reassign host matches current', function () {
  890. controller.set('content.masterComponentHosts', [{
  891. component: 'NAMENODE',
  892. hostName: 'host1'
  893. }]);
  894. controller.set('content.reassignHosts.source', 'host1');
  895. controller.startNameNode();
  896. expect(controller.updateComponent.calledWith('NAMENODE', [], 'HDFS', 'Start')).to.be.true;
  897. });
  898. });
  899. describe('#startServices()', function () {
  900. beforeEach(function () {
  901. sinon.stub(controller, 'getStartServicesData', Em.K);
  902. });
  903. afterEach(function () {
  904. controller.getStartServicesData.restore();
  905. });
  906. it('', function () {
  907. controller.startServices();
  908. expect(controller.getStartServicesData.calledOnce).to.be.true;
  909. expect(App.ajax.send.calledOnce).to.be.true;
  910. });
  911. });
  912. describe('#getStartServicesData()', function () {
  913. beforeEach(function () {
  914. sinon.stub(App.Service, 'find', function () {
  915. return [
  916. {serviceName: 'SERVICE1'},
  917. {serviceName: 'SERVICE2'}
  918. ]
  919. })
  920. });
  921. afterEach(function () {
  922. App.Service.find.restore();
  923. });
  924. it('No unrelated services', function () {
  925. controller.set('unrelatedServicesMap', {
  926. 'COMP1': ['SERVICE1']
  927. });
  928. controller.set('content.reassign.component_name', 'COMP2');
  929. expect(controller.getStartServicesData()).to.eql({
  930. "context": "Start all services",
  931. "ServiceInfo": {
  932. "state": "STARTED"
  933. },
  934. "urlParams": "params/run_smoke_test=true"
  935. });
  936. });
  937. it('Present unrelated services', function () {
  938. controller.set('unrelatedServicesMap', {
  939. 'COMP1': ['SERVICE1']
  940. });
  941. controller.set('content.reassign.component_name', 'COMP1');
  942. expect(controller.getStartServicesData()).to.eql({
  943. "context": "Start required services",
  944. "ServiceInfo": {
  945. "state": "STARTED"
  946. },
  947. "urlParams": "ServiceInfo/service_name.in(SERVICE2)"
  948. });
  949. });
  950. });
  951. describe('#deleteHostComponents()', function () {
  952. it('No host components', function () {
  953. controller.set('hostComponents', []);
  954. controller.set('content.reassignHosts.source', 'host1');
  955. controller.deleteHostComponents();
  956. expect(App.ajax.send.called).to.be.false;
  957. });
  958. it('delete two components', function () {
  959. controller.set('hostComponents', [1, 2]);
  960. controller.set('content.reassignHosts.source', 'host1');
  961. controller.deleteHostComponents();
  962. expect(App.ajax.send.getCall(0).args[0].data).to.eql({
  963. "hostName": "host1",
  964. "componentName": 1
  965. });
  966. expect(App.ajax.send.getCall(1).args[0].data).to.eql({
  967. "hostName": "host1",
  968. "componentName": 2
  969. });
  970. });
  971. });
  972. describe('#onDeleteHostComponentsError()', function () {
  973. beforeEach(function () {
  974. sinon.stub(controller, 'onComponentsTasksSuccess', Em.K);
  975. sinon.stub(controller, 'onTaskError', Em.K);
  976. });
  977. afterEach(function () {
  978. controller.onComponentsTasksSuccess.restore();
  979. controller.onTaskError.restore();
  980. });
  981. it('task success', function () {
  982. var error = {
  983. responseText: 'org.apache.ambari.server.controller.spi.NoSuchResourceException'
  984. }
  985. controller.onDeleteHostComponentsError(error);
  986. expect(controller.onComponentsTasksSuccess.calledOnce).to.be.true;
  987. });
  988. it('unknown error', function () {
  989. var error = {
  990. responseText: ''
  991. }
  992. controller.onDeleteHostComponentsError(error);
  993. expect(controller.onTaskError.calledOnce).to.be.true;
  994. });
  995. });
  996. describe('#done()', function () {
  997. beforeEach(function () {
  998. sinon.stub(controller, 'removeObserver', Em.K);
  999. sinon.stub(App.router, 'send', Em.K);
  1000. });
  1001. afterEach(function () {
  1002. controller.removeObserver.restore();
  1003. App.router.send.restore();
  1004. });
  1005. it('submit disabled', function () {
  1006. controller.set('isSubmitDisabled', true);
  1007. controller.done();
  1008. expect(App.router.send.called).to.be.false;
  1009. });
  1010. it('submit enabled and does not have manual steps', function () {
  1011. controller.set('isSubmitDisabled', false);
  1012. controller.set('content.hasManualSteps', false);
  1013. controller.done();
  1014. expect(controller.removeObserver.calledWith('tasks.@each.status', controller, 'onTaskStatusChange')).to.be.true;
  1015. expect(App.router.send.calledWith('complete')).to.be.true;
  1016. });
  1017. it('submit enabled and has manual steps', function () {
  1018. controller.set('isSubmitDisabled', false);
  1019. controller.set('content.hasManualSteps', true);
  1020. controller.done();
  1021. expect(controller.removeObserver.calledWith('tasks.@each.status', controller, 'onTaskStatusChange')).to.be.true;
  1022. expect(App.router.send.calledWith('next')).to.be.true;
  1023. });
  1024. });
  1025. describe('#getServiceConfigData()', function () {
  1026. var services = [];
  1027. var stackServices = [];
  1028. beforeEach(function () {
  1029. sinon.stub(App.Service, 'find', function () {
  1030. return services;
  1031. });
  1032. sinon.stub(App.StackService, 'find', function () {
  1033. return stackServices;
  1034. });
  1035. });
  1036. afterEach(function () {
  1037. App.Service.find.restore();
  1038. App.StackService.find.restore();
  1039. });
  1040. it('No services', function () {
  1041. services = [];
  1042. controller.set('content.reassign.component_name', 'COMP1');
  1043. expect(controller.getServiceConfigData([])).to.eql([]);
  1044. });
  1045. it('No services in stackServices', function () {
  1046. services = [Em.Object.create({serviceName: 'S1'})];
  1047. stackServices = [];
  1048. controller.set('content.reassign.component_name', 'COMP1');
  1049. expect(controller.getServiceConfigData([])).to.eql([]);
  1050. });
  1051. it('Services in stackServicesm but configTypesRendered is empty', function () {
  1052. services = [Em.Object.create({serviceName: 'S1'})];
  1053. stackServices = [Em.Object.create({
  1054. serviceName: 'S1',
  1055. configTypesRendered: {}
  1056. })];
  1057. controller.set('content.reassign.component_name', 'COMP1');
  1058. expect(controller.getServiceConfigData([])[0]).to.equal("{\"Clusters\":{\"desired_config\":[]}}");
  1059. });
  1060. it('Services in stackServicesm and configTypesRendered has data, but configs is empty', function () {
  1061. services = [Em.Object.create({serviceName: 'S1'})];
  1062. stackServices = [
  1063. Em.Object.create({
  1064. serviceName: 'S1',
  1065. configTypesRendered: {'type1': {}}
  1066. })
  1067. ];
  1068. controller.set('content.reassign.component_name', 'COMP1');
  1069. expect(controller.getServiceConfigData([])[0]).to.equal("{\"Clusters\":{\"desired_config\":[]}}");
  1070. });
  1071. it('Services in stackServicesm and configTypesRendered has data, and configs present', function () {
  1072. services = [Em.Object.create({serviceName: 'S1'})];
  1073. stackServices = [
  1074. Em.Object.create({
  1075. serviceName: 'S1',
  1076. configTypesRendered: {'type1': {}}
  1077. })
  1078. ];
  1079. var configs = {
  1080. 'type1': {
  1081. 'prop1': 'value1'
  1082. }
  1083. };
  1084. controller.set('content.reassign.component_name', 'COMP1');
  1085. expect(JSON.parse(controller.getServiceConfigData(configs)[0]).Clusters.desired_config.length).to.equal(1);
  1086. });
  1087. });
  1088. describe('#testsMySqlServer()', function () {
  1089. beforeEach(function() {
  1090. sinon.stub(App.HostComponent, 'find', function() {
  1091. return Em.A([
  1092. Em.Object.create({
  1093. 'componentName': 'MYSQL_SERVER',
  1094. 'hostName': 'c6401.ambari.apache.org'
  1095. })
  1096. ]);
  1097. });
  1098. });
  1099. afterEach(function() {
  1100. App.HostComponent.find.restore();
  1101. });
  1102. it('Cleans MySql Server', function () {
  1103. controller.cleanMySqlServer();
  1104. expect(App.ajax.send.calledOnce).to.be.true;
  1105. });
  1106. it('Configures MySql Server', function () {
  1107. controller.configureMySqlServer();
  1108. expect(App.ajax.send.calledOnce).to.be.true;
  1109. });
  1110. });
  1111. });