123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322 |
- /**
- * 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');
- var modelSetup = require('test/init_model_test');
- require('models/stack_service_component');
- /**
- Component properties template:
- {
- componentName: 'SUPERVISOR',
- expected: {
- displayName: 'Supervisor',
- minToInstall: 1,
- maxToInstall: Infinity,
- isRequired: true,
- isMultipleAllowed: true,
- isSlave: true,
- isMaster: false,
- isClient: false,
- isRestartable: true,
- isReassignable: false,
- isDeletable: true,
- isRollinRestartAllowed: true,
- isDecommissionAllowed: false,
- isRefreshConfigsAllowed: false,
- isAddableToHost: true,
- isShownOnInstallerAssignMasterPage: false,
- isShownOnInstallerSlaveClientPage: true,
- isShownOnAddServiceAssignMasterPage: false,
- isMasterWithMultipleInstances: false,
- isMasterAddableInstallerWizard: false,
- isHAComponentOnly: false,
- isRequiredOnAllHosts: false,
- defaultNoOfMasterHosts: 1,
- coHostedComponents: [],
- isOtherComponentCoHosted: false,
- isCoHostedComponent: false,
- selectionSchemeForMasterComponent: {"else": 0}
- }
- }
- **/
- var componentPropertiesValidationTests = [
- {
- componentName: 'SUPERVISOR',
- expected: {
- displayName: 'Supervisor',
- minToInstall: 1,
- maxToInstall: Infinity,
- isRequired: true,
- isMultipleAllowed: true,
- isSlave: true,
- isRestartable: true,
- isReassignable: false,
- isDeletable: true,
- isRollinRestartAllowed: true,
- isRefreshConfigsAllowed: false,
- isAddableToHost: true,
- isShownOnInstallerSlaveClientPage: true,
- isHAComponentOnly: false,
- isRequiredOnAllHosts: false,
- isCoHostedComponent: false
- }
- },
- {
- componentName: 'ZOOKEEPER_SERVER',
- expected: {
- minToInstall: 1,
- maxToInstall: Infinity,
- isRequired: true,
- isMultipleAllowed: true,
- isMaster: true,
- isRestartable: true,
- isReassignable: false,
- isDeletable: true,
- isRollinRestartAllowed: false,
- isDecommissionAllowed: false,
- isRefreshConfigsAllowed: false,
- isAddableToHost: true,
- isShownOnInstallerAssignMasterPage: true,
- isShownOnInstallerSlaveClientPage: false,
- isShownOnAddServiceAssignMasterPage: true,
- isMasterWithMultipleInstances: true,
- isMasterAddableInstallerWizard: true,
- isHAComponentOnly: false,
- isRequiredOnAllHosts: false,
- defaultNoOfMasterHosts: 3,
- coHostedComponents: [],
- isOtherComponentCoHosted: false,
- isCoHostedComponent: false
- }
- },
- {
- componentName: 'APP_TIMELINE_SERVER',
- expected: {
- displayName: 'App Timeline Server',
- minToInstall: 0,
- maxToInstall: 1,
- isRequired: false,
- isMultipleAllowed: false,
- isSlave: false,
- isMaster: true,
- isRestartable: true,
- isReassignable: true,
- isDeletable: false,
- isRollinRestartAllowed: false,
- isDecommissionAllowed: false,
- isRefreshConfigsAllowed: false,
- isAddableToHost: false,
- isShownOnInstallerAssignMasterPage: true,
- isShownOnInstallerSlaveClientPage: false,
- isShownOnAddServiceAssignMasterPage: true,
- isMasterWithMultipleInstances: false,
- isMasterAddableInstallerWizard: false,
- isHAComponentOnly: false,
- isRequiredOnAllHosts: false,
- coHostedComponents: [],
- isOtherComponentCoHosted: false,
- isCoHostedComponent: false
- }
- },
- {
- componentName: 'GANGLIA_MONITOR',
- expected: {
- displayName: 'Ganglia Monitor',
- minToInstall: Infinity,
- maxToInstall: Infinity,
- isRequired: true,
- isMultipleAllowed: true,
- isSlave: true,
- isMaster: false,
- isRestartable: true,
- isReassignable: false,
- isDeletable: true,
- isRollinRestartAllowed: true,
- isDecommissionAllowed: false,
- isRefreshConfigsAllowed: false,
- isAddableToHost: true,
- isShownOnInstallerAssignMasterPage: false,
- isShownOnInstallerSlaveClientPage: false,
- isShownOnAddServiceAssignMasterPage: false,
- isMasterWithMultipleInstances: false,
- isMasterAddableInstallerWizard: false,
- isHAComponentOnly: false,
- isRequiredOnAllHosts: true,
- coHostedComponents: [],
- isOtherComponentCoHosted: false,
- isCoHostedComponent: false
- }
- },
- {
- componentName: 'FLUME_HANDLER',
- expected: {
- displayName: 'Flume',
- minToInstall: 0,
- maxToInstall: Infinity,
- isRequired: false,
- isMultipleAllowed: true,
- isSlave: true,
- isMaster: false,
- isRestartable: true,
- isReassignable: false,
- isDeletable: true,
- isRollinRestartAllowed: true,
- isDecommissionAllowed: false,
- isRefreshConfigsAllowed: true,
- isAddableToHost: true,
- isShownOnInstallerAssignMasterPage: false,
- isShownOnInstallerSlaveClientPage: true,
- isShownOnAddServiceAssignMasterPage: false,
- isMasterWithMultipleInstances: false,
- isMasterAddableInstallerWizard: false,
- isHAComponentOnly: false,
- isRequiredOnAllHosts: false,
- coHostedComponents: [],
- isOtherComponentCoHosted: false,
- isCoHostedComponent: false
- }
- },
- {
- componentName: 'HIVE_METASTORE',
- expected: {
- displayName: 'Hive Metastore',
- minToInstall: 1,
- maxToInstall: 1,
- isRequired: true,
- isMultipleAllowed: false,
- isSlave: false,
- isMaster: true,
- isRestartable: true,
- isReassignable: true,
- isDeletable: false,
- isRollinRestartAllowed: false,
- isDecommissionAllowed: false,
- isRefreshConfigsAllowed: false,
- isAddableToHost: false,
- isShownOnInstallerAssignMasterPage: true,
- isShownOnInstallerSlaveClientPage: false,
- isShownOnAddServiceAssignMasterPage: true,
- isMasterWithMultipleInstances: false,
- isMasterAddableInstallerWizard: false,
- isHAComponentOnly: false,
- isRequiredOnAllHosts: false,
- coHostedComponents: [],
- isOtherComponentCoHosted: false,
- isCoHostedComponent: true
- }
- },
- {
- componentName: 'HIVE_SERVER',
- expected: {
- displayName: 'HiveServer2',
- minToInstall: 1,
- maxToInstall: 1,
- isRequired: true,
- isMultipleAllowed: false,
- isSlave: false,
- isMaster: true,
- isRestartable: true,
- isReassignable: true,
- isDeletable: false,
- isRollinRestartAllowed: false,
- isDecommissionAllowed: false,
- isRefreshConfigsAllowed: false,
- isAddableToHost: false,
- isShownOnInstallerAssignMasterPage: true,
- isShownOnInstallerSlaveClientPage: false,
- isShownOnAddServiceAssignMasterPage: true,
- isMasterWithMultipleInstances: false,
- isMasterAddableInstallerWizard: false,
- isHAComponentOnly: false,
- isRequiredOnAllHosts: false,
- coHostedComponents: ['HIVE_METASTORE','WEBHCAT_SERVER'],
- isOtherComponentCoHosted: true,
- isCoHostedComponent: false
- }
- },
- {
- componentName: 'DATANODE',
- expected: {
- displayName: 'DataNode',
- minToInstall: 1,
- maxToInstall: Infinity,
- isRequired: true,
- isMultipleAllowed: true,
- isSlave: true,
- isMaster: false,
- isRestartable: true,
- isReassignable: false,
- isDeletable: true,
- isRollinRestartAllowed: true,
- isDecommissionAllowed: true,
- isRefreshConfigsAllowed: false,
- isAddableToHost: true,
- isShownOnInstallerAssignMasterPage: false,
- isShownOnInstallerSlaveClientPage: true,
- isShownOnAddServiceAssignMasterPage: false,
- isMasterWithMultipleInstances: false,
- isMasterAddableInstallerWizard: false,
- isHAComponentOnly: false,
- isRequiredOnAllHosts: false,
- coHostedComponents: [],
- isOtherComponentCoHosted: false,
- isCoHostedComponent: false
- }
- },
- {
- componentName: 'POSTGRESQL_SERVER',
- expected: {
- isShownOnInstallerAssignMasterPage: false,
- }
- },
- {
- componentName: 'MYSQL_SERVER',
- expected: {
- isShownOnInstallerAssignMasterPage: false,
- }
- },
- ];
- describe('App.StackServiceComponent', function() {
- before(function() {
- modelSetup.setupStackServiceComponent();
- });
- describe('component properties validation', function() {
- componentPropertiesValidationTests.forEach(function(test) {
- describe('properties validation for ' + test.componentName + ' component', function() {
- var component = App.StackServiceComponent.find(test.componentName);
- var properties = Em.keys(test.expected);
- properties.forEach(function(property) {
- it('#{0} should be {1}'.format(property, JSON.stringify(test.expected[property])), function() {
- expect(component.get(property)).to.be.eql(test.expected[property]);
- })
- });
- });
- });
- });
- after(function() {
- modelSetup.cleanStackServiceComponent();
- });
- });
|