ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject ambari git commit: AMBARI-17469. Hive and Oozie db displayed incorrectly on the installer review page (alexantonenko)
Date Wed, 06 Jul 2016 16:15:45 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk a6644d245 -> 26d2542d2


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/26d2542d
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/26d2542d
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/26d2542d

Branch: refs/heads/trunk
Commit: 26d2542d213a7d63d90d9296155039232c50c7c1
Parents: a6644d2
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Wed Jul 6 19:15:51 2016 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Wed Jul 6 19:15:51 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/26d2542d/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/26d2542d/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);


Mime
View raw message