瀏覽代碼

AMBARI-9809. Move Hive Metastore problems after rollback completed. (akovalenko)

Aleksandr Kovalenko 10 年之前
父節點
當前提交
e8c1bbe745

+ 1 - 0
ambari-web/app/assets/test/tests.js

@@ -94,6 +94,7 @@ var files = ['test/init_model_test',
   'test/controllers/main/service/reassign/step2_controller_test',
   'test/controllers/main/service/reassign/step4_controller_test',
   'test/controllers/main/service/reassign/step6_controller_test',
+  'test/controllers/main/service/reassign/step7_controller_test',
   'test/controllers/main/dashboard_test',
   'test/controllers/main/host_test',
   'test/controllers/main/service/item_test',

+ 1 - 0
ambari-web/app/controllers/main/service/reassign/step7_controller.js

@@ -49,6 +49,7 @@ App.ReassignMasterWizardStep7Controller = App.ReassignMasterWizardStep4Controlle
     }
 
     this.removeUnneededTasks();
+    this.set('isLoaded', true);
   },
 
   putHostComponentsInMaintenanceMode: function () {

+ 2 - 1
ambari-web/app/routes/reassign_master_routes.js

@@ -40,7 +40,6 @@ module.exports = App.WizardRoute.extend({
     console.log('in /service/reassign:enter');
     var context = this;
     var reassignMasterController = router.get('reassignMasterController');
-    var currStep = reassignMasterController.get('currentStep');
 
     reassignMasterController.dataLoading().done(function () {
       if (App.router.get('mainHostController.hostsCountMap.TOTAL') > 1) {
@@ -62,6 +61,7 @@ module.exports = App.WizardRoute.extend({
               App.router.transitionTo('main.services.index');
             },
             onClose: function () {
+              var currStep = reassignMasterController.get('currentStep');
               if (parseInt(currStep) > 3) {
                 var self = this;
 
@@ -92,6 +92,7 @@ module.exports = App.WizardRoute.extend({
           reassignMasterController.set('popup', popup);
           reassignMasterController.loadSecurityEnabled();
           reassignMasterController.loadComponentToReassign();
+          var currStep = reassignMasterController.get('currentStep');
           var currentClusterStatus = App.clusterStatus.get('value');
           if (currentClusterStatus) {
             switch (currentClusterStatus.clusterState) {

+ 50 - 0
ambari-web/test/controllers/main/service/reassign/step7_controller_test.js

@@ -0,0 +1,50 @@
+/**
+ * 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.
+ */
+
+App = require('app');
+
+require('controllers/main/service/reassign/step7_controller');
+
+describe('App.ReassignMasterWizardStep7Controller', function () {
+
+  var controller = App.ReassignMasterWizardStep7Controller.create({
+    content: Em.Object.create({
+      reassign: Em.Object.create(),
+      reassignHosts: Em.Object.create()
+    })
+  });
+
+  beforeEach(function () {
+    sinon.stub(App.ajax, 'send', Em.K);
+  });
+  afterEach(function () {
+    App.ajax.send.restore();
+  });
+
+  describe('#initializeTasks()', function () {
+
+    it('should set isLoaded to true', function () {
+      controller.set('isLoaded', false);
+
+      controller.initializeTasks();
+      expect(controller.get('isLoaded')).to.be.true;
+    });
+
+  });
+
+});