Repository: ambari Updated Branches: refs/heads/branch-2.4 1550ba696 -> 578f1563e
AMBARI-17469. Hive and Oozie db displayed incorrectly on the installer review page (alexantonenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/578f1563 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/578f1563 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/578f1563 Branch: refs/heads/branch-2.4 Commit: 578f1563ee854b92c214d95781a5b0954a8723a2 Parents: 1550ba6 Author: Alex Antonenko <[email protected]> Authored: Wed Jul 6 19:15:51 2016 +0300 Committer: Alex Antonenko <[email protected]> Committed: Wed Jul 6 19:17:18 2016 +0300 ---------------------------------------------------------------------- .../app/controllers/wizard/step8_controller.js | 8 ++-- .../test/controllers/wizard/step8_test.js | 41 ++++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/578f1563/ambari-web/app/controllers/wizard/step8_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js index 3971cf5..f5c92ec 100644 --- a/ambari-web/app/controllers/wizard/step8_controller.js +++ b/ambari-web/app/controllers/wizard/step8_controller.js @@ -523,9 +523,11 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz */ loadDbValue: function (serviceName) { var serviceConfigProperties = this.get('wizardController').getDBProperty('serviceConfigProperties'); - var dbFull = serviceConfigProperties.findProperty('name', serviceName.toLowerCase() + '_database'), - db = serviceConfigProperties.findProperty('name', serviceName.toLowerCase() + '_ambari_database'); - return db && dbFull ? db.value + ' (' + dbFull.value + ')' : ''; + var dbFull = serviceConfigProperties.findProperty('name', serviceName.toLowerCase() + '_database'); + //db = serviceConfigProperties.findProperty('name', serviceName.toLowerCase() + '_ambari_database'); + //since db.value contains the intial default value of <service>_admin_database (MySQL) and not the actual db type selected, + //ignore the value when displaying the database name on the summary page + return dbFull ? dbFull.value : ''; }, /** http://git-wip-us.apache.org/repos/asf/ambari/blob/578f1563/ambari-web/test/controllers/wizard/step8_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/wizard/step8_test.js b/ambari-web/test/controllers/wizard/step8_test.js index 74e042b..6bad1fb 100644 --- a/ambari-web/test/controllers/wizard/step8_test.js +++ b/ambari-web/test/controllers/wizard/step8_test.js @@ -894,6 +894,47 @@ describe('App.WizardStep8Controller', function () { }); }); + describe('#loadDbValue', function() { + + beforeEach(function() { + installerStep8Controller.set('wizardController', Em.Object.create({ + getDBProperty: Em.K + })); + this.mock = sinon.stub(installerStep8Controller.get('wizardController'), 'getDBProperty'); + }); + + afterEach(function() { + this.mock.restore(); + }); + + var tests = [ + { + it: "Hive test for Existing Oracle Database", + serviceConfigProperties: [ + {name: 'hive_database', value: 'Existing Oracle Database'} + ], + serviceName: 'HIVE', + result: 'Existing Oracle Database' + }, + { + it: "Oozie test for New Derby Database", + serviceConfigProperties: [ + {name: 'oozie_database', value: 'New Derby Database'} + ], + serviceName: 'OOZIE', + result: 'New Derby Database' + } + ]; + + tests.forEach(function(test) { + it(test.it, function() { + this.mock.returns(test.serviceConfigProperties); + var dbComponent = installerStep8Controller.loadDbValue(test.serviceName); + expect(dbComponent).to.equal(test.result); + }) + }); + }); + describe('#submit', function() { beforeEach(function() { sinon.stub(installerStep8Controller, 'submitProceed', Em.K);
