Repository: ambari Updated Branches: refs/heads/trunk 77c8f1ff7 -> 29e61ae9c
http://git-wip-us.apache.org/repos/asf/ambari/blob/29e61ae9/ambari-web/app/data/service_components.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/data/service_components.js b/ambari-web/app/data/service_components.js deleted file mode 100644 index f066c46..0000000 --- a/ambari-web/app/data/service_components.js +++ /dev/null @@ -1,423 +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'); - -module.exports = new Ember.Set([ - - { - service_name: 'HDFS', - component_name: 'NAMENODE', - display_name: 'NameNode', - isMaster: true, - isClient: false, - description: 'Master server that manages the file system namespace and regulates access to files by clients' - }, - { - service_name: 'HDFS', - component_name: 'SECONDARY_NAMENODE', - display_name: 'SNameNode', - isMaster: true, - isClient: false, - description: 'Helper to the primary NameNode that is responsible for supporting periodic checkpoints of the HDFS metadata' - }, - { - service_name: 'HDFS', - component_name: 'DATANODE', - display_name: 'DataNode', - isMaster: false, - isClient: false, - description: 'The slave for HDFS' - }, - { - service_name: 'HDFS', - component_name: 'HDFS_CLIENT', - display_name: 'HDFS Client', - isMaster: false, - isClient: true, - description: 'Client component for HDFS' - }, - { - service_name: 'MAPREDUCE', - component_name: 'JOBTRACKER', - display_name: 'JobTracker', - isMaster: true, - isClient: false, - description: 'Central Master service that pushes work (MR tasks) out to available TaskTracker nodes in the cluster' - }, - { - service_name: 'MAPREDUCE', - component_name: 'HISTORYSERVER', - display_name: 'History Server', - isMaster: true, - isClient: false, - description: '' - }, - { - service_name: 'MAPREDUCE', - component_name: 'TASKTRACKER', - display_name: 'TaskTracker', - isMaster: false, - isClient: false, - description: 'The slave for MapReduce' - }, - { - service_name: 'MAPREDUCE', - component_name: 'MAPREDUCE_CLIENT', - display_name: 'MapReduce Client', - isMaster: false, - isClient: true, - description: 'Client component for MapReduce' - }, - { - service_name: 'MAPREDUCE2', - component_name: 'MAPREDUCE2_CLIENT', - display_name: 'MapReduce 2 Client', - isMaster: false, - isClient: true, - description: '' - }, - { - service_name: 'MAPREDUCE2', - component_name: 'HISTORYSERVER', - display_name: 'History Server', - isMaster: true, - isClient: false, - description: '' - }, - { - service_name: 'TEZ', - component_name: 'TEZ_CLIENT', - display_name: 'Tez Client', - isMaster: false, - isClient: true, - description: '' - }, - { - service_name: 'YARN', - component_name: 'RESOURCEMANAGER', - display_name: 'ResourceManager', - isMaster: true, - isClient: false, - description: '' - }, - { - service_name: 'YARN', - component_name: 'YARN_CLIENT', - display_name: 'YARN Client', - isMaster: false, - isClient: true, - description: '' - }, - // @todo uncomment after Application Timeline Server API implementation -// { -// service_name: 'YARN', -// component_name: 'APP_TIMELINE_SERVER', -// display_name: 'App Timeline Server', -// isMaster: true, -// isClient: false, -// stackVersions: ['2.1.1'], -// description: '' -// }, - { - service_name: 'YARN', - component_name: 'NODEMANAGER', - display_name: 'NodeManager', - isMaster: false, - isClient: false, - description: '' - }, - { - service_name: 'ZOOKEEPER', - component_name: 'ZOOKEEPER_SERVER', - display_name: 'ZooKeeper', - isMaster: true, - isClient: false, - description: '' - }, - { - service_name: 'ZOOKEEPER', - component_name: 'ZOOKEEPER_CLIENT', - display_name: 'ZooKeeper Client', - isMaster: false, - isClient: true, - description: '' - }, - { - service_name: 'HBASE', - component_name: 'HBASE_MASTER', - display_name: 'HBase Master', - isMaster: true, - isClient: false, - description: '' - }, - { - service_name: 'HBASE', - component_name: 'HBASE_REGIONSERVER', - display_name: 'RegionServer', - isMaster: false, - isClient: false, - description: 'The slave for HBase' - }, - { - service_name: 'HBASE', - component_name: 'HBASE_CLIENT', - display_name: 'HBase Client', - isMaster: false, - isClient: true, - description: 'The slave for HBase' - }, - { - service_name: 'PIG', - component_name: 'PIG', - display_name: 'Pig', - isMaster: false, - isClient: true, - description: '' - }, - { - service_name: 'SQOOP', - component_name: 'SQOOP', - display_name: 'Sqoop', - isMaster: false, - isClient: true, - description: '' - }, - { - service_name: 'OOZIE', - component_name: 'OOZIE_SERVER', - display_name: 'Oozie Server', - isMaster: true, - isClient: false, - description: '' - }, - { - service_name: 'OOZIE', - component_name: 'OOZIE_CLIENT', - display_name: 'Oozie Client', - isMaster: false, - isClient: true, - description: '' - }, - { - service_name: 'HIVE', - component_name: 'HIVE_SERVER', - display_name: 'HiveServer2', - isMaster: true, - isClient: false, - description: '' - }, - { - service_name: 'HIVE', - component_name: 'HIVE_METASTORE', - display_name: 'Hive Metastore', - isMaster: true, - isClient: false, - description: '' - }, - { - service_name: 'HIVE', - component_name: 'HIVE_CLIENT', - display_name: 'Hive Client', - isMaster: false, - isClient: true, - description: '' - }, - { - service_name: 'HIVE', - component_name: 'MYSQL_SERVER', - display_name: 'MySQL Server for Hive', - isMaster: false, - isClient: false, - description: '' - }, - { - service_name: 'HCATALOG', - component_name: 'HCAT', - display_name: 'HCat Client', - isMaster: false, - isClient: true, - description: '' - }, - { - service_name: 'WEBHCAT', - component_name: 'WEBHCAT_SERVER', - display_name: 'WebHCat Server', - isMaster: true, - isClient: false, - description: '' - }, - { - service_name: 'DASHBOARD', - component_name: 'DASHBOARD', - display_name: 'Monitoring Dashboard', - isMaster: false, - isClient: false, - description: '' - }, - { - service_name: 'NAGIOS', - component_name: 'NAGIOS_SERVER', - display_name: 'Nagios Server', - isMaster: true, - isClient: false, - description: '' - }, - { - service_name: 'GANGLIA', - component_name: 'GANGLIA_SERVER', - display_name: 'Ganglia Server', - isMaster: true, - isClient: false, - description: '' - }, - { - service_name: 'GANGLIA', - component_name: 'GANGLIA_MONITOR', - display_name: 'Ganglia Slave', - isMaster: false, - isClient: false, - description: '' - }, - { - service_name: 'KERBEROS', - component_name: 'KERBEROS_SERVER', - display_name: 'Kerberos Server', - isMaster: true, - isClient: false, - description: '' - }, - { - service_name: 'KERBEROS', - component_name: 'KERBEROS_ADMIN_CLIENT', - display_name: 'Kerberos Admin Client', - isMaster: false, - isClient: true, - description: '' - }, - { - service_name: 'KERBEROS', - component_name: 'KERBEROS_CLIENT', - display_name: 'Kerberos Client', - isMaster: false, - isClient: true, - description: '' - }, - { - service_name: 'CLIENT', - component_name: 'CLIENT', - display_name: 'Client', - isMaster: false, - isClient: true, - description: '' - }, - { - service_name: 'HUE', - component_name: 'HUE_SERVER', - display_name: 'Hue Server', - isMaster: true, - isClient: false, - description: '' - }, - { - service_name: 'GLUSTERFS', - component_name: 'GLUSTERFS_CLIENT', - display_name: 'GLUSTERFS Client', - isMaster: false, - isClient: true, - description: 'Client component for GLUSTERFS' - }, - { - service_name: 'FALCON', - component_name: 'FALCON_SERVER', - display_name: 'Falcon Server', - isMaster: true, - isClient: false, - description: 'Falcon Server for mirroring' - }, - { - service_name: 'FALCON', - component_name: 'FALCON_CLIENT', - display_name: 'Falcon Client', - isMaster: false, - isClient: true, - description: 'Falcon Client for mirroring' - }, - { - service_name: 'STORM', - component_name: 'NIMBUS', - display_name: 'Nimbus', - isMaster: true, - isClient: false, - description: 'Master component for STORM' - }, - { - service_name: 'STORM', - component_name: 'SUPERVISOR', - display_name: 'Supervisor', - isMaster: false, - isClient: false, - description: 'Slave component for STORM' - }, - { - service_name: 'STORM', - component_name: 'STORM_UI_SERVER', - display_name: 'Storm UI Server', - isMaster: true, - isClient: false, - description: 'Master component for STORM' - }, - { - service_name: 'STORM', - component_name: 'DRPC_SERVER', - display_name: 'DRPC Server', - isMaster: true, - isClient: false, - description: 'Master component for STORM' - }, - { - service_name: 'STORM', - component_name: 'STORM_REST_API', - display_name: 'Storm REST API Server', - isMaster: true, - isClient: false, - description: 'Master component for STORM' - }, - { - service_name: 'FLUME', - component_name: 'FLUME_HANDLER', - display_name: 'Flume Agent', - isMaster: false, - isClient: false, - description: 'Slave component for Flume' - } -]); - -// @todo remove after Application Timeline Server API implementation -if (App.supports.appTimelineServer) { - var appTimelineServerObj = { - service_name: 'YARN', - component_name: 'APP_TIMELINE_SERVER', - display_name: 'App Timeline Server', - isMaster: true, - isClient: false, - stackVersions: ['2.1'], - description: '' - }; - module.exports.push(appTimelineServerObj); -} http://git-wip-us.apache.org/repos/asf/ambari/blob/29e61ae9/ambari-web/app/initialize.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/initialize.js b/ambari-web/app/initialize.js index 777779a..9f048d5 100644 --- a/ambari-web/app/initialize.js +++ b/ambari-web/app/initialize.js @@ -36,20 +36,8 @@ require('router'); require('utils/ajax'); require('utils/updater'); -require('mappers/server_data_mapper'); -require('mappers/status_mapper'); -require('mappers/hosts_mapper'); -require('mappers/cluster_mapper'); -require('mappers/jobs_mapper'); -require('mappers/runs_mapper'); -require('mappers/racks_mapper'); -require('mappers/users_mapper'); -require('mappers/service_mapper'); -require('mappers/service_metrics_mapper'); -require('mappers/target_cluster_mapper'); -require('mappers/dataset_mapper'); -require('mappers/component_config_mapper'); -require('mappers/jobs/hive_jobs_mapper'); +require('mappers'); + require('mappers/jobs/hive_job_mapper'); require('utils/http_client'); require('utils/host_progress_popup'); http://git-wip-us.apache.org/repos/asf/ambari/blob/29e61ae9/ambari-web/app/mappers.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mappers.js b/ambari-web/app/mappers.js new file mode 100644 index 0000000..08d40fe --- /dev/null +++ b/ambari-web/app/mappers.js @@ -0,0 +1,34 @@ +/** + * 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. + */ + +//load all mappers +require('mappers/server_data_mapper'); +require('mappers/stack_service_component_mapper'); +require('mappers/status_mapper'); +require('mappers/hosts_mapper'); +require('mappers/cluster_mapper'); +require('mappers/jobs_mapper'); +require('mappers/runs_mapper'); +require('mappers/racks_mapper'); +require('mappers/users_mapper'); +require('mappers/service_mapper'); +require('mappers/service_metrics_mapper'); +require('mappers/target_cluster_mapper'); +require('mappers/dataset_mapper'); +require('mappers/component_config_mapper'); +require('mappers/jobs/hive_jobs_mapper'); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/29e61ae9/ambari-web/app/mappers/stack_service_component_mapper.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mappers/stack_service_component_mapper.js b/ambari-web/app/mappers/stack_service_component_mapper.js new file mode 100644 index 0000000..6b13214 --- /dev/null +++ b/ambari-web/app/mappers/stack_service_component_mapper.js @@ -0,0 +1,44 @@ +/** + * 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'); + +App.stackServiceComponentMapper = App.QuickDataMapper.create({ + model: App.StackServiceComponent, + config: { + id: 'component_name', + component_name: 'component_name', + service_name: 'service_name', + component_category: 'component_category', + is_master: 'is_master', + is_client: 'is_client', + stack_name: 'stack_name', + stack_version: 'stack_version' + }, + + map: function (json) { + var model = this.get('model'); + if (json.items) { + var result = []; + json.items.forEach(function (item) { + result.push(this.parseIt(item, this.config)); + }, this); + App.store.loadMany(model, result); + } + } +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/29e61ae9/ambari-web/app/models.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models.js b/ambari-web/app/models.js index ce53c73..b9239fb 100644 --- a/ambari-web/app/models.js +++ b/ambari-web/app/models.js @@ -24,6 +24,7 @@ require('models/authentication'); require('models/cluster'); require('models/cluster_states'); require('models/hosts'); +require('models/stack_service_component'); require('models/quick_links'); require('models/service'); require('models/service_config'); http://git-wip-us.apache.org/repos/asf/ambari/blob/29e61ae9/ambari-web/app/models/stack_service_component.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/stack_service_component.js b/ambari-web/app/models/stack_service_component.js new file mode 100644 index 0000000..50175af --- /dev/null +++ b/ambari-web/app/models/stack_service_component.js @@ -0,0 +1,72 @@ +/** + * 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'); +/** + * This model loads all serviceComponents supported by the stack + * @type {*} + */ +App.StackServiceComponent = DS.Model.extend({ + componentName: DS.attr('string'), + serviceName: DS.attr('string'), + componentCategory: DS.attr('string'), + isMaster: DS.attr('boolean'), + isClient: DS.attr('boolean'), + stackName: DS.attr('string'), + stackVersion: DS.attr('string'), + + displayName: function() { + return App.format.components[this.get('componentName')]; + }.property('componentName'), + + isSlave: function() { + return this.get('componentCategory') === 'SLAVE'; + }.property('componentCategory'), + + isRestartable: function() { + return !this.get('isClient'); + }.property('isClient'), + + isReassignable: function() { + return ['NAMENODE', 'SECONDARY_NAMENODE', 'JOBTRACKER', 'RESOURCEMANAGER'].contains(this.get('componentName')); + }.property('componentName'), + + isDeletable: function() { + return ['SUPERVISOR', 'HBASE_MASTER', 'DATANODE', 'TASKTRACKER', 'NODEMANAGER', 'HBASE_REGIONSERVER'].contains(this.get('componentName')); + }.property('componentName'), + + isRollinRestartAllowed: function() { + return ["DATANODE", "TASKTRACKER", "NODEMANAGER", "HBASE_REGIONSERVER", "SUPERVISOR"].contains(this.get('componentName')); + }.property('componentName'), + + isDecommissionAllowed: function() { + return ["DATANODE", "TASKTRACKER", "NODEMANAGER", "HBASE_REGIONSERVER"].contains(this.get('componentName')); + }.property('componentName'), + + isAddableToHost: function() { + return ["DATANODE", "TASKTRACKER", "NODEMANAGER", "HBASE_REGIONSERVER", "HBASE_MASTER", "ZOOKEEPER_SERVER", "SUPERVISOR"].contains(this.get('componentName')); + }.property('componentName'), + + isShownOnInstallerAssignMasterPage: function() { + var component = this.get('componentName'); + var mastersNotShown = ['MYSQL_SERVER','JOURNALNODE']; + return ((this.get('isMaster') && !mastersNotShown.contains(component)) || component === 'APP_TIMELINE_SERVER'); + }.property('isMaster','componentName') +}); + +App.StackServiceComponent.FIXTURES = []; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/29e61ae9/ambari-web/app/utils/ajax.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/ajax.js b/ambari-web/app/utils/ajax.js index 4f25d93..cad1c3e 100644 --- a/ambari-web/app/utils/ajax.js +++ b/ambari-web/app/utils/ajax.js @@ -1231,12 +1231,12 @@ var urls = { } }, 'wizard.service_components': { - 'real': '{stackUrl}/stackServices?fields=StackServices', - 'mock': '/data/wizard/stack/hdp/version/{stackVersion}.json', - 'format': function() { + 'real': '{stackUrl}/stackServices?fields=StackServices/comments,StackServices/service_version,serviceComponents/*', + 'mock': '/data/wizard/stacks/HDP-2.1/service_components.json', + 'format': function(data) { return { timeout: 10000, - async: false + async: !!data.async }; } }, http://git-wip-us.apache.org/repos/asf/ambari/blob/29e61ae9/ambari-web/app/utils/component.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/component.js b/ambari-web/app/utils/component.js index dec45a7..e085763 100644 --- a/ambari-web/app/utils/component.js +++ b/ambari-web/app/utils/component.js @@ -20,6 +20,8 @@ * Here will be stored slave functions related to components * @type {Object} */ + +var App = require('app'); module.exports = { /** @@ -52,5 +54,31 @@ module.exports = { }); return result; + }, + + /** + * + * @param data + */ + loadStackServiceComponentModel: function(data) { + var serviceComponents = {items: []}; + data.items.forEach(function(item){ + item.serviceComponents.forEach(function(_serviceComponent){ + var stackServiceComponents = _serviceComponent.StackServiceComponents; + var serviceComponent = { + component_name: stackServiceComponents.component_name, + service_name: stackServiceComponents.service_name, + component_category: stackServiceComponents.component_category, + is_master: stackServiceComponents.is_master, + is_client: stackServiceComponents.is_client, + stack_name: stackServiceComponents.stack_name, + stack_version: stackServiceComponents.stack_version + }; + serviceComponents.items.pushObject(serviceComponent); + },this); + },this); + App.stackServiceComponentMapper.map(serviceComponents); + App.handleStackDependedComponents(); + return serviceComponents; } }; http://git-wip-us.apache.org/repos/asf/ambari/blob/29e61ae9/ambari-web/app/views/main/host/summary.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/main/host/summary.js b/ambari-web/app/views/main/host/summary.js index d367e89..8967cd1 100644 --- a/ambari-web/app/views/main/host/summary.js +++ b/ambari-web/app/views/main/host/summary.js @@ -238,7 +238,7 @@ App.MainHostSummaryView = Em.View.extend({ return []; } var componentServiceMap = App.QuickDataMapper.componentServiceMap(); - var allClients = App.get('components.clients'); + var allClients = App.StackServiceComponent.find().filterProperty('isClient',true).mapProperty('componentName'); var installedServices = this.get('installedServices'); var installedClients = this.get('clients').mapProperty('componentName'); return allClients.filter(function(componentName) { http://git-wip-us.apache.org/repos/asf/ambari/blob/29e61ae9/ambari-web/test/app_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/app_test.js b/ambari-web/test/app_test.js index 4830b58..b43aa0d 100644 --- a/ambari-web/test/app_test.js +++ b/ambari-web/test/app_test.js @@ -19,31 +19,12 @@ var App = require('app'); describe('#App', function() { + describe('Disable/enable components', function() { - describe('App.components', function() { - - it('slaves and masters should not intersect', function() { - var intersected = App.get('components.slaves').filter(function(item){ - return App.get('components.masters').contains(item); - }); - expect(intersected).to.eql([]); - }); - - it('decommissionAllowed', function() { - expect(App.get('components.decommissionAllowed')).to.eql(["DATANODE", "TASKTRACKER", "NODEMANAGER", "HBASE_REGIONSERVER"]); - }); - - it('addableToHost', function() { - expect(App.get('components.addableToHost')).to.eql(["DATANODE", "TASKTRACKER", "NODEMANAGER", "HBASE_REGIONSERVER", "HBASE_MASTER", "ZOOKEEPER_SERVER", "SUPERVISOR"]); + var testableComponent = Ember.Object.create({ + componentName: 'APP_TIMELINE_SERVER', + serviceName: 'YARN' }); - - }); - - describe('Disable/enable components', function() { - var testableComponent = { - service_name: 'YARN', - component_name: 'APP_TIMELINE_SERVER' - }; var expectedInfo = { componentName: 'APP_TIMELINE_SERVER', properties: { @@ -59,7 +40,6 @@ describe('#App', function() { }; var globalProperties = require('data/HDP2/global_properties'); var siteProperties = require('data/HDP2/site_properties'); - var serviceComponents = require('data/service_components'); var reviewConfigs = require('data/review_configs'); var disableResult; @@ -71,7 +51,6 @@ describe('#App', function() { // copy var _globalProperties = $.extend({}, globalProperties); var _siteProperties = $.extend({}, siteProperties); - var _serviceComponents = $.extend({}, serviceComponents); var _reviewConfigs = JSON.parse(JSON.stringify(reviewConfigs)); describe('result validation', function() { @@ -103,9 +82,6 @@ describe('#App', function() { describe('effect validation',function() { - it('should remove component from service_components object', function() { - expect(_serviceComponents.findProperty('component_name', testableComponent.component_name)).to.be.undefined; - }); it('should remove global properties of component', function() { expect(_globalProperties.configProperties.mapProperty('name')).to.not.include.members(expectedInfo.properties.global_properties); @@ -117,7 +93,7 @@ describe('#App', function() { it('should remove review config for component', function() { var reviewConfig = _reviewConfigs.findProperty('config_name', 'services') - .config_value.findProperty('service_name', testableComponent.service_name) + .config_value.findProperty('service_name', testableComponent.get('serviceName')) .service_components.mapProperty('component_name'); expect(reviewConfig).to.not.include(expectedInfo.reviewConfigs.component_name); }); @@ -127,10 +103,6 @@ describe('#App', function() { describe('#enableComponent', function() { App.enableComponent(disableResult); - it('should add component to service_components object', function() { - expect(serviceComponents.findProperty('component_name', testableComponent.component_name)).to.exist; - }); - it('should add global properties of component', function() { expect(globalProperties.configProperties.mapProperty('name')).to.include.members(expectedInfo.properties.global_properties); }); @@ -141,11 +113,10 @@ describe('#App', function() { it('should add review config for component', function() { var reviewConfig = reviewConfigs.findProperty('config_name', 'services') - .config_value.findProperty('service_name', testableComponent.service_name) + .config_value.findProperty('service_name', testableComponent.get('serviceName')) .get('service_components').mapProperty('component_name'); expect(reviewConfig).to.include(expectedInfo.reviewConfigs.component_name); }); }); }); - }); http://git-wip-us.apache.org/repos/asf/ambari/blob/29e61ae9/ambari-web/test/installer/step5_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/installer/step5_test.js b/ambari-web/test/installer/step5_test.js index 57cef17..a672900 100644 --- a/ambari-web/test/installer/step5_test.js +++ b/ambari-web/test/installer/step5_test.js @@ -19,7 +19,6 @@ var Ember = require('ember'); var App = require('app'); require('controllers/wizard/step5_controller'); -var components = require('data/service_components'); describe('App.WizardStep5Controller', function () { var controller = App.WizardStep5Controller.create(); http://git-wip-us.apache.org/repos/asf/ambari/blob/29e61ae9/ambari-web/test/installer/step6_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/installer/step6_test.js b/ambari-web/test/installer/step6_test.js index e323f2d..da64fc1 100644 --- a/ambari-web/test/installer/step6_test.js +++ b/ambari-web/test/installer/step6_test.js @@ -23,7 +23,6 @@ require('controllers/wizard/step6_controller'); describe('App.WizardStep6Controller', function () { var controller = App.WizardStep6Controller.create(); - controller.set('content', { hosts: {}, masterComponentHosts: {}, @@ -46,6 +45,9 @@ describe('App.WizardStep6Controller', function () { }) ] }); + controller.set('getComponentDisplayName',function () { + return true; + }); var HOSTS = Em.A([ 'host0', 'host1', 'host2', 'host3' ]); http://git-wip-us.apache.org/repos/asf/ambari/blob/29e61ae9/ambari-web/test/installer/step9_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/installer/step9_test.js b/ambari-web/test/installer/step9_test.js index 4ecd864..32bb806 100644 --- a/ambari-web/test/installer/step9_test.js +++ b/ambari-web/test/installer/step9_test.js @@ -19,11 +19,71 @@ var Ember = require('ember'); var App = require('app'); +require('models/stack_service_component'); require('models/hosts'); require('controllers/wizard/step9_controller'); require('utils/helper'); describe('App.InstallerStep9Controller', function () { + var data = [ + { + id: 'DATANODE', + component_name: 'DATANODE', + service_name: 'HDFS', + is_client: false, + is_master: false, + component_category: 'SLAVE' + }, + { + id: 'TASKTRACKER', + component_name: 'TASKTRACKER', + service_name: 'MAPREDUCE', + is_client: false, + is_master: false, + component_category: 'SLAVE' + }, + { + id: 'HBASE_REGIONSERVER', + component_name: 'HBASE_REGIONSERVER', + service_name: 'HBASE', + is_client: false, + is_master: false, + component_category: 'SLAVE' + }, + { + id: 'GANGLIA_MONITOR', + component_name: 'GANGLIA_MONITOR', + service_name: 'GANGLIA', + is_client: false, + is_master: false, + component_category: 'SLAVE' + }, + { + id: 'SUPERVISOR', + component_name: 'SUPERVISOR', + service_name: 'STORM', + is_client: false, + is_master: false, + component_category: 'SLAVE' + }, + { + id: 'NAMENODE', + component_name: 'NAMENODE', + service_name: 'HDFS', + is_client: false, + is_master: true, + component_category: 'MASTER' + }, + { + id: 'HDFS_CLIENT', + component_name: 'HDFS_CLIENT', + service_name: 'HDFS', + is_client: true, + is_master: false, + component_category: 'SLAVE' + } + ]; + App.store.loadMany(App.StackServiceComponent,data); describe('#isSubmitDisabled', function () { var tests = Em.A([
