ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From srima...@apache.org
Subject ambari git commit: AMBARI-10046. Move Wizard has different set of steps for moving Hive Metastore of HiveServer2
Date Thu, 12 Mar 2015 17:58:25 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.0.0 50217684b -> ecaebc287


AMBARI-10046. Move Wizard has different set of steps for moving Hive Metastore of HiveServer2


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ecaebc28
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ecaebc28
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ecaebc28

Branch: refs/heads/branch-2.0.0
Commit: ecaebc287a9f2558461cabb7db3d35266149fdb6
Parents: 5021768
Author: Srimanth Gunturi <sgunturi@hortonworks.com>
Authored: Thu Mar 12 10:34:55 2015 -0700
Committer: Srimanth Gunturi <sgunturi@hortonworks.com>
Committed: Thu Mar 12 10:49:55 2015 -0700

----------------------------------------------------------------------
 .../main/service/reassign/step1_controller.js   |  2 -
 .../service/reassign/step1_controller_test.js   | 69 ++++++++++++++++++++
 2 files changed, 69 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ecaebc28/ambari-web/app/controllers/main/service/reassign/step1_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign/step1_controller.js b/ambari-web/app/controllers/main/service/reassign/step1_controller.js
index 0cd333b..ad8c89a 100644
--- a/ambari-web/app/controllers/main/service/reassign/step1_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step1_controller.js
@@ -104,8 +104,6 @@ App.ReassignMasterWizardStep1Controller = Em.Controller.extend({
 
     if (this.get('content.reassign.component_name') == 'OOZIE_SERVER' && databaseType
!== 'derby') {
       App.router.reassignMasterController.set('content.hasManualSteps', false);
-    } else {
-      App.router.reassignMasterController.set('content.hasManualSteps', true);
     }
 
     var serviceDbProp = this.get('content.reassign.service_id').toLowerCase() + "_database";

http://git-wip-us.apache.org/repos/asf/ambari/blob/ecaebc28/ambari-web/test/controllers/main/service/reassign/step1_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/reassign/step1_controller_test.js b/ambari-web/test/controllers/main/service/reassign/step1_controller_test.js
index c943352..6867056 100644
--- a/ambari-web/test/controllers/main/service/reassign/step1_controller_test.js
+++ b/ambari-web/test/controllers/main/service/reassign/step1_controller_test.js
@@ -103,4 +103,73 @@ describe('App.ReassignMasterWizardStep1Controller', function () {
     });
 
   });
+
+  describe('#onLoadConfigs', function() {
+
+    var controller;
+    var reassignCtrl;
+
+    beforeEach(function() {
+      controller = App.ReassignMasterWizardStep1Controller.create({
+        content: Em.Object.create({
+          reassign: Em.Object.create({
+            'component_name': 'OOZIE_SERVER',
+            'service_id': 'OOZIE'
+          }),
+          services: []
+        })
+      });
+      controller.set('_super', Em.K);
+
+      sinon.stub(controller, 'getDatabaseHost', Em.K);
+      sinon.stub(controller, 'saveDatabaseType', Em.K);
+      sinon.stub(controller, 'saveServiceProperties', Em.K);
+    
+      reassignCtrl = App.router.reassignMasterController;
+      reassignCtrl.set('content.hasManualSteps', true);
+    });
+
+    afterEach(function() {
+      controller.getDatabaseHost.restore();
+      controller.saveDatabaseType.restore();
+      controller.saveServiceProperties.restore();
+    });
+  
+    it('should not set hasManualSteps to false for oozie with derby db', function() {
+      var data = {
+        items: [
+          {
+            properties: {
+              'oozie.service.JPAService.jdbc.driver': 'jdbc:derby:${oozie.data.dir}/${oozie.db.schema.name}-db;create=true'
+            }
+          }
+        ]
+      };
+    
+      expect(reassignCtrl.get('content.hasManualSteps')).to.be.true;
+
+      controller.onLoadConfigs(data);
+
+      expect(reassignCtrl.get('content.hasManualSteps')).to.be.true;
+    });
+  
+    it('should set hasManualSteps to false for oozie without derby db', function() {
+      var data = {
+        items: [
+          {
+            properties: {
+              'oozie.service.JPAService.jdbc.driver': 'mysql'
+            }
+          }
+        ]
+      };
+
+    
+      expect(reassignCtrl.get('content.hasManualSteps')).to.be.true;
+
+      controller.onLoadConfigs(data);
+
+      expect(reassignCtrl.get('content.hasManualSteps')).to.be.false;
+    });
+  });
 });


Mime
View raw message