12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060 |
- /**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- var App = require('app');
- require('mixins/common/localStorage');
- require('controllers/wizard/step7_controller');
- var testHelpers = require('test/helpers');
- var installerStep7Controller,
- issuesFilterCases = [
- {
- isSubmitDisabled: true,
- submitButtonClicked: true,
- isIssuesFilterActive: true,
- issuesFilterText: '',
- issuesFilterLinkText: Em.I18n.t('installer.step7.showAllProperties'),
- title: 'issues filter on, submit button clicked'
- },
- {
- isSubmitDisabled: true,
- submitButtonClicked: false,
- isIssuesFilterActive: true,
- issuesFilterText: Em.I18n.t('installer.step7.showingPropertiesWithIssues'),
- issuesFilterLinkText: Em.I18n.t('installer.step7.showAllProperties'),
- title: 'issues filter on, submit button disabled'
- },
- {
- isSubmitDisabled: true,
- submitButtonClicked: true,
- isIssuesFilterActive: false,
- issuesFilterText: '',
- issuesFilterLinkText: '',
- title: 'issues filter off, submit button clicked'
- },
- {
- isSubmitDisabled: true,
- submitButtonClicked: false,
- isIssuesFilterActive: false,
- issuesFilterText: '',
- issuesFilterLinkText: Em.I18n.t('installer.step7.showPropertiesWithIssues'),
- title: 'issues filter off, submit button disabled'
- },
- {
- isSubmitDisabled: false,
- submitButtonClicked: false,
- isIssuesFilterActive: true,
- issuesFilterText: '',
- issuesFilterLinkText: Em.I18n.t('installer.step7.showAllProperties'),
- title: 'issues filter on, submit button enabled'
- },
- {
- isSubmitDisabled: false,
- submitButtonClicked: false,
- isIssuesFilterActive: false,
- issuesFilterText: '',
- issuesFilterLinkText: '',
- title: 'issues filter off, submit button enabled'
- },
- {
- isSubmitDisabled: false,
- submitButtonClicked: false,
- isIssuesFilterActive: true,
- issuesFilterText: '',
- issuesFilterLinkText: Em.I18n.t('installer.step7.showAllProperties'),
- title: 'issues filter on, submit button not clicked but active'
- },
- {
- isSubmitDisabled: false,
- submitButtonClicked: true,
- isIssuesFilterActive: true,
- issuesFilterText: '',
- issuesFilterLinkText: Em.I18n.t('installer.step7.showAllProperties'),
- title: 'issues filter on, submit button clicked and active'
- }
- ],
- issuesFilterTestSetup = function (controller, testCase) {
- controller.set('submitButtonClicked', testCase.submitButtonClicked);
- controller.reopen({
- isSubmitDisabled: testCase.isSubmitDisabled
- });
- controller.get('filterColumns').findProperty('attributeName', 'hasIssues').set('selected', testCase.isIssuesFilterActive);
- };
- function getController() {
- return App.WizardStep7Controller.create({
- content: Em.Object.create({
- services: [],
- advancedServiceConfig: [],
- serviceConfigProperties: []
- })
- });
- }
- describe('App.InstallerStep7Controller', function () {
- beforeEach(function () {
- sinon.stub(App.config, 'setPreDefinedServiceConfigs', Em.K);
- installerStep7Controller = getController();
- App.set('router.nextBtnClickInProgress', false);
- });
- afterEach(function() {
- App.set('router.nextBtnClickInProgress', false);
- App.config.setPreDefinedServiceConfigs.restore();
- installerStep7Controller.destroy();
- });
- App.TestAliases.testAsComputedAlias(getController(), 'masterComponentHosts', 'content.masterComponentHosts', 'array');
- App.TestAliases.testAsComputedAlias(getController(), 'slaveComponentHosts', 'content.slaveGroupProperties', 'array');
- App.TestAliases.testAsComputedAnd(getController(), 'isConfigsLoaded', ['wizardController.stackConfigsLoaded', 'isAppliedConfigLoaded']);
- describe('#installedServiceNames', function () {
- var tests = Em.A([
- {
- content: Em.Object.create({
- controllerName: 'installerController',
- services: Em.A([
- Em.Object.create({
- isInstalled: true,
- serviceName: 'SQOOP'
- }),
- Em.Object.create({
- isInstalled: true,
- serviceName: 'HDFS'
- })
- ])
- }),
- e: ['SQOOP', 'HDFS'],
- m: 'installerController with SQOOP'
- },
- {
- content: Em.Object.create({
- controllerName: 'installerController',
- services: Em.A([
- Em.Object.create({
- isInstalled: true,
- serviceName: 'HIVE'
- }),
- Em.Object.create({
- isInstalled: true,
- serviceName: 'HDFS'
- })
- ])
- }),
- e: ['HIVE', 'HDFS'],
- m: 'installerController without SQOOP'
- },
- {
- content: Em.Object.create({
- controllerName: 'addServiceController',
- services: Em.A([
- Em.Object.create({
- isInstalled: true,
- serviceName: 'HIVE'
- }),
- Em.Object.create({
- isInstalled: true,
- serviceName: 'HDFS'
- })
- ])
- }),
- e: ['HIVE', 'HDFS'],
- m: 'addServiceController without SQOOP'
- }
- ]);
- tests.forEach(function (test) {
- it(test.m, function () {
- installerStep7Controller.set('content', test.content);
- expect(installerStep7Controller.get('installedServiceNames')).to.include.members(test.e);
- expect(test.e).to.include.members(installerStep7Controller.get('installedServiceNames'));
- });
- });
- });
- describe('#isSubmitDisabled', function () {
- it('should be true if miscModalVisible', function () {
- installerStep7Controller.reopen({miscModalVisible: true});
- expect(installerStep7Controller.get('isSubmitDisabled')).to.equal(true);
- });
- it('should be true if some of stepConfigs has errors', function () {
- installerStep7Controller.reopen({
- miscModalVisible: false,
- stepConfigs: [
- {
- showConfig: true,
- errorCount: 1
- }
- ]
- });
- expect(installerStep7Controller.get('isSubmitDisabled')).to.equal(true);
- });
- it('should be false if all of stepConfigs don\'t have errors and miscModalVisible is false', function () {
- installerStep7Controller.reopen({
- miscModalVisible: false,
- stepConfigs: [
- {
- showConfig: true,
- errorCount: 0
- }
- ]
- });
- expect(installerStep7Controller.get('isSubmitDisabled')).to.equal(false);
- });
- });
- describe('#selectedServiceNames', function () {
- it('should use content.services as source of data', function () {
- installerStep7Controller.set('content', {
- services: [
- {isSelected: true, isInstalled: false, serviceName: 's1'},
- {isSelected: false, isInstalled: false, serviceName: 's2'},
- {isSelected: true, isInstalled: true, serviceName: 's3'},
- {isSelected: false, isInstalled: false, serviceName: 's4'},
- {isSelected: true, isInstalled: false, serviceName: 's5'},
- {isSelected: false, isInstalled: false, serviceName: 's6'},
- {isSelected: true, isInstalled: true, serviceName: 's7'},
- {isSelected: false, isInstalled: false, serviceName: 's8'}
- ]
- });
- var expected = ['s1', 's5'];
- expect(installerStep7Controller.get('selectedServiceNames')).to.eql(expected);
- });
- });
- describe('#allSelectedServiceNames', function () {
- it('should use content.services as source of data', function () {
- installerStep7Controller.set('content', {
- services: [
- Em.Object.create({isSelected: true, isInstalled: false, serviceName: 's1'}),
- Em.Object.create({isSelected: false, isInstalled: false, serviceName: 's2'}),
- Em.Object.create({isSelected: true, isInstalled: true, serviceName: 's3'}),
- Em.Object.create({isSelected: false, isInstalled: false, serviceName: 's4'}),
- Em.Object.create({isSelected: true, isInstalled: false, serviceName: 's5'}),
- Em.Object.create({isSelected: false, isInstalled: false, serviceName: 's6'}),
- Em.Object.create({isSelected: true, isInstalled: true, serviceName: 's7'}),
- Em.Object.create({isSelected: false, isInstalled: false, serviceName: 's8'})
- ]
- });
- var expected = ['s1', 's3', 's5', 's7'];
- expect(installerStep7Controller.get('allSelectedServiceNames')).to.eql(expected);
- });
- });
- describe('#checkDatabaseConnectionTest', function () {
- beforeEach(function () {
- installerStep7Controller.set('content', {
- services: Em.A([
- Em.Object.create({isSelected: true, isInstalled: false, serviceName: 'OOZIE', ignored: []}),
- Em.Object.create({isSelected: false, isInstalled: false, serviceName: 'HIVE', ignored: []}),
- Em.Object.create({isSelected: true, isInstalled: true, serviceName: 's3', ignored: []}),
- Em.Object.create({isSelected: false, isInstalled: false, serviceName: 's4', ignored: []}),
- Em.Object.create({isSelected: true, isInstalled: false, serviceName: 's5', ignored: []}),
- Em.Object.create({isSelected: false, isInstalled: false, serviceName: 's6', ignored: []}),
- Em.Object.create({isSelected: true, isInstalled: true, serviceName: 's7', ignored: []}),
- Em.Object.create({isSelected: false, isInstalled: false, serviceName: 's8', ignored: []})
- ])
- });
- var obj = Em.Object.create({name:'oozie_database',value:"aa"});
- installerStep7Controller.set('stepConfigs',Em.A([Em.Object.create({serviceName: 'OOZIE', configs: Em.A([obj]) })]));
- this.deffer = installerStep7Controller.checkDatabaseConnectionTest();
- });
- it('should return promise in process', function () {
- expect(this.deffer.isResolved()).to.equal(false);
- this.deffer.resolve(true);
- this.deffer.done(function(data) {
- expect(data).to.equal(true);
- });
- });
- });
- describe.skip('#submit', function () {
- beforeEach(function () {
- sinon.stub(App, 'get').withArgs('supports.preInstallChecks').returns(false);
- });
- afterEach(function () {
- App.get.restore();
- });
- it('should return false if submit disabled', function () {
- installerStep7Controller.set('isSubmitDisabled',true);
- expect(installerStep7Controller.submit()).to.be.false;
- });
- it('sumbit button should be unclicked if no configs', function () {
- installerStep7Controller.set('isSubmitDisabled',false);
- installerStep7Controller.submit();
- expect(installerStep7Controller.get('submitButtonClicked')).to.be.false;
- });
- it('if Next button is clicked multiple times before the next step renders, it must not be processed',function(){
- installerStep7Controller.submit();
- expect(App.router.send.calledWith('next')).to.equal(true);
- App.router.send.reset();
- installerStep7Controller.submit();
- expect(App.router.send.calledWith('next')).to.equal(false);
- });
- });
- describe('#getConfigTagsSuccess', function () {
- beforeEach(function(){
- sinon.stub(App.StackService, 'find', function () {
- return [
- Em.Object.create({
- serviceName: 's0',
- isInstalled: true,
- configTypes: {
- site3: true,
- site1: true
- }
- }),
- Em.Object.create({
- serviceName: 's1',
- isInstalled: true,
- configTypes: {
- site1: true,
- site2: true
- }
- })
- ];
- });
- });
- afterEach(function(){
- App.StackService.find.restore();
- });
- it('should return serviceConfigTags', function () {
- var desiredConfigs = {
- site1: {
- tag: "tag1"
- },
- site2: {
- tag: "tag2"
- },
- site3: {
- tag: "tag3"
- }
- };
- var data = {
- Clusters: {
- desired_configs: desiredConfigs
- }
- };
- installerStep7Controller.getConfigTagsSuccess(data);
- expect(installerStep7Controller.get('serviceConfigTags')).to.eql([
- {
- "siteName": "site1",
- "tagName": "tag1",
- "newTagName": null
- },
- {
- "siteName": "site2",
- "tagName": "tag2",
- "newTagName": null
- },
- {
- "siteName": "site3",
- "tagName": "tag3",
- "newTagName": null
- }
- ]);
- expect(installerStep7Controller.get('isAppliedConfigLoaded')).to.equal(true);
- });
- });
- describe('#clearStep', function () {
- it('should clear stepConfigs', function () {
- installerStep7Controller.set('stepConfigs', [
- {},
- {}
- ]);
- installerStep7Controller.clearStep();
- expect(installerStep7Controller.get('stepConfigs.length')).to.equal(0);
- });
- it('should clear filter', function () {
- installerStep7Controller.set('filter', 'filter');
- installerStep7Controller.clearStep();
- expect(installerStep7Controller.get('filter')).to.equal('');
- });
- it('should set for each filterColumns "selected" false', function () {
- installerStep7Controller.set('filterColumns', [
- {selected: true},
- {selected: false},
- {selected: true}
- ]);
- installerStep7Controller.clearStep();
- expect(installerStep7Controller.get('filterColumns').everyProperty('selected', false)).to.equal(true);
- });
- });
- describe('#getConfigTags', function () {
- it('should do ajax-request', function () {
- installerStep7Controller.getConfigTags();
- var args = testHelpers.findAjaxRequest('name', 'config.tags');
- expect(args).exists;
- });
- });
- describe('#setGroupsToDelete', function () {
- beforeEach(function () {
- installerStep7Controller.set('wizardController', Em.Object.create(App.LocalStorage, {name: 'tdk'}));
- });
- it('should add new groups to groupsToDelete', function () {
- var groupsToDelete = [
- {id: '1'},
- {id: '2'}
- ],
- groups = [
- Em.Object.create({id: '3', isTemporary: false}),
- Em.Object.create({id: '4', isTemporary: true}),
- Em.Object.create({id: '5', isTemporary: false})
- ],
- expected = [
- {id: "1"},
- {id: "2"},
- {id: "3"},
- {id: "5"}
- ];
- installerStep7Controller.set('groupsToDelete', groupsToDelete);
- installerStep7Controller.setGroupsToDelete(groups);
- expect(installerStep7Controller.get('groupsToDelete')).to.eql(expected);
- expect(installerStep7Controller.get('wizardController').getDBProperty('groupsToDelete')).to.eql(expected);
- });
- });
- describe('#checkMySQLHost', function () {
- it('should send query', function () {
- installerStep7Controller.checkMySQLHost();
- var args = testHelpers.findAjaxRequest('name', 'ambari.service');
- expect(args).exists;
- });
- });
- describe('#selectConfigGroup', function () {
- beforeEach(function () {
- installerStep7Controller.reopen({content: {services: []}});
- sinon.stub(installerStep7Controller, 'switchConfigGroupConfigs', Em.K);
- });
- afterEach(function () {
- installerStep7Controller.switchConfigGroupConfigs.restore();
- });
- it('should set selectedConfigGroup', function () {
- var group = {':': []};
- installerStep7Controller.selectConfigGroup({context: group});
- expect(installerStep7Controller.get('selectedConfigGroup')).to.eql(group);
- });
- });
- describe('#selectedServiceObserver', function () {
- beforeEach(function () {
- installerStep7Controller.reopen({content: {services: []}});
- sinon.stub(installerStep7Controller, 'switchConfigGroupConfigs', Em.K);
- });
- afterEach(function () {
- installerStep7Controller.switchConfigGroupConfigs.restore();
- });
- it('shouldn\'t do nothing if App.supports.hostOverridesInstaller is false', function () {
- App.set('supports.hostOverridesInstaller', false);
- var configGroups = [
- {},
- {}
- ],
- selectedConfigGroup = {};
- installerStep7Controller.reopen({configGroups: configGroups, selectedConfigGroup: selectedConfigGroup});
- installerStep7Controller.selectedServiceObserver();
- expect(installerStep7Controller.get('configGroups')).to.eql(configGroups);
- expect(installerStep7Controller.get('selectedConfigGroup')).to.eql(selectedConfigGroup);
- });
- it('shouldn\'t do nothing if selectedService is null', function () {
- App.set('supports.hostOverridesInstaller', true);
- var configGroups = [
- {},
- {}
- ],
- selectedConfigGroup = {};
- installerStep7Controller.reopen({selectedService: null, configGroups: configGroups, selectedConfigGroup: selectedConfigGroup});
- installerStep7Controller.selectedServiceObserver();
- expect(installerStep7Controller.get('configGroups')).to.eql(configGroups);
- expect(installerStep7Controller.get('selectedConfigGroup')).to.eql(selectedConfigGroup);
- });
- it('shouldn\'t do nothing if selectedService.serviceName is MISC', function () {
- App.set('supports.hostOverridesInstaller', true);
- var configGroups = [
- {},
- {}
- ],
- selectedConfigGroup = {};
- installerStep7Controller.reopen({selectedService: {serviceName: 'MISC'}, configGroups: configGroups, selectedConfigGroup: selectedConfigGroup});
- installerStep7Controller.selectedServiceObserver();
- expect(installerStep7Controller.get('configGroups')).to.eql(configGroups);
- expect(installerStep7Controller.get('selectedConfigGroup')).to.eql(selectedConfigGroup);
- });
- it('should update configGroups and selectedConfigGroup', function () {
- App.set('supports.hostOverridesInstaller', true);
- var defaultGroup = {isDefault: true, n: 'n2'},
- configGroups = [
- {isDefault: false, n: 'n1'},
- defaultGroup,
- {n: 'n3'}
- ];
- installerStep7Controller.reopen({selectedService: {serviceName: 's1', configGroups: configGroups}});
- installerStep7Controller.selectedServiceObserver();
- expect(installerStep7Controller.get('configGroups').mapProperty('n')).to.eql(['n2', 'n1', 'n3']);
- expect(installerStep7Controller.get('selectedConfigGroup')).to.eql(defaultGroup);
- });
- });
- describe('#loadConfigGroups', function () {
- beforeEach(function () {
- installerStep7Controller.reopen({
- wizardController: Em.Object.create({
- allHosts: [
- {hostName: 'h1'},
- {hostName: 'h2'},
- {hostName: 'h3'}
- ]
- })
- });
- });
- afterEach(function () {
- App.ServiceConfigGroup.find().clear();
- });
- it('shouldn\'t do nothing if only MISC available', function () {
- var configGroups = [
- {}
- ];
- installerStep7Controller.reopen({
- stepConfigs: [Em.Object.create({serviceName: 'MISC', configGroups: configGroups})]
- });
- installerStep7Controller.loadConfigGroups([]);
- expect(installerStep7Controller.get('stepConfigs.firstObject.configGroups')).to.eql(configGroups);
- });
- });
- describe('#_getDisplayedConfigGroups', function () {
- it('should return [] if no selected group', function () {
- installerStep7Controller.reopen({
- content: {services: []},
- selectedConfigGroup: null
- });
- expect(installerStep7Controller._getDisplayedConfigGroups()).to.eql([]);
- });
- it('should return default config group if another selected', function () {
- var defaultGroup = Em.Object.create({isDefault: false});
- installerStep7Controller.reopen({
- content: {services: []},
- selectedConfigGroup: defaultGroup
- });
- expect(installerStep7Controller._getDisplayedConfigGroups()).to.eql([defaultGroup]);
- });
- it('should return other groups if default selected', function () {
- var defaultGroup = Em.Object.create({isDefault: true}),
- cfgG = Em.Object.create({isDefault: true}),
- configGroups = Em.A([
- Em.Object.create({isDefault: false}),
- Em.Object.create({isDefault: false}),
- cfgG,
- Em.Object.create({isDefault: false})
- ]);
- installerStep7Controller.reopen({
- content: {services: []},
- selectedConfigGroup: defaultGroup,
- selectedService: {configGroups: configGroups}
- });
- expect(installerStep7Controller._getDisplayedConfigGroups()).to.eql(configGroups.without(cfgG));
- });
- });
- describe('#_setEditableValue', function () {
- it('shouldn\'t update config if no selectedConfigGroup', function () {
- installerStep7Controller.reopen({
- selectedConfigGroup: null
- });
- var config = Em.Object.create({isEditable: null});
- var updatedConfig = installerStep7Controller._setEditableValue(config);
- expect(updatedConfig.get('isEditable')).to.be.null;
- });
- it('should set isEditable equal to selectedGroup.isDefault if service not installed', function () {
- var isDefault = true;
- installerStep7Controller.reopen({
- installedServiceNames: [],
- selectedService: {serviceName: 'abc'},
- selectedConfigGroup: Em.Object.create({isDefault: isDefault})
- });
- var config = Em.Object.create({isEditable: null});
- var updatedConfig = installerStep7Controller._setEditableValue(config);
- expect(updatedConfig.get('isEditable')).to.equal(isDefault);
- installerStep7Controller.toggleProperty('selectedConfigGroup.isDefault');
- updatedConfig = installerStep7Controller._setEditableValue(config);
- expect(updatedConfig.get('isEditable')).to.equal(!isDefault);
- });
- Em.A([
- {
- isEditable: false,
- isReconfigurable: false,
- isDefault: true,
- e: false
- },
- {
- isEditable: true,
- isReconfigurable: true,
- isDefault: true,
- e: true
- },
- {
- isEditable: false,
- isReconfigurable: true,
- isDefault: false,
- e: false
- },
- {
- isEditable: true,
- isReconfigurable: false,
- isDefault: false,
- e: false
- }
- ]).forEach(function (test) {
- it('service installed, isEditable = ' + test.isEditable.toString() + ', isReconfigurable = ' + test.isReconfigurable.toString(), function () {
- var config = Em.Object.create({
- isReconfigurable: test.isReconfigurable,
- isEditable: test.isEditable
- });
- installerStep7Controller.reopen({
- installedServiceNames: Em.A(['a']),
- selectedService: Em.Object.create({serviceName: 'a'}),
- selectedConfigGroup: Em.Object.create({isDefault: test.isDefault})
- });
- var updateConfig = installerStep7Controller._setEditableValue(config);
- expect(updateConfig.get('isEditable')).to.equal(test.e);
- });
- });
- });
- describe('#_setOverrides', function () {
- it('shouldn\'t update config if no selectedConfigGroup', function () {
- installerStep7Controller.reopen({
- selectedConfigGroup: null
- });
- var config = Em.Object.create({overrides: null});
- var updatedConfig = installerStep7Controller._setOverrides(config, []);
- expect(updatedConfig.get('overrides')).to.be.null;
- });
- describe('no overrideToAdd', function () {
- var isDefault;
- beforeEach(function () {
- isDefault = true;
- var name = 'n1',
- config = Em.Object.create({overrides: null, name: name, flag: 'flag'}),
- overrides = Em.A([
- Em.Object.create({name: name, value: 'v1'}),
- Em.Object.create({name: name, value: 'v2'}),
- Em.Object.create({name: 'n2', value: 'v3'})
- ]);
- installerStep7Controller.reopen({
- overrideToAdd: null,
- selectedConfigGroup: Em.Object.create({
- isDefault: isDefault
- })
- });
- this.updatedConfig = installerStep7Controller._setOverrides(config, overrides);
- });
- it('2 overrides', function () {
- expect(this.updatedConfig.get('overrides.length')).to.equal(2);
- });
- it('each isEditable is ' + !isDefault, function () {
- expect(this.updatedConfig.get('overrides').everyProperty('isEditable', !isDefault)).to.equal(true);
- });
- it('each parentSCP.flag is `flag`', function () {
- expect(this.updatedConfig.get('overrides').everyProperty('parentSCP.flag', 'flag')).to.equal(true);
- });
- });
- describe('overrideToAdd exists', function () {
- var isDefault = true;
- beforeEach(function () {
- var name = 'n1',
- config = Em.Object.create({overrides: null, name: name, flag: 'flag'}),
- overrides = Em.A([
- Em.Object.create({name: name, value: 'v1'}),
- Em.Object.create({name: name, value: 'v2'}),
- Em.Object.create({name: 'n2', value: 'v3'})
- ]);
- installerStep7Controller.reopen({
- overrideToAdd: Em.Object.create({name: name}),
- selectedService: {configGroups: [Em.Object.create({name: 'n', properties: []})]},
- selectedConfigGroup: Em.Object.create({
- isDefault: isDefault,
- name: 'n'
- })
- });
- this.updatedConfig = installerStep7Controller._setOverrides(config, overrides);
- });
- it('3 overrides', function () {
- expect(this.updatedConfig.get('overrides.length')).to.equal(3);
- });
- it('each isEditable is ' + !isDefault, function () {
- expect(this.updatedConfig.get('overrides').everyProperty('isEditable', !isDefault)).to.equal(true);
- });
- it('each parentSCP.flag is `flag`', function () {
- expect(this.updatedConfig.get('overrides').everyProperty('parentSCP.flag', 'flag')).to.equal(true);
- });
- });
- });
- describe('#switchConfigGroupConfigs', function () {
- it('if selectedConfigGroup is null, serviceConfigs shouldn\'t be changed', function () {
- installerStep7Controller.reopen({
- selectedConfigGroup: null,
- content: {services: []},
- serviceConfigs: {configs: [
- {overrides: []},
- {overrides: []}
- ]}
- });
- installerStep7Controller.switchConfigGroupConfigs();
- expect(installerStep7Controller.get('serviceConfigs.configs').everyProperty('overrides.length', 0)).to.equal(true);
- });
- describe('should set configs for serviceConfigs', function () {
- var configGroups = [
- Em.Object.create({
- properties: [
- {name: 'g1', value: 'v1'},
- {name: 'g2', value: 'v2'}
- ]
- })
- ];
- beforeEach(function () {
- sinon.stub(installerStep7Controller, '_getDisplayedConfigGroups', function () {
- return configGroups;
- });
- sinon.stub(installerStep7Controller, '_setEditableValue', function (config) {
- config.set('isEditable', true);
- return config;
- });
- installerStep7Controller.reopen({
- selectedConfigGroup: Em.Object.create({isDefault: true, name: 'g1'}),
- content: {services: []},
- selectedService: {configs: Em.A([Em.Object.create({name: 'g1', overrides: [], properties: []}), Em.Object.create({name: 'g2', overrides: []})])},
- serviceConfigs: {configs: [Em.Object.create({name: 'g1'})]}
- });
- installerStep7Controller.switchConfigGroupConfigs();
- this.configs = installerStep7Controller.get('selectedService.configs');
- });
- afterEach(function () {
- installerStep7Controller._getDisplayedConfigGroups.restore();
- installerStep7Controller._setEditableValue.restore();
- });
- it('g1 has 1 override', function () {
- expect(this.configs.findProperty('name', 'g1').get('overrides').length).to.equal(1);
- });
- it('g2 has 1 override', function () {
- expect(this.configs.findProperty('name', 'g2').get('overrides').length).to.equal(1);
- });
- it('all configs are editable', function () {
- expect(this.configs.everyProperty('isEditable', true)).to.equal(true);
- });
- });
- });
- describe('#selectProperService', function () {
- Em.A([
- {
- name: 'addServiceController',
- stepConfigs: [
- {selected: false, name: 'n1'},
- {selected: true, name: 'n2'},
- {selected: true, name: 'n3'}
- ],
- e: 'n2'
- },
- {
- name: 'installerController',
- stepConfigs: [
- {showConfig: false, name: 'n1'},
- {showConfig: false, name: 'n2'},
- {showConfig: true, name: 'n3'}
- ],
- e: 'n3'
- }
- ]).forEach(function (test) {
- describe(test.name, function () {
- beforeEach(function () {
- sinon.stub(installerStep7Controller, 'selectedServiceObserver', Em.K);
- installerStep7Controller.reopen({
- wizardController: Em.Object.create({
- name: test.name
- }),
- stepConfigs: test.stepConfigs
- });
- installerStep7Controller.selectProperService();
- });
- afterEach(function () {
- installerStep7Controller.selectedServiceObserver.restore();
- });
- it('selected service name is valid', function () {
- expect(installerStep7Controller.get('selectedService.name')).to.equal(test.e);
- });
- });
- });
- });
- describe.skip('#setStepConfigs', function () {
- var serviceConfigs;
- beforeEach(function () {
- installerStep7Controller.reopen({
- content: {services: []},
- wizardController: Em.Object.create({
- getDBProperty: function (key) {
- return this.get(key);
- }
- })
- });
- sinon.stub(installerStep7Controller, 'renderConfigs', function () {
- return serviceConfigs;
- });
- this.stub = sinon.stub(App, 'get');
- });
- afterEach(function () {
- installerStep7Controller.renderConfigs.restore();
- App.get.restore();
- });
- it('if wizard isn\'t addService, should set output of installerStep7Controller.renderConfigs', function () {
- serviceConfigs = Em.A([
- {serviceName:'HDFS', configs: []},
- {}
- ]);
- installerStep7Controller.set('wizardController.name', 'installerController');
- installerStep7Controller.setStepConfigs([], []);
- expect(installerStep7Controller.get('stepConfigs')).to.eql(serviceConfigs);
- });
- it('addServiceWizard used', function () {
- serviceConfigs = Em.A([Em.Object.create({serviceName: 'HDFS', configs: []}), Em.Object.create({serviceName: 's2'})]);
- installerStep7Controller.set('wizardController.name', 'addServiceController');
- installerStep7Controller.reopen({selectedServiceNames: ['s2']});
- installerStep7Controller.setStepConfigs([], []);
- expect(installerStep7Controller.get('stepConfigs').everyProperty('showConfig', true)).to.equal(true);
- expect(installerStep7Controller.get('stepConfigs').findProperty('serviceName', 's2').get('selected')).to.equal(true);
- });
- it('addServiceWizard used, HA enabled', function () {
- this.stub.withArgs('isHaEnabled').returns(true);
- serviceConfigs = Em.A([
- Em.Object.create({
- serviceName: 'HDFS',
- configs: [
- Em.Object.create({category: 'SECONDARY_NAMENODE'}),
- Em.Object.create({category: 'SECONDARY_NAMENODE'}),
- Em.Object.create({category: 'NameNode'}),
- Em.Object.create({category: 'NameNode'}),
- Em.Object.create({category: 'SECONDARY_NAMENODE'})
- ]
- }),
- Em.Object.create({serviceName: 's2'})]
- );
- installerStep7Controller.set('wizardController.name', 'addServiceController');
- installerStep7Controller.reopen({selectedServiceNames: ['HDFS', 's2']});
- installerStep7Controller.setStepConfigs([], []);
- expect(installerStep7Controller.get('stepConfigs').everyProperty('showConfig', true)).to.equal(true);
- expect(installerStep7Controller.get('stepConfigs').findProperty('serviceName', 'HDFS').get('selected')).to.equal(true);
- expect(installerStep7Controller.get('stepConfigs').findProperty('serviceName', 'HDFS').get('configs').length).to.equal(5);
- });
- it('not windows stack', function () {
- this.stub.withArgs('isHadoopWindowsStack').returns(false);
- this.stub.withArgs('isHaEnabled').returns(false);
- serviceConfigs = Em.A([
- Em.Object.create({
- serviceName: 'HDFS',
- configs: [
- {category: 'NameNode'},
- {category: 'NameNode'}
- ]
- }),
- Em.Object.create({serviceName: 's2'})]
- );
- installerStep7Controller.reopen({selectedServiceNames: ['HDFS', 's2']});
- installerStep7Controller.setStepConfigs([], []);
- expect(installerStep7Controller.get('stepConfigs').findProperty('serviceName', 'HDFS').get('configs').length).to.equal(2);
- });
- it('windows stack', function () {
- this.stub.withArgs('isHadoopWindowsStack').returns(true);
- this.stub.withArgs('isHaEnabled').returns(false);
- serviceConfigs = Em.A([
- Em.Object.create({
- serviceName: 'HDFS',
- configs: [
- {category: 'NameNode'},
- {category: 'NameNode'}
- ]
- }),
- Em.Object.create({serviceName: 's2'})]
- );
- installerStep7Controller.reopen({selectedServiceNames: ['HDFS', 's2']});
- installerStep7Controller.set('installedServiceNames',['HDFS', 's2', 's3']);
- installerStep7Controller.setStepConfigs([], []);
- expect(installerStep7Controller.get('stepConfigs').findProperty('serviceName', 'HDFS').get('configs').length).to.equal(2);
- });
- });
- describe('#loadStep', function () {
- beforeEach(function () {
- installerStep7Controller.reopen({
- content: {services: []},
- wizardController: Em.Object.create({
- getDBProperty: function (k) {
- return this.get(k);
- },
- stackConfigsLoaded: true
- })
- });
- sinon.stub(installerStep7Controller, 'clearStep', Em.K);
- sinon.stub(installerStep7Controller, 'getConfigTags', Em.K);
- sinon.stub(installerStep7Controller, 'setInstalledServiceConfigs', Em.K);
- sinon.stub(installerStep7Controller, 'checkHostOverrideInstaller', Em.K);
- sinon.stub(installerStep7Controller, 'selectProperService', Em.K);
- sinon.stub(installerStep7Controller, 'applyServicesConfigs', Em.K);
- sinon.stub(App.router, 'send', Em.K);
- });
- afterEach(function () {
- installerStep7Controller.clearStep.restore();
- installerStep7Controller.getConfigTags.restore();
- installerStep7Controller.setInstalledServiceConfigs.restore();
- installerStep7Controller.checkHostOverrideInstaller.restore();
- installerStep7Controller.selectProperService.restore();
- installerStep7Controller.applyServicesConfigs.restore();
- App.router.send.restore();
- });
- it('should call clearStep', function () {
- installerStep7Controller.loadStep();
- expect(installerStep7Controller.clearStep.calledOnce).to.equal(true);
- });
- it('shouldn\'t do nothing if isAdvancedConfigLoaded is false', function () {
- installerStep7Controller.set('wizardController.stackConfigsLoaded', false);
- installerStep7Controller.loadStep();
- expect(installerStep7Controller.clearStep.called).to.equal(false);
- });
- it('should call setInstalledServiceConfigs for addServiceController', function () {
- installerStep7Controller.set('wizardController.name', 'addServiceController');
- installerStep7Controller.loadStep();
- expect(installerStep7Controller.setInstalledServiceConfigs.calledOnce).to.equal(true);
- });
- });
- describe('#applyServicesConfigs', function() {
- beforeEach(function() {
- installerStep7Controller.reopen({
- allSelectedServiceNames: []
- });
- sinon.stub(installerStep7Controller, 'loadConfigRecommendations', function(c, callback) {
- return callback();
- });
- sinon.stub(installerStep7Controller, 'checkHostOverrideInstaller', Em.K);
- sinon.stub(installerStep7Controller, 'selectProperService', Em.K);
- sinon.stub(App.router, 'send', Em.K);
- sinon.stub(App.StackService, 'find', function () {
- return {
- findProperty: function () {
- return Em.Object.create({
- isInstalled: true,
- isSelected: false
- });
- },
- filterProperty: function () {
- return [];
- }
- }
- });
- installerStep7Controller.applyServicesConfigs([{name: 'configs'}]);
- });
- afterEach(function () {
- installerStep7Controller.loadConfigRecommendations.restore();
- installerStep7Controller.checkHostOverrideInstaller.restore();
- installerStep7Controller.selectProperService.restore();
- App.router.send.restore();
- App.StackService.find.restore();
- });
- it('loadConfigRecommendations is called once' , function () {
- expect(installerStep7Controller.loadConfigRecommendations.calledOnce).to.equal(true);
- });
- it('isRecommendedLoaded is true' , function () {
- expect(installerStep7Controller.get('isRecommendedLoaded')).to.equal(true);
- });
- it('checkHostOverrideInstalleris called once' , function () {
- expect(installerStep7Controller.checkHostOverrideInstaller.calledOnce).to.equal(true);
- });
- it('selectProperServiceis called once' , function () {
- expect(installerStep7Controller.selectProperService.calledOnce).to.equal(true);
- });
- });
- describe('#removeHawqStandbyHostAddressConfig', function() {
- installerStep7Controller = App.WizardStep7Controller.create({
- content: Em.Object.create({}),
- });
- var testHawqSiteConfigs = [
- {
- name: 'hawq_standby_address_host',
- value: 'h2'
- },
- {
- name: 'hawq_master_address_host',
- value: 'h1'
- }
- ];
- var oldHawqSiteLength = testHawqSiteConfigs.length;
- it('hawq_standby_address_host should be removed on single node cluster', function() {
- var hawqSiteConfigs = testHawqSiteConfigs.slice();
- installerStep7Controller.set('content.hosts', {'hostname': 'h1'});
- var updatedHawqSiteConfigs = installerStep7Controller.updateHawqConfigs(hawqSiteConfigs);
- expect(updatedHawqSiteConfigs.length).to.be.equal(oldHawqSiteLength-1);
- expect(updatedHawqSiteConfigs.findProperty('name', 'hawq_standby_address_host')).to.not.exist;
- expect(updatedHawqSiteConfigs.findProperty('name', 'hawq_master_address_host').value).to.be.equal('h1');
- });
- it('hawq_standby_address_host should not be removed on multi node clusters', function() {
- var hawqSiteConfigs = testHawqSiteConfigs.slice();
- installerStep7Controller.set('content.hosts', Em.A([{'hostname': 'h1'}, {'hostname': 'h2'}]));
- var updatedHawqSiteConfigs = installerStep7Controller.updateHawqConfigs(hawqSiteConfigs);
- expect(updatedHawqSiteConfigs.length).to.be.equal(oldHawqSiteLength);
- expect(updatedHawqSiteConfigs.findProperty('name', 'hawq_standby_address_host').value).to.be.equal('h2');
- expect(updatedHawqSiteConfigs.findProperty('name', 'hawq_master_address_host').value).to.be.equal('h1');
- });
- });
- describe('#_updateIsEditableFlagForConfig', function () {
- Em.A([
- {
- isAdmin: false,
- isReconfigurable: false,
- isHostsConfigsPage: true,
- defaultGroupSelected: false,
- m: 'false for non-admin users',
- e: false
- },
- {
- isAdmin: true,
- isReconfigurable: false,
- isHostsConfigsPage: true,
- defaultGroupSelected: false,
- m: 'false if defaultGroupSelected is false and isHostsConfigsPage is true',
- e: false
- },
- {
- isAdmin: true,
- isReconfigurable: false,
- isHostsConfigsPage: true,
- defaultGroupSelected: true,
- m: 'false if defaultGroupSelected is true and isHostsConfigsPage is true',
- e: false
- },
- {
- isAdmin: true,
- isReconfigurable: false,
- isHostsConfigsPage: false,
- defaultGroupSelected: false,
- m: 'false if defaultGroupSelected is false and isHostsConfigsPage is false',
- e: false
- }
- ]).forEach(function (test) {
- it(test.m, function () {
- installerStep7Controller.reopen({isHostsConfigsPage: test.isHostsConfigsPage});
- var serviceConfigProperty = Em.Object.create({
- isReconfigurable: test.isReconfigurable,
- isEditable: true
- });
- installerStep7Controller._updateIsEditableFlagForConfig(serviceConfigProperty, test.defaultGroupSelected);
- expect(serviceConfigProperty.get('isEditable')).to.equal(test.e);
- });
- });
- });
- describe('#setInstalledServiceConfigs', function () {
- var controller = App.WizardStep7Controller.create({
- installedServiceNames: ['HBASE', 'AMBARI_METRICS']
- }),
- configs = [
- {
- name: 'hbase.client.scanner.caching',
- value: '1000',
- serviceName: 'HBASE',
- filename: 'hbase-site.xml'
- },
- {
- name: 'hbase.client.scanner.caching',
- value: '2000',
- serviceName: 'AMBARI_METRICS',
- filename: 'ams-hbase-site.xml'
- }
- ],
- configsByTags = [
- {
- type: 'hbase-site',
- tag: 'version2',
- properties: {
- 'hbase.client.scanner.caching': '1500'
- }
- },
- {
- type: 'ams-hbase-site',
- tag: 'version2',
- properties: {
- 'hbase.client.scanner.caching': '2500'
- }
- },
- {
- type: 'site-without-properties',
- tag: 'version1'
- }
- ],
- installedServiceNames = ['HBASE', 'AMBARI_METRICS'];
- describe('should handle properties with the same name', function () {
- var properties;
- beforeEach(function () {
- controller.setInstalledServiceConfigs(configs, configsByTags, installedServiceNames);
- properties = configs.filterProperty('name', 'hbase.client.scanner.caching');
- });
- it('there are 2 properties', function () {
- expect(properties).to.have.length(2);
- });
- it('hbase-site/ value is valid', function () {
- expect(properties.findProperty('filename', 'hbase-site.xml').value).to.equal('1500');
- });
- it('hbase-site/ savedValue is valid', function () {
- expect(properties.findProperty('filename', 'hbase-site.xml').savedValue).to.equal('1500');
- });
- it('ams-hbase-site/ value is valid', function () {
- expect(properties.findProperty('filename', 'ams-hbase-site.xml').value).to.equal('2500');
- });
- it('ams-hbase-site/ savedValue is valid', function () {
- expect(properties.findProperty('filename', 'ams-hbase-site.xml').savedValue).to.equal('2500');
- });
- });
- });
- describe('#getAmbariDatabaseSuccess', function () {
- var controller = App.WizardStep7Controller.create({
- stepConfigs: [
- {
- serviceName: 'HIVE',
- configs: [
- {
- name: 'javax.jdo.option.ConnectionURL',
- value: 'jdbc:mysql://h0/db_name?createDatabaseIfNotExist=true',
- filename: 'hive-site.xml'
- }
- ]
- }
- ]
- }),
- cases = [
- {
- data: {
- hostComponents: []
- },
- mySQLServerConflict: false,
- title: 'no Ambari Server host components'
- },
- {
- data: {
- hostComponents: [
- {
- RootServiceHostComponents: {
- host_name: 'h0',
- properties: {
- 'server.jdbc.database': 'postgres'
- }
- }
- }
- ]
- },
- mySQLServerConflict: false,
- title: 'Ambari MySQL Server and Hive Server are on the same host but different database types'
- },
- {
- data: {
- hostComponents: [
- {
- RootServiceHostComponents: {
- host_name: 'h0',
- properties: {
- 'server.jdbc.database': 'mysql'
- }
- }
- }
- ]
- },
- mySQLServerConflict: true,
- title: 'Ambari MySQL Server and Hive Server are on the same host'
- },
- {
- data: {
- hostComponents: [
- {
- RootServiceHostComponents: {
- host_name: 'h1',
- properties: {
- 'server.jdbc.database': 'mysql'
- }
- }
- }
- ]
- },
- mySQLServerConflict: false,
- title: 'Ambari MySQL Server and Hive Server are on different hosts'
- }
- ];
- cases.forEach(function (item) {
- it(item.title, function () {
- controller.getAmbariDatabaseSuccess(item.data);
- expect(controller.get('mySQLServerConflict')).to.equal(item.mySQLServerConflict);
- });
- });
- });
- describe('#showDatabaseConnectionWarningPopup', function () {
- var cases = [
- {
- method: 'onSecondary',
- submitButtonClicked: false,
- isRejected: true,
- title: 'Cancel button clicked'
- },
- {
- method: 'onPrimary',
- submitButtonClicked: true,
- isResolved: true,
- title: 'Proceed Anyway button clicked'
- }
- ],
- dfd,
- testObject,
- serviceNames = ['HIVE', 'OOZIE'],
- bodyMessage = 'HIVE, OOZIE';
- beforeEach(function () {
- installerStep7Controller.set('submitButtonClicked', true);
- dfd = $.Deferred(function (d) {
- d.done(function () {
- testObject.isResolved = true;
- });
- d.fail(function () {
- testObject.isRejected = true;
- })
- });
- testObject = {};
- });
- cases.forEach(function (item) {
- describe(item.title, function () {
- var popup;
- beforeEach(function () {
- popup = installerStep7Controller.showDatabaseConnectionWarningPopup(serviceNames, dfd);
- });
- it('popup body is valid', function () {
- expect(popup.get('body')).to.equal(Em.I18n.t('installer.step7.popup.database.connection.body').format(bodyMessage));
- });
- it('after ' + item.method + ' execution', function () {
- popup[item.method]();
- expect(testObject.isResolved).to.equal(item.isResolved);
- expect(testObject.isRejected).to.equal(item.isRejected);
- expect(installerStep7Controller.get('submitButtonClicked')).to.equal(item.submitButtonClicked);
- });
- });
- });
- });
- describe('#issuesFilterText', function () {
- issuesFilterCases.forEach(function (item) {
- it(item.title, function () {
- issuesFilterTestSetup(installerStep7Controller, item);
- expect(installerStep7Controller.get('issuesFilterText')).to.equal(item.issuesFilterText);
- })
- });
- });
- describe.skip('#loadServiceTagsSuccess', function () {
- it('should create ClusterSiteToTagMap', function () {
- var params = Em.Object.create({
- serviceName: "OOZIE",
- serviceConfigsDef: Em.Object.create({
- configTypes: Em.Object.create({
- site3: true,
- site2: true,
- site1: true
- })
- })
- });
- var wizardController = Em.Object.create({
- allHosts: [
- {hostName: 'h1'},
- {hostName: 'h2'},
- {hostName: 'h3'}
- ]
- });
- installerStep7Controller.set('wizardController', wizardController);
- installerStep7Controller.set('stepConfigs', Em.A([Em.Object.create({serviceName: 'OOZIE', configs: Em.A([]) })]));
- var desiredConfigs = {
- site1: {
- tag: "tag1"
- },
- site2: {
- tag: "tag2"
- },
- site3: {
- tag: "tag3"
- }
- };
- var data = {
- config_groups: Em.A([Em.Object.create({
- ConfigGroup: Em.Object.create({
- tag: 'OOZIE',
- hosts: Em.A([Em.Object.create({host_name: 'h1'})]),
- id: 1,
- group_name: "",
- description: "",
- desired_configs: Em.A([Em.Object.create({
- type: '1',
- tag: 'h1'
- })])
- })
- })]),
- Clusters: {
- desired_configs: desiredConfigs
- }
- };
- installerStep7Controller.loadServiceTagsSuccess(data, {}, params);
- var result = installerStep7Controller.get("loadedClusterSiteToTagMap");
- expect(JSON.parse(JSON.stringify(result))).to.eql(JSON.parse(JSON.stringify({"site1":"tag1","site2":"tag2","site3":"tag3"})));
- })
- });
- describe('#issuesFilterLinkText', function () {
- issuesFilterCases.forEach(function (item) {
- it(item.title, function () {
- issuesFilterTestSetup(installerStep7Controller, item);
- expect(installerStep7Controller.get('issuesFilterLinkText')).to.equal(item.issuesFilterLinkText);
- })
- });
- });
- describe('#toggleIssuesFilter', function () {
- it('should toggle issues filter', function () {
- var issuesFilter = installerStep7Controller.get('filterColumns').findProperty('attributeName', 'hasIssues');
- issuesFilter.set('selected', false);
- installerStep7Controller.toggleIssuesFilter();
- expect(issuesFilter.get('selected')).to.be.true;
- installerStep7Controller.toggleIssuesFilter();
- expect(issuesFilter.get('selected')).to.be.false;
- });
- it('selected service should be changed', function () {
- installerStep7Controller.setProperties({
- selectedService: {
- errorCount: 0,
- configGroups: []
- },
- stepConfigs: [
- {
- errorCount: 1,
- configGroups: []
- },
- {
- errorCount: 2,
- configGroups: []
- }
- ]
- });
- installerStep7Controller.toggleIssuesFilter();
- expect(installerStep7Controller.get('selectedService')).to.eql({
- errorCount: 1,
- configGroups: []
- });
- });
- });
- describe('#addKerberosDescriptorConfigs', function() {
- beforeEach(function() {
- sinon.stub(App.config, 'kerberosIdentitiesDescription');
- });
- afterEach(function() {
- App.config.kerberosIdentitiesDescription.restore();
- });
- var configs = [
- { name: 'prop1', displayName: 'Prop1', description: 'd1' },
- { name: 'prop2', displayName: 'Prop2', description: 'd1' },
- { name: 'prop3', displayName: 'Prop3', description: 'd1' }
- ];
- var descriptor = [
- Em.Object.create({ name: 'prop4', filename: 'file-1'}),
- Em.Object.create({ name: 'prop1', filename: 'file-1'})
- ];
- var propertiesAttrTests = [
- {
- attr: 'isUserProperty', val: false,
- m: 'descriptor properties should not be marked as custom'
- },
- {
- attr: 'category', val: 'Advanced file-1',
- m: 'descriptor properties should be added to Advanced category'
- },
- {
- attr: 'isOverridable', val: false,
- m: 'descriptor properties should not be overriden'
- }
- ];
- propertiesAttrTests.forEach(function(test) {
- it(test.m, function() {
- installerStep7Controller.addKerberosDescriptorConfigs(configs, descriptor);
- expect(configs.findProperty('name', 'prop1')[test.attr]).to.be.eql(test.val);
- });
- });
- });
- describe('#addHawqConfigsOnNnHa', function () {
- var configs = [
- {
- id: 'dfs.nameservices__hdfs-site',
- description: 'dfs.nameservices__hdfs-site',
- displayName: 'dfs.nameservices',
- displayType: 'string',
- name: 'dfs.nameservices',
- value: 'haservice',
- recommendedValue: 'haservice'
- },
- {
- id: 'dfs.ha.namenodes.haservice__hdfs-site',
- description: 'dfs.ha.namenodes.haservice__hdfs-site',
- displayName: 'dfs.ha.namenodes.haservice',
- displayType: 'string',
- name: 'dfs.ha.namenodes.haservice',
- value: 'nn1,nn2',
- recommendedValue: 'nn1,nn2'
- },
- {
- id: 'dfs.namenode.rpc-address.haservice.nn1__hdfs-site',
- description: 'dfs.namenode.rpc-address.haservice.nn1__hdfs-site',
- displayName: 'dfs.namenode.rpc-address.haservice.nn1',
- displayType: 'string',
- name: 'dfs.namenode.rpc-address.haservice.nn1',
- value: 'c6401.ambari.apache.org:8020',
- recommendedValue: 'c6401.ambari.apache.org:8020'
- },
- {
- id: 'dfs.namenode.rpc-address.haservice.nn2__hdfs-site',
- description: 'dfs.namenode.rpc-address.haservice.nn2__hdfs-site',
- displayName: 'dfs.namenode.rpc-address.haservice.nn2',
- displayType: 'string',
- name: 'dfs.namenode.rpc-address.haservice.nn2',
- value: 'c6402.ambari.apache.org:8020',
- recommendedValue: 'c6402.ambari.apache.org:8020'
- },
- {
- id: 'dfs.namenode.http-address.haservice.nn1__hdfs-site',
- description: 'dfs.namenode.http-address.haservice.nn1__hdfs-site',
- displayName: 'dfs.namenode.http-address.haservice.nn1',
- displayType: 'string',
- name: 'dfs.namenode.http-address.haservice.nn1',
- value: 'c6401.ambari.apache.org:50070',
- recommendedValue: 'c6401.ambari.apache.org:50070'
- },
- {
- id: 'dfs.namenode.http-address.haservice.nn2__hdfs-site',
- description: 'dfs.namenode.http-address.haservice.nn2__hdfs-site',
- displayName: 'dfs.namenode.http-address.haservice.nn2',
- displayType: 'string',
- name: 'dfs.namenode.http-address.haservice.nn2',
- value: 'c6402.ambari.apache.org:50070',
- recommendedValue: 'c6402.ambari.apache.org:50070'
- }
- ];
- var oldConfigs = configs.slice();
- it('should copy properties from hdfs-site to hdfs-client for HAWQ', function() {
- installerStep7Controller.addHawqConfigsOnNnHa(configs);
- // ensure 6 new configs were added
- expect(configs.length).to.be.equal(oldConfigs.length + 6);
- });
- describe('find the same property in hdfs-client for HAWQ and see if attribute value matches with the corresponding property\'s attribute value in hdfs-site', function () {
- oldConfigs.forEach(function(property) {
- var id = property.name + '__hdfs-client';
- it(id, function () {
- expect(configs.findProperty('id', id).description).to.be.equal(property.description);
- expect(configs.findProperty('id', id).displayName).to.be.equal(property.displayName);
- expect(configs.findProperty('id', id).value).to.be.equal(property.value);
- expect(configs.findProperty('id', id).recommendedValue).to.be.equal(property.recommendedValue);
- });
- });
- });
- });
- describe('#addHawqConfigsOnRMHa', function () {
- var configs = [
- {
- id: 'yarn.resourcemanager.hostname.rm1__yarn-site',
- name: 'yarn.resourcemanager.hostname.rm1',
- value: 'c6401.ambari.apache.org',
- recommendedValue: 'c6401.ambari.apache.org'
- },
- {
- id: 'yarn.resourcemanager.hostname.rm2__yarn-site',
- name: 'yarn.resourcemanager.hostname.rm2',
- value: 'c6402.ambari.apache.org',
- recommendedValue: 'c6402.ambari.apache.org'
- }
- ];
- beforeEach(function () {
- this.inputConfigsCount = configs.length;
- installerStep7Controller.addHawqConfigsOnRMHa(configs);
- this.yarnRmDetails = configs.findProperty('id', 'yarn.resourcemanager.ha__yarn-client');
- this.yarnRmSchedulerDetails = configs.findProperty('id', 'yarn.resourcemanager.scheduler.ha__yarn-client');
- });
- it('should update properties in yarn-client for HAWQ if yarn ha is enabled', function() {
- var noOfConfigsAdded = 2;
- expect(configs.length).to.be.equal(this.inputConfigsCount + noOfConfigsAdded);
- });
- it('yarn.resourcemanager.ha__yarn-client', function() {
- var expectedYarnRmHaValue = 'c6401.ambari.apache.org:8032,c6402.ambari.apache.org:8032';
- expect(this.yarnRmDetails.value).to.be.equal(expectedYarnRmHaValue);
- expect(this.yarnRmDetails.recommendedValue).to.be.equal(expectedYarnRmHaValue);
- expect(this.yarnRmDetails.displayName).to.be.equal('yarn.resourcemanager.ha');
- expect(this.yarnRmDetails.description).to.be.equal('Comma separated yarn resourcemanager host addresses with port');
- });
- it('yarn.resourcemanager.scheduler.ha__yarn-client', function() {
- var expectedYarnRmSchedulerValue = 'c6401.ambari.apache.org:8030,c6402.ambari.apache.org:8030';
- expect(this.yarnRmSchedulerDetails.value).to.be.equal(expectedYarnRmSchedulerValue);
- expect(this.yarnRmSchedulerDetails.recommendedValue).to.be.equal(expectedYarnRmSchedulerValue);
- expect(this.yarnRmSchedulerDetails.displayName).to.be.equal('yarn.resourcemanager.scheduler.ha');
- expect(this.yarnRmSchedulerDetails.description).to.be.equal('Comma separated yarn resourcemanager scheduler addresses with port');
- });
- });
- describe('#errorsCount', function () {
- it('should ignore configs with widgets (enhanced configs)', function () {
- installerStep7Controller.reopen({selectedService: Em.Object.create({
- configsWithErrors: Em.A([
- Em.Object.create({widget: {}}),
- Em.Object.create({widget: null})
- ])
- })
- });
- expect(installerStep7Controller.get('errorsCount')).to.equal(1);
- });
- });
- describe('#_reconfigureServicesOnNnHa', function () {
- var dfsNameservices = 'some_cluster';
- Em.A([
- {
- serviceName: 'HBASE',
- configToUpdate: 'hbase.rootdir',
- oldValue: 'hdfs://nameserv:8020/apps/hbase/data',
- expectedNewValue: 'hdfs://' + dfsNameservices + '/apps/hbase/data'
- },
- {
- serviceName: 'ACCUMULO',
- configToUpdate: 'instance.volumes',
- oldValue: 'hdfs://localhost:8020/apps/accumulo/data',
- expectedNewValue: 'hdfs://' + dfsNameservices + '/apps/accumulo/data'
- },
- {
- serviceName: 'HAWQ',
- configToUpdate: 'hawq_dfs_url',
- oldValue: 'localhost:8020/hawq_data',
- expectedNewValue: dfsNameservices + '/hawq_data'
- }
- ]).forEach(function (test) {
- var serviceConfigs = [App.ServiceConfig.create({
- serviceName: test.serviceName,
- configs: [
- Em.Object.create({
- name: test.configToUpdate,
- value: test.oldValue
- })
- ]
- }),
- App.ServiceConfig.create({
- serviceName: 'HDFS',
- configs: [
- Em.Object.create({
- name: 'dfs.nameservices',
- value: dfsNameservices
- })
- ]
- })];
- it(test.serviceName + ' ' + test.configToUpdate, function () {
- installerStep7Controller.reopen({
- selectedServiceNames: [test.serviceName, 'HDFS']
- });
- serviceConfigs = installerStep7Controller._reconfigureServicesOnNnHa(serviceConfigs);
- expect(serviceConfigs.findProperty('serviceName', test.serviceName).configs.findProperty('name', test.configToUpdate).get('value')).to.equal(test.expectedNewValue);
- });
- });
- });
- describe('#showOozieDerbyWarning', function() {
- var controller;
- beforeEach(function() {
- controller = App.WizardStep7Controller.create({});
- sinon.stub(App.ModalPopup, 'show', Em.K);
- });
- afterEach(function() {
- App.ModalPopup.show.restore();
- });
- Em.A([
- {
- selectedServiceNames: ['HDFS', 'OOZIE'],
- databaseType: Em.I18n.t('installer.step7.oozie.database.new'),
- e: true,
- m: 'Oozie selected with derby database, warning popup should be shown'
- },
- {
- selectedServiceNames: ['HDFS'],
- databaseType: Em.I18n.t('installer.step7.oozie.database.new'),
- e: false,
- m: 'Oozie not selected warning popup should be skipped'
- },
- {
- selectedServiceNames: ['HDFS', 'OOZIE'],
- databaseType: 'New Mysql Database',
- e: false,
- m: 'Oozie selected, mysql database used, warning popup should be sk'
- }
- ]).forEach(function(test) {
- describe(test.m, function() {
- beforeEach(function () {
- sinon.stub(App.config, 'findConfigProperty').returns(Em.Object.create({ value: test.databaseType}));
- controller.reopen({
- selectedServiceNames: test.selectedServiceNames
- });
- controller.showOozieDerbyWarningPopup(Em.K);
- });
- afterEach(function () {
- App.config.findConfigProperty.restore();
- });
- it('modal popup is shown needed number of times', function () {
- expect(App.ModalPopup.show.calledOnce).to.equal(test.e);
- });
- });
- });
- });
- describe('#addHostNamesToConfigs', function() {
- beforeEach(function () {
- sinon.stub(App.StackServiceComponent, 'find', function () {
- return Em.Object.create({
- id: 'NAMENODE',
- displayName: 'NameNode'
- });
- });
- });
- afterEach(function () {
- App.StackServiceComponent.find.restore();
- });
- it('should not create duplicate configs', function () {
- var serviceConfig = Em.Object.create({
- configs: [],
- serviceName: 'HDFS',
- configCategories: [
- {
- showHost: true,
- name: 'NAMENODE'
- }
- ]
- });
- var masterComponents = [
- {component: 'NAMENODE', hostName: 'h1'}
- ];
- var slaveComponents = [];
- installerStep7Controller.addHostNamesToConfigs(serviceConfig, masterComponents, slaveComponents);
- expect(serviceConfig.get('configs').filterProperty('name', 'namenode_host').length).to.equal(1);
- installerStep7Controller.addHostNamesToConfigs(serviceConfig, masterComponents, slaveComponents);
- expect(serviceConfig.get('configs').filterProperty('name', 'namenode_host').length).to.equal(1);
- });
- });
- describe('#resolveHiveMysqlDatabase', function () {
- beforeEach(function () {
- installerStep7Controller.get('content').setProperties({
- services: Em.A([
- Em.Object.create({serviceName: 'HIVE', isSelected: true, isInstalled: false})
- ])
- });
- installerStep7Controller.setProperties({
- stepConfigs: Em.A([
- Em.Object.create({serviceName: 'HIVE', configs: [{name: 'hive_database', value: 'New MySQL Database'}]})
- ]),
- mySQLServerConflict: true
- });
- sinon.stub(installerStep7Controller, 'moveNext', Em.K);
- sinon.stub(installerStep7Controller, 'checkMySQLHost', function () {
- return $.Deferred().resolve();
- });
- sinon.spy(App.ModalPopup, 'show');
- });
- afterEach(function () {
- installerStep7Controller.moveNext.restore();
- installerStep7Controller.checkMySQLHost.restore();
- App.ModalPopup.show.restore();
- });
- it('no HIVE service', function () {
- installerStep7Controller.set('content.services', Em.A([]));
- installerStep7Controller.resolveHiveMysqlDatabase();
- expect(installerStep7Controller.moveNext.calledOnce).to.be.true;
- expect(App.ModalPopup.show.called).to.be.false;
- });
- it('if mySQLServerConflict, popup is shown', function () {
- installerStep7Controller.resolveHiveMysqlDatabase();
- expect(installerStep7Controller.moveNext.called).to.be.false;
- expect(App.ModalPopup.show.calledOnce).to.be.true;
- });
- });
- describe('#mySQLWarningHandler', function () {
- beforeEach(function () {
- installerStep7Controller.set('mySQLServerConflict', true);
- sinon.spy(App.ModalPopup, 'show');
- sinon.stub(App.router, 'get').returns({gotoStep: Em.K});
- sinon.stub(App.router.get(), 'gotoStep', Em.K);
- });
- afterEach(function () {
- App.ModalPopup.show.restore();
- App.router.get().gotoStep.restore();
- App.router.get.restore();
- });
- it('warning popup is shown', function () {
- installerStep7Controller.mySQLWarningHandler();
- expect(App.ModalPopup.show.calledOnce).to.be.true;
- });
- it('submitButtonClicked is set to false on primary click', function () {
- installerStep7Controller.mySQLWarningHandler().onPrimary();
- expect(installerStep7Controller.get('submitButtonClicked')).to.be.false;
- });
- it('second popup is shown on secondary click', function () {
- installerStep7Controller.mySQLWarningHandler().onSecondary();
- expect(App.ModalPopup.show.calledTwice).to.be.true;
- });
- it('submitButtonClicked is set to false on secondary click on the second popup', function () {
- installerStep7Controller.mySQLWarningHandler().onSecondary().onSecondary();
- expect(installerStep7Controller.get('submitButtonClicked')).to.be.false;
- });
- it('user is moved to step5 on primary click on the second popup (installerController)', function () {
- installerStep7Controller.set('content.controllerName', 'installerController');
- installerStep7Controller.mySQLWarningHandler().onSecondary().onPrimary();
- expect(App.router.get('installerController').gotoStep.calledWith(5, true)).to.be.true;
- });
- it('user is moved to step2 on primary click on the second popup (addSeviceController)', function () {
- installerStep7Controller.set('content.controllerName', 'addServiceController');
- installerStep7Controller.mySQLWarningHandler().onSecondary().onPrimary();
- expect(App.router.get('addSeviceController').gotoStep.calledWith(2, true)).to.be.true;
- });
- });
- describe('#supportsPreInstallChecks', function () {
- beforeEach(function () {
- this.stub = sinon.stub(App, 'get');
- });
- afterEach(function () {
- this.stub.restore();
- });
- Em.A([
- {preInstallChecks: true, controllerName: 'installerController', e: true},
- {preInstallChecks: true, controllerName: '', e: false},
- {preInstallChecks: false, controllerName: 'installerController', e: false},
- {preInstallChecks: false, controllerName: '', e: false}
- ]).forEach(function (test) {
- it(JSON.stringify(test), function () {
- this.stub.withArgs('supports.preInstallChecks').returns(test.preInstallChecks);
- installerStep7Controller.set('content', {controllerName: test.controllerName});
- installerStep7Controller.propertyDidChange('supportsPreInstallChecks');
- expect(installerStep7Controller.get('supportsPreInstallChecks')).to.be.equal(test.e);
- });
- });
- });
- describe('#getHash', function () {
- var stepConfigs = [
- {
- configs: [
- Em.Object.create({name: 's1c1', isFinal: true, value: 'v11'}),
- Em.Object.create({name: 's1c2', isFinal: false, value: 'v12', overrides: []}),
- Em.Object.create({name: 's1c3', isFinal: true, value: 'v13', overrides: [
- Em.Object.create({value: 'v131'})
- ]})
- ]
- },
- {
- configs: [
- Em.Object.create({name: 's2c1', isFinal: true, value: 'v21'}),
- Em.Object.create({name: 's2c2', isFinal: false, value: 'v22', overrides: []}),
- Em.Object.create({name: 's2c3', isFinal: true, value: 'v23', overrides: [
- Em.Object.create({value: 'v231'})
- ]})
- ]
- }
- ];
- beforeEach(function () {
- installerStep7Controller.set('stepConfigs', stepConfigs);
- this.hash = installerStep7Controller.getHash();
- });
- it('should map value, isFinal and overrides values', function () {
- var expected = JSON.stringify({
- s1c1: {
- value: 'v11',
- overrides: [],
- isFinal: true
- },
- s1c2: {
- value: 'v12',
- overrides: [],
- isFinal: false
- },
- s1c3: {
- value: 'v13',
- overrides: ['v131'],
- isFinal: true
- },
- s2c1: {
- value: 'v21',
- overrides: [],
- isFinal: true
- },
- s2c2: {
- value: 'v22',
- overrides: [],
- isFinal: false
- },
- s2c3: {
- value: 'v23',
- overrides: ['v231'],
- isFinal: true
- }
- });
- expect(this.hash).to.be.equal(expected);
- });
- });
- describe('#updateHostOverrides', function () {
- var configProperty;
- var storedConfigProperty;
- beforeEach(function () {
- configProperty = Em.Object.create({});
- storedConfigProperty = {
- overrides: [
- {value: 'v1'}
- ]
- };
- installerStep7Controller.updateHostOverrides(configProperty, storedConfigProperty);
- });
- it('override is valid', function () {
- var override = configProperty.get('overrides.0');
- expect(override.get('value')).to.be.equal('v1');
- expect(override.get('isOriginalSCP')).to.be.false;
- expect(override.get('parentSCP')).to.be.eql(configProperty);
- });
- });
- describe('#allowUpdateProperty', function () {
- it('true if it is installer', function () {
- installerStep7Controller.set('wizardController', {name: 'installerController'});
- expect(installerStep7Controller.allowUpdateProperty([], '', '')).to.be.true;
- });
- it('true if it is parentProperties are not empty', function () {
- installerStep7Controller.set('wizardController', {name: 'some'});
- expect(installerStep7Controller.allowUpdateProperty([{}], '', '')).to.be.true;
- });
- describe('#addServiceController', function () {
- beforeEach(function () {
- installerStep7Controller.set('wizardController', {name: 'addServiceController'});
- this.stub = sinon.stub(App.configsCollection, 'getConfigByName');
- sinon.stub(App.config, 'get').withArgs('serviceByConfigTypeMap').returns({
- 't1': Em.Object.create({serviceName: 's1'}),
- 't2': Em.Object.create({serviceName: 's2'})
- })
- });
- afterEach(function () {
- App.configsCollection.getConfigByName.restore();
- App.config.get.restore();
- });
- it('stackProperty does not exist', function () {
- this.stub.returns(null);
- expect(installerStep7Controller.allowUpdateProperty([], '', '')).to.be.true;
- });
- it('installedServices does not contain stackProperty.serviceName', function () {
- this.stub.returns({serviceName: 's1'});
- installerStep7Controller.set('installedServices', {});
- expect(installerStep7Controller.allowUpdateProperty([], '', '')).to.be.true;
- });
- it('stackProperty.propertyDependsOn is empty', function () {
- installerStep7Controller.reopen({installedServices: {s1: true}});
- this.stub.returns({serviceName: 's1', propertyDependsOn: []});
- expect(installerStep7Controller.allowUpdateProperty([], '', '')).to.be.false;
- });
- it('stackProperty.propertyDependsOn is not empty', function () {
- installerStep7Controller.reopen({installedServices: {s1: true}});
- this.stub.returns({serviceName: 's1', propertyDependsOn: [
- {type: 't1'},
- {type: 't2'}
- ]});
- expect(installerStep7Controller.allowUpdateProperty([], '', '')).to.be.true;
- });
- it('stackProperty.propertyDependsOn is not empty (2)', function () {
- installerStep7Controller.reopen({installedServices: {s1: true}});
- this.stub.returns({serviceName: 's1', propertyDependsOn: [
- {type: 't1'},
- {type: 't1'}
- ]});
- expect(installerStep7Controller.allowUpdateProperty([], '', '')).to.be.false;
- });
- });
- it('true if it is not installer or addService', function () {
- installerStep7Controller.set('wizardController', {name: 'some'});
- expect(installerStep7Controller.allowUpdateProperty([], '', '')).to.be.true;
- });
- });
- });
|