Repository: ambari Updated Branches: refs/heads/trunk 942ad74ea -> bd3a0bb72
http://git-wip-us.apache.org/repos/asf/ambari/blob/bd3a0bb7/ambari-web/test/views/main/dashboard/widgets/jobtracker_uptime_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/main/dashboard/widgets/jobtracker_uptime_test.js b/ambari-web/test/views/main/dashboard/widgets/jobtracker_uptime_test.js deleted file mode 100644 index 820c653..0000000 --- a/ambari-web/test/views/main/dashboard/widgets/jobtracker_uptime_test.js +++ /dev/null @@ -1,95 +0,0 @@ -/** - * 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('messages'); -require('views/main/dashboard/widgets/jobtracker_uptime'); -require('views/main/dashboard/widgets/text_widget'); -require('views/main/dashboard/widget'); - -describe('App.JobTrackerUptimeView', function() { - - var tests = [ - { - model: Em.Object.create({ - jobTrackerStartTime: ((new Date()).getTime() - 192.1*24*3600*1000) - }), - e: { - isRed: false, - isOrange: false, - isGreen: true, - isNA: false, - content: '192.1 d', - data: 192.1 - } - }, - { - model: Em.Object.create({ - jobTrackerStartTime: 0 - }), - e: { - isRed: false, - isOrange: false, - isGreen: false, - isNA: true, - content: Em.I18n.t('services.service.summary.notAvailable'), - data: null - } - }, - { - model: Em.Object.create({ - jobTrackerStartTime: null - }), - e: { - isRed: false, - isOrange: false, - isGreen: false, - isNA: true, - content: Em.I18n.t('services.service.summary.notAvailable'), - data: null - } - } - ]; - - tests.forEach(function(test) { - describe('jobTrackerStartTime - ' + test.model.jobTrackerStartTime, function() { - var jobTrackerUptimeView = App.JobTrackerUptimeView.create({model_type:null, model: test.model}); - jobTrackerUptimeView.calc(); - it('content', function() { - expect(jobTrackerUptimeView.get('content')).to.equal(test.e.content); - }); - it('data', function() { - expect(jobTrackerUptimeView.get('data')).to.equal(test.e.data); - }); - it('isRed', function() { - expect(jobTrackerUptimeView.get('isRed')).to.equal(test.e.isRed); - }); - it('isOrange', function() { - expect(jobTrackerUptimeView.get('isOrange')).to.equal(test.e.isOrange); - }); - it('isGreen', function() { - expect(jobTrackerUptimeView.get('isGreen')).to.equal(test.e.isGreen); - }); - it('isNA', function() { - expect(jobTrackerUptimeView.get('isNA')).to.equal(test.e.isNA); - }); - }); - }); - -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/bd3a0bb7/ambari-web/test/views/main/dashboard/widgets/tasktracker_live_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/main/dashboard/widgets/tasktracker_live_test.js b/ambari-web/test/views/main/dashboard/widgets/tasktracker_live_test.js deleted file mode 100644 index 50d0123..0000000 --- a/ambari-web/test/views/main/dashboard/widgets/tasktracker_live_test.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * 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('views/main/dashboard/widget'); -require('views/main/dashboard/widgets/text_widget'); -require('views/main/dashboard/widgets/tasktracker_live'); - -describe('App.TaskTrackerUpView', function() { - - var tests = [ - { - data: 100, - e: { - isRed: false, - isOrange: false, - isGreen: true - } - }, - { - data: 0, - e: { - isRed: true, - isOrange: false, - isGreen: false - } - }, - { - data: 50, - e: { - isRed: false, - isOrange: true, - isGreen: false - } - } - ]; - - tests.forEach(function(test) { - describe('', function() { - var taskTrackerUpView = App.TaskTrackerUpView.create({model_type:null, data: test.data, content: test.data.toString()}); - it('isRed', function() { - expect(taskTrackerUpView.get('isRed')).to.equal(test.e.isRed); - }); - it('isOrange', function() { - expect(taskTrackerUpView.get('isOrange')).to.equal(test.e.isOrange); - }); - it('isGreen', function() { - expect(taskTrackerUpView.get('isGreen')).to.equal(test.e.isGreen); - }); - }); - }); - -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/bd3a0bb7/ambari-web/test/views/main/dashboard/widgets_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/views/main/dashboard/widgets_test.js b/ambari-web/test/views/main/dashboard/widgets_test.js index 8a2023c..19050c6 100644 --- a/ambari-web/test/views/main/dashboard/widgets_test.js +++ b/ambari-web/test/views/main/dashboard/widgets_test.js @@ -31,21 +31,19 @@ describe('App.MainDashboardWidgetsView', function () { describe('#setInitPrefObject', function () { var host_metrics_widgets_count = 4; var hdfs_widgets_count = 7; - var mapreduce_widgets_count = 7; var hbase_widgets_count = 4; var yarn_widgets_count = 4; - var total_widgets_count = 27; + var total_widgets_count = 20; var tests = Em.A([ { models: { host_metrics_model: null, hdfs_model: null, - mapreduce_model: null, hbase_model: null, yarn_model: null }, e: { - visibleL: total_widgets_count - host_metrics_widgets_count - hdfs_widgets_count - mapreduce_widgets_count - hbase_widgets_count - yarn_widgets_count - 1, + visibleL: total_widgets_count - host_metrics_widgets_count - hdfs_widgets_count - hbase_widgets_count - yarn_widgets_count - 1, hiddenL: 0 }, m: 'All models are null' @@ -54,35 +52,32 @@ describe('App.MainDashboardWidgetsView', function () { models: { host_metrics_model: {}, hdfs_model: null, - mapreduce_model: null, hbase_model: null, yarn_model: null }, e: { - visibleL: total_widgets_count - hdfs_widgets_count - mapreduce_widgets_count - hbase_widgets_count - yarn_widgets_count - 1, + visibleL: total_widgets_count - hdfs_widgets_count - hbase_widgets_count - yarn_widgets_count - 1, hiddenL: 0 }, - m: 'hdfs_model, mapreduce_model, hbase_model, yarn_model are null' + m: 'hdfs_model, hbase_model, yarn_model are null' }, { models: { host_metrics_model: {}, hdfs_model: {}, - mapreduce_model: null, hbase_model: null, yarn_model: null }, e: { - visibleL: total_widgets_count - mapreduce_widgets_count - hbase_widgets_count - yarn_widgets_count - 1, + visibleL: total_widgets_count - hbase_widgets_count - yarn_widgets_count - 1, hiddenL: 0 }, - m: 'mapreduce_model, hbase_model, yarn_model are null' + m: 'hbase_model, yarn_model are null' }, { models: { host_metrics_model: {}, hdfs_model: {}, - mapreduce_model: {}, hbase_model: null, yarn_model: null }, @@ -96,7 +91,6 @@ describe('App.MainDashboardWidgetsView', function () { models: { host_metrics_model: {}, hdfs_model: {}, - mapreduce_model: {}, hbase_model: {}, yarn_model: null }, @@ -110,7 +104,6 @@ describe('App.MainDashboardWidgetsView', function () { models: { host_metrics_model: {}, hdfs_model: {}, - mapreduce_model: {}, hbase_model: {}, yarn_model: {} }, @@ -125,7 +118,6 @@ describe('App.MainDashboardWidgetsView', function () { it(test.m, function () { view.set('host_metrics_model', test.models.host_metrics_model); view.set('hdfs_model', test.models.hdfs_model); - view.set('mapreduce_model', test.models.mapreduce_model); view.set('hbase_model', test.models.hbase_model); view.set('yarn_model', test.models.yarn_model); view.setInitPrefObject();
