ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject [1/3] ambari git commit: AMBARI-10082 Enhanced Configs: Create mapper for loading config versions and config properties. (ababiichuk)
Date Mon, 16 Mar 2015 17:29:52 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 656fd855f -> 34c3951c2


http://git-wip-us.apache.org/repos/asf/ambari/blob/34c3951c/ambari-web/app/assets/test/tests.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js
index c0ad666..12a4d07 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -132,6 +132,7 @@ var files = ['test/init_model_test',
   'test/mappers/stack_mapper_test',
   'test/mappers/configs/stack_config_properties_mapper_test',
   'test/mappers/configs/config_groups_mapper_test',
+  'test/mappers/configs/config_versions_mapper_test',
   'test/mixins/common/chart/storm_linear_time_test',
   'test/mixins/common/localStorage_test',
   'test/mixins/common/serverValidator_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/34c3951c/ambari-web/app/mappers.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers.js b/ambari-web/app/mappers.js
index e8187ba..01c49eb 100644
--- a/ambari-web/app/mappers.js
+++ b/ambari-web/app/mappers.js
@@ -22,7 +22,8 @@ require('mappers/stack_service_mapper');
 require('mappers/stack_mapper');
 require('mappers/stack_version_mapper');
 require('mappers/configs/stack_config_properties_mapper');
-require('mappers/configs/config_groups_mapper');
+//require('mappers/configs/config_groups_mapper');
+require('mappers/configs/config_versions_mapper');
 require('mappers/repository_version_mapper');
 require('mappers/hosts_mapper');
 require('mappers/cluster_mapper');

http://git-wip-us.apache.org/repos/asf/ambari/blob/34c3951c/ambari-web/app/mappers/configs/config_groups_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/configs/config_groups_mapper.js b/ambari-web/app/mappers/configs/config_groups_mapper.js
index 92b1088..66a4cc0 100644
--- a/ambari-web/app/mappers/configs/config_groups_mapper.js
+++ b/ambari-web/app/mappers/configs/config_groups_mapper.js
@@ -15,6 +15,11 @@
  * the License.
  */
 
+/**
+ * THIS IS NOT USED FOR NOW
+ * FOR CONFIG GROUPS WE ARE USING OLD MODELS AND LOGIC
+ */
+
 var App = require('app');
 
 App.configGroupsMapper = App.QuickDataMapper.create({

http://git-wip-us.apache.org/repos/asf/ambari/blob/34c3951c/ambari-web/app/mappers/configs/config_versions_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/configs/config_versions_mapper.js b/ambari-web/app/mappers/configs/config_versions_mapper.js
new file mode 100644
index 0000000..f268e13
--- /dev/null
+++ b/ambari-web/app/mappers/configs/config_versions_mapper.js
@@ -0,0 +1,118 @@
+/**
+ * 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.configVersionsMapper = App.QuickDataMapper.create({
+  model: App.ConfigVersion,
+  propertyModel: App.ConfigProperty,
+  config: {
+    service_name: 'service_name',
+    service_id: 'service_name',
+    version: "service_config_version",
+    create_time: 'createtime',
+    group_id: 'group_id',
+    group_name: 'group_name',
+    hosts: 'hosts',
+    author: 'user',
+    notes: 'service_config_version_note',
+    is_current: 'is_current',
+    index: 'index'
+  },
+
+  map: function (json) {
+    var configVersions = [];
+    var itemIds = {};
+    var serviceToHostMap = {};
+
+    if (json && json.items) {
+      json.items.forEach(function (item, index) {
+        var parsedItem = this.parseIt(item, this.get('config'));
+        parsedItem.id = parsedItem.service_name + '_' + parsedItem.version;
+        parsedItem.is_requested = true;
+        itemIds[parsedItem.id] = true;
+        parsedItem.index = index;
+        parsedItem.config_properties = [];
+
+        if (serviceToHostMap[item.service_name]) {
+          serviceToHostMap[item.service_name] = serviceToHostMap[item.service_name].concat(item.hosts);
+        } else {
+          serviceToHostMap[item.service_name] = item.hosts;
+        }
+
+        /**
+         * parsing config properties for config version
+         * @type {Array}
+         */
+        var properties = [];
+        if (item.configurations) {
+          item.configurations.forEach(function(config) {
+            var type = config.type;
+            var properties_array = Object.keys(config.properties);
+            for (var i = 0; i < properties_array.length; i++) {
+              var key = properties_array[i];
+              var property = App.StackConfigProperty.find(key  + '_' + type).toJSON();
+
+              property.id = key  + '_' + type + '_' + item.service_config_version;
+              property.value = property.default_value = config.properties[key];
+              property.is_final = property.default_is_final = !!item.properties_attributes
&& item.properties_attributes.final[key] === "true";
+              property.config_version_id = parsedItem.id;
+
+              properties.push(property);
+            }
+          }, this);
+        }
+        parsedItem.config_properties = parsedItem.config_properties.concat(properties.mapProperty('id'));
+
+        App.store.loadMany(this.get('propertyModel'), properties);
+
+        configVersions.push(parsedItem);
+      }, this);
+
+      this.get('model').find().forEach(function (item) {
+        if (!itemIds[item.get('id')]) {
+          item.set('isRequested', false);
+        }
+      });
+      var itemTotal = parseInt(json.itemTotal);
+      if (!isNaN(itemTotal)) {
+        App.router.set('mainConfigHistoryController.filteredCount', itemTotal);
+      }
+
+      /**
+       * this code sets hostNames for default config group
+       * by excluding hostNames that belongs to not default groups
+       * from list of all hosts
+       */
+      Object.keys(serviceToHostMap).forEach(function(sName) {
+        var defaultHostNames = App.get('allHostNames');
+        for (var i = 0; i < serviceToHostMap[sName].length; i++) {
+          defaultHostNames = defaultHostNames.without(serviceToHostMap[sName][i]);
+        }
+        var defVer = configVersions.find(function(v) {
+          return v.is_current && v.group_id == -1 && v.service_name == sName;
+        });
+        if (defVer) {
+          defVer.hosts = defaultHostNames;
+        }
+      });
+      App.store.commit();
+      App.store.loadMany(this.get('model'), configVersions);
+    }
+  }
+});

http://git-wip-us.apache.org/repos/asf/ambari/blob/34c3951c/ambari-web/app/mappers/configs/stack_config_properties_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/configs/stack_config_properties_mapper.js b/ambari-web/app/mappers/configs/stack_config_properties_mapper.js
index b234680..ef0d8c9 100644
--- a/ambari-web/app/mappers/configs/stack_config_properties_mapper.js
+++ b/ambari-web/app/mappers/configs/stack_config_properties_mapper.js
@@ -48,7 +48,7 @@ App.stackConfigPropertiesMapper = App.QuickDataMapper.create({
 
         stackItem.configurations.forEach(function(config) {
           var configType = App.config.getConfigTagFromFileName(config.StackConfigurations.type);
-          config.id = config.StackConfigurations.property_name + configType;
+          config.id = config.StackConfigurations.property_name + '_' + configType;
           config.default_is_final = config.StackConfigurations.final === "true";
           config.supports_final = !!configTypeInfo[configType] && configTypeInfo[configType].supports.final
=== "true";
           /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/34c3951c/ambari-web/app/models.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models.js b/ambari-web/app/models.js
index 63b8c1e..361b099 100644
--- a/ambari-web/app/models.js
+++ b/ambari-web/app/models.js
@@ -62,6 +62,6 @@ require('models/root_service');
 require('models/upgrade_entity');
 require('models/configs/service_config_version');
 require('models/configs/stack_config_property');
-require('models/configs/config_group');
+//require('models/configs/config_group');
 require('models/configs/config_version');
 require('models/configs/config_property');
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/34c3951c/ambari-web/app/models/configs/config_group.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/config_group.js b/ambari-web/app/models/configs/config_group.js
index e3055ba..898a510 100644
--- a/ambari-web/app/models/configs/config_group.js
+++ b/ambari-web/app/models/configs/config_group.js
@@ -16,13 +16,28 @@
  * limitations under the License.
  */
 
+/**
+ * THIS IS NOT USED FOR NOW
+ * FOR CONFIG GROUPS WE ARE USING OLD MODELS AND LOGIC
+ */
 
 var App = require('app');
 
 App.ServiceConfigGroup = DS.Model.extend({
+  /**
+   * unique id generated as <code>serviceName<code><code>configGroupId<code>
+   * in case default configGroup <code>serviceName<code><code>0<code>
+   * @property {string}
+   */
   id: DS.attr('string'),
-  //
+
+  /**
+   * original id for config group that is get from server
+   * for default groups "-1"
+   * @property {number}
+   */
   configGroupId: DS.attr('number'),
+
   name: DS.attr('string'),
   serviceName: DS.attr('string'),
   description: DS.attr('string'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/34c3951c/ambari-web/app/models/configs/config_property.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/config_property.js b/ambari-web/app/models/configs/config_property.js
index b5bb941..49cf3a2 100644
--- a/ambari-web/app/models/configs/config_property.js
+++ b/ambari-web/app/models/configs/config_property.js
@@ -72,14 +72,6 @@ App.ConfigProperty = App.StackConfigProperty.extend({
   isNotEditable: Ember.computed.not('isEditable'),
 
   /**
-   * defines if property belongs to default config group
-   * if true it's config group is default
-   * //TODO probably make computed basing on configVersion.configGroup.isDefault
-   * @property {boolean}
-   */
-  isOriginalSCP : DS.attr('boolean', {defaultValue: true}),
-
-  /**
    * defines if property can contain overriden values
    * @property {boolean}
    */
@@ -143,6 +135,15 @@ App.ConfigProperty = App.StackConfigProperty.extend({
   }.property('warnMessage'),
 
   /**
+   * defines if property belongs to default config group
+   * if true it's config group is default
+   * @type {boolean}
+   */
+  isOriginalSCP: function() {
+    return this.get('configVersion.isDefault');
+  }.property('configVersion.isDefault'),
+
+  /**
    * Indicates when value is not the default value.
    * Returns false when there is no default value.
    * @type {boolean}

http://git-wip-us.apache.org/repos/asf/ambari/blob/34c3951c/ambari-web/app/models/configs/config_version.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/config_version.js b/ambari-web/app/models/configs/config_version.js
index 30c32fe..29bc52b 100644
--- a/ambari-web/app/models/configs/config_version.js
+++ b/ambari-web/app/models/configs/config_version.js
@@ -20,7 +20,6 @@
 var App = require('app');
 
 App.ConfigVersion = App.ServiceConfigVersion.extend({
-  configGroup: DS.belongsTo('App.ServiceConfigGroup'),
   configProperties: DS.hasMany('App.ConfigProperty')
 });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/34c3951c/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index c3e7d80..66136de 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -634,7 +634,28 @@ var urls = {
   },
 
   /*************************CONFIG VERSIONS*************************************/
-    //TODO
+
+  'configs.config_versions.load.all.min': {
+    'real': '/clusters/{clusterName}/configurations/service_config_versions?fields=service_config_version,user,hosts,group_id,group_name,is_current,createtime,service_name,service_config_version_note&minimal_response=true',
+    'mock': '/data/configurations/config_versions.json'
+  },
+
+  'configs.config_versions.load.service.min': {
+    'real': '/clusters/{clusterName}/configurations/service_config_versions?service_name={serviceName}&fields=service_config_version,user,hosts,group_id,group_name,is_current,createtime,service_name,service_config_version_note&minimal_response=true',
+    'mock': '/data/configurations/config_versions.json'
+  },
+
+  'configs.config_versions.load': {
+    'real': '/clusters/{clusterName}/configurations/service_config_versions?service_name={serviceName}&service_config_version={configVersion}&fields=*',
+    'mock': '/data/configurations/config_versions.json'
+  },
+
+  'configs.config_versions.load.group': {
+    'real': '/clusters/{clusterName}/configurations/service_config_versions?service_name={serviceName}&group_id={configGroupId}&fields=*',
+    'mock': '/data/configurations/config_versions.json'
+  },
+
+
 
   'service.load_config_groups': {
     'real': '/clusters/{clusterName}/config_groups?ConfigGroup/tag={serviceName}&fields=*',

http://git-wip-us.apache.org/repos/asf/ambari/blob/34c3951c/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index e3694a4..bf0eb81 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -1896,5 +1896,59 @@ App.config = Em.Object.create({
   saveConfigGroupsToModel: function(data, opt, params) {
     App.configGroupsMapper.map(data, params.serviceList.split(','));
     params.dfd.resolve();
+  },
+
+  /**
+   * load config groups
+   * @param {String} serviceName
+   * @param {Number} configGroupId
+   * @returns {$.ajax}
+   * @method loadConfigGroups
+   */
+  loadConfigVersions: function(serviceName, configGroupId, configVersion) {
+    var info = this.generateAjaxDataForVersions(serviceName, configGroupId, configVersion);
+    return App.ajax.send({
+      name: info.name,
+      sender: this,
+      data: info.data,
+      success: 'saveConfigVersionsToModel'
+    });
+  },
+
+  /**
+   * generate ajax info
+   * @param serviceName
+   * @param configGroupId
+   * @param configVersion
+   * @returns {{name: string, data: {}}}
+   */
+  generateAjaxDataForVersions: function(serviceName, configGroupId, configVersion) {
+    var result = {
+      name: 'configs.config_versions.load.all.min',
+      data: {}
+    }
+    if (serviceName) {
+      result.data.serviceName = serviceName;
+      if (configVersion) {
+        result.name = 'configs.config_versions.load';
+        result.data.configVersion = configVersion
+      } else if (configGroupId) {
+        result.name = 'configs.config_versions.load.group';
+        result.data.configGroupId = configGroupId;
+      } else {
+        result.name = 'configs.config_versions.load.service.min';
+      }
+    }
+    return result;
+  },
+
+  /**
+   * runs <code>configGroupsMapper<code>
+   * @param data
+   * @param opt
+   * @param params
+   */
+  saveConfigVersionsToModel: function(data) {
+    App.configVersionsMapper.map(data);
   }
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/34c3951c/ambari-web/test/mappers/configs/config_groups_mapper_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mappers/configs/config_groups_mapper_test.js b/ambari-web/test/mappers/configs/config_groups_mapper_test.js
index b841dfc..fc649f8 100644
--- a/ambari-web/test/mappers/configs/config_groups_mapper_test.js
+++ b/ambari-web/test/mappers/configs/config_groups_mapper_test.js
@@ -19,7 +19,10 @@
 var App = require('app');
 require('mappers/configs/config_groups_mapper');
 
-describe('App.configGroupsMapper', function () {
+/**
+ * not using this mapper
+ */
+describe.skip('App.configGroupsMapper', function () {
 
   var allHosts = App.get('allHostNames');
   var defaultAllHosts = ['host1', 'host2', 'host3'];

http://git-wip-us.apache.org/repos/asf/ambari/blob/34c3951c/ambari-web/test/mappers/configs/config_versions_mapper_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mappers/configs/config_versions_mapper_test.js b/ambari-web/test/mappers/configs/config_versions_mapper_test.js
new file mode 100644
index 0000000..4e590fe
--- /dev/null
+++ b/ambari-web/test/mappers/configs/config_versions_mapper_test.js
@@ -0,0 +1,128 @@
+/**
+ * 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('mappers/configs/config_versions_mapper');
+
+describe('App.configVersionsMapper', function () {
+
+  var allHosts = App.get('allHostNames');
+  var defaultAllHosts = ['host1', 'host2', 'host3'];
+  beforeEach(function () {
+    App.set('allHostNames', defaultAllHosts);
+  });
+  afterEach(function(){
+    App.set('allHostNames', allHosts);
+  });
+
+  describe("#map", function() {
+
+    var json = { items: [
+      {
+        "cluster_name" : "1",
+        "createtime" : 1425979244738,
+        "group_id" : -1,
+        "group_name" : "default",
+        "hosts" : [ ],
+        "is_current" : true,
+        "service_config_version" : 1,
+        "service_config_version_note" : "Initial configurations for SERVICE1",
+        "service_name" : "SERVICE1",
+        "user" : "admin"
+      },
+      {
+        "cluster_name" : "1",
+        "configurations" : [
+          {
+            "Config" : {
+              "cluster_name" : "1"
+            },
+            "type" : "hadoop-env",
+            "tag" : "version1426088081862",
+            "version" : 2,
+            "properties" : {
+              "dtnode_heapsize" : "1026m"
+            },
+            "properties_attributes" : { }
+          }
+        ],
+        "createtime" : 1426088137115,
+        "group_id" : 2,
+        "group_name" : "1",
+        "hosts" : [
+          "host1"
+        ],
+        "is_current" : false,
+        "service_config_version" : 4,
+        "service_config_version_note" : "",
+        "service_name" : "SERVICE2",
+        "user" : "admin"
+      },
+    ]};
+
+    beforeEach(function () {
+      App.resetDsStoreTypeMap(App.ConfigVersion);
+      App.resetDsStoreTypeMap(App.ConfigProperty);
+      sinon.stub(App.store, 'commit', Em.K);
+    });
+    afterEach(function(){
+      App.store.commit.restore();
+    });
+
+    it('should not do anything as there is no json', function() {
+      App.configVersionsMapper.map(null);
+      expect(App.ConfigVersion.find().get('length')).to.equal(0);
+    });
+
+    it('should load data to model', function() {
+      App.configVersionsMapper.map(json);
+      expect(App.ConfigVersion.find().get('length')).to.equal(2);
+      expect(App.ConfigVersion.find().mapProperty('id')).to.eql(['SERVICE1_1','SERVICE2_4']);
+
+      //SERVICE1_1
+      expect(App.ConfigVersion.find('SERVICE1_1').get('configProperties.length')).to.eql(0);
+      expect(App.ConfigVersion.find('SERVICE1_1').get('createTime')).to.eql(1425979244738);
+      expect(App.ConfigVersion.find('SERVICE1_1').get('groupId')).to.eql(-1);
+      expect(App.ConfigVersion.find('SERVICE1_1').get('hosts')).to.eql(defaultAllHosts);
+      expect(App.ConfigVersion.find('SERVICE1_1').get('isCurrent')).to.be.true;
+      expect(App.ConfigVersion.find('SERVICE1_1').get('version')).to.eql(1);
+      expect(App.ConfigVersion.find('SERVICE1_1').get('notes')).to.eql("Initial configurations
for SERVICE1");
+      expect(App.ConfigVersion.find('SERVICE1_1').get('serviceName')).to.eql("SERVICE1");
+      expect(App.ConfigVersion.find('SERVICE1_1').get('author')).to.eql("admin");
+
+      //SERVICE1_2
+      expect(App.ConfigVersion.find('SERVICE2_4').get('configProperties.length')).to.eql(1);
+      expect(App.ConfigVersion.find('SERVICE2_4').get('createTime')).to.eql(1426088137115);
+      expect(App.ConfigVersion.find('SERVICE2_4').get('groupId')).to.eql(2);
+      expect(App.ConfigVersion.find('SERVICE2_4').get('hosts')).to.eql(["host1"]);
+      expect(App.ConfigVersion.find('SERVICE2_4').get('isCurrent')).to.be.false;
+      expect(App.ConfigVersion.find('SERVICE2_4').get('version')).to.eql(4);
+      expect(App.ConfigVersion.find('SERVICE2_4').get('notes')).to.eql("");
+      expect(App.ConfigVersion.find('SERVICE2_4').get('serviceName')).to.eql("SERVICE2");
+      expect(App.ConfigVersion.find('SERVICE2_4').get('author')).to.eql("admin");
+
+      //CONFIG_PROPERTY
+      expect(App.ConfigProperty.find('dtnode_heapsize_hadoop-env_4').get('value')).to.eql('1026m');
+      expect(App.ConfigProperty.find('dtnode_heapsize_hadoop-env_4').get('defaultValue')).to.equal('1026m');
+      expect(App.ConfigProperty.find('dtnode_heapsize_hadoop-env_4').get('isFinal')).to.be.false;
+      expect(App.ConfigProperty.find('dtnode_heapsize_hadoop-env_4').get('defaultIsFinal')).to.be.false;
+    });
+  });
+
+});
+

http://git-wip-us.apache.org/repos/asf/ambari/blob/34c3951c/ambari-web/test/mappers/configs/stack_config_properties_mapper_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mappers/configs/stack_config_properties_mapper_test.js b/ambari-web/test/mappers/configs/stack_config_properties_mapper_test.js
index 2061226..403064a 100644
--- a/ambari-web/test/mappers/configs/stack_config_properties_mapper_test.js
+++ b/ambari-web/test/mappers/configs/stack_config_properties_mapper_test.js
@@ -136,31 +136,31 @@ describe('App.stackConfigPropertiesMapper', function () {
     it('should load data to model', function() {
       App.stackConfigPropertiesMapper.map(json);
       expect(App.StackConfigProperty.find().get('length')).to.equal(3);
-      expect(App.StackConfigProperty.find().mapProperty('id')).to.eql(['p1site1','p2site2','p3site3']);
+      expect(App.StackConfigProperty.find().mapProperty('id')).to.eql(['p1_site1','p2_site2','p3_site3']);
 
-      expect(App.StackConfigProperty.find('p1site1').get('name')).to.eql('p1');
-      expect(App.StackConfigProperty.find('p1site1').get('displayName')).to.eql('p1');
-      expect(App.StackConfigProperty.find('p1site1').get('description')).to.eql('desc1');
-      expect(App.StackConfigProperty.find('p1site1').get('defaultValue')).to.eql('v1');
-      expect(App.StackConfigProperty.find('p1site1').get('defaultIsFinal')).to.be.false;
-      expect(App.StackConfigProperty.find('p1site1').get('serviceName')).to.eql('s1');
-      expect(App.StackConfigProperty.find('p1site1').get('stackName')).to.eql('HDP');
-      expect(App.StackConfigProperty.find('p1site1').get('stackVersion')).to.eql('2.2');
-      expect(App.StackConfigProperty.find('p1site1').get('type')).to.eql([]);
-      expect(App.StackConfigProperty.find('p1site1').get('fileName')).to.eql('site1.xml');
-      expect(App.StackConfigProperty.find('p1site1').get('propertyDependedBy')).to.eql([
+      expect(App.StackConfigProperty.find('p1_site1').get('name')).to.eql('p1');
+      expect(App.StackConfigProperty.find('p1_site1').get('displayName')).to.eql('p1');
+      expect(App.StackConfigProperty.find('p1_site1').get('description')).to.eql('desc1');
+      expect(App.StackConfigProperty.find('p1_site1').get('defaultValue')).to.eql('v1');
+      expect(App.StackConfigProperty.find('p1_site1').get('defaultIsFinal')).to.be.false;
+      expect(App.StackConfigProperty.find('p1_site1').get('serviceName')).to.eql('s1');
+      expect(App.StackConfigProperty.find('p1_site1').get('stackName')).to.eql('HDP');
+      expect(App.StackConfigProperty.find('p1_site1').get('stackVersion')).to.eql('2.2');
+      expect(App.StackConfigProperty.find('p1_site1').get('type')).to.eql([]);
+      expect(App.StackConfigProperty.find('p1_site1').get('fileName')).to.eql('site1.xml');
+      expect(App.StackConfigProperty.find('p1_site1').get('propertyDependedBy')).to.eql([
         {
           "property_type": "site4",
           "property_name": "p4"
         }
       ]);
-      expect(App.StackConfigProperty.find('p1site1').get('valueAttributes')).to.eql({
+      expect(App.StackConfigProperty.find('p1_site1').get('valueAttributes')).to.eql({
         "type": "int",
         "minimum": "512",
         "maximum": "10240",
         "unit": "MB"
       });
-      expect(App.StackConfigProperty.find('p1site1').get('supportsFinal')).to.be.true;
+      expect(App.StackConfigProperty.find('p1_site1').get('supportsFinal')).to.be.true;
     });
   });
 


Mime
View raw message