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-13485 Move all 'displayType' values to stack. (ababiichuk)
Date Wed, 21 Oct 2015 06:25:33 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 24ce16b5a -> 3b573c290


http://git-wip-us.apache.org/repos/asf/ambari/blob/3b573c29/ambari-web/test/controllers/main/admin/kerberos/step2_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/kerberos/step2_controller_test.js b/ambari-web/test/controllers/main/admin/kerberos/step2_controller_test.js
index 701fcf3..9a06024 100644
--- a/ambari-web/test/controllers/main/admin/kerberos/step2_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/kerberos/step2_controller_test.js
@@ -37,12 +37,13 @@ describe('App.KerberosWizardStep2Controller', function() {
       controller.tweakManualKdcProperties.restore();
     });
 
-    var _createProperty = function(name, value) {
+    var _createProperty = function(name, value, displayType) {
       var preDefProp = App.config.get('preDefinedSiteProperties').findProperty('name', name);
       if (preDefProp) {
         return App.ServiceConfigProperty.create(
           $.extend(true, {}, preDefProp, {
             value: value, filename: 'some-site.xml',
+            'displayType': displayType,
             isRequiredByAgent: preDefProp.isRequiredByAgent == undefined ? true : preDefProp.isRequiredByAgent
           }));
       } else {
@@ -53,10 +54,10 @@ describe('App.KerberosWizardStep2Controller', function() {
     var tests = [
       {
         stepConfigs: [
-          ['realm', ' SPACES '],
-          ['admin_server_host', ' space_left'],
-          ['kdc_host', ' space_left_and_right '],
-          ['ldap_url', 'space_right ']
+          ['realm', ' SPACES ', 'host'],
+          ['admin_server_host', ' space_left', 'host'],
+          ['kdc_host', ' space_left_and_right ', 'host'],
+          ['ldap_url', 'space_right ', 'host']
         ],
         e: {
           realm: 'SPACES',
@@ -72,7 +73,7 @@ describe('App.KerberosWizardStep2Controller', function() {
         sinon.stub(App.StackService, 'find').returns([Em.Object.create({serviceName: 'KERBEROS'})]);
         controller.set('stepConfigs', [
           App.ServiceConfig.create({
-            configs: test.stepConfigs.map(function(item) { return _createProperty(item[0],
item[1]); })
+            configs: test.stepConfigs.map(function(item) { return _createProperty(item[0],
item[1], item[2]); })
           })
         ]);
         var result = controller.createKerberosSiteObj('some-site', 'random-tag');

http://git-wip-us.apache.org/repos/asf/ambari/blob/3b573c29/ambari-web/test/controllers/main/service/info/config_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/service/info/config_test.js b/ambari-web/test/controllers/main/service/info/config_test.js
index a62c75f..ea22fef 100644
--- a/ambari-web/test/controllers/main/service/info/config_test.js
+++ b/ambari-web/test/controllers/main/service/info/config_test.js
@@ -538,8 +538,8 @@ describe("App.MainServiceInfoConfigsController", function () {
         Em.Object.create({ name: "p4", value: " d1 d2 d3 ", displayType: "directories" }),
         Em.Object.create({ name: "p5", value: " v1 ", displayType: "password" }),
         Em.Object.create({ name: "p6", value: " v ", displayType: "host" }),
-        Em.Object.create({ name: "javax.jdo.option.ConnectionURL", value: " v1 ", displayType:
"advanced" }),
-        Em.Object.create({ name: "oozie.service.JPAService.jdbc.url", value: " v1 ", displayType:
"advanced" })
+        Em.Object.create({ name: "javax.jdo.option.ConnectionURL", value: " v1 ", displayType:
"string" }),
+        Em.Object.create({ name: "oozie.service.JPAService.jdbc.url", value: " v1 ", displayType:
"string" })
       ],
       result: [
         Em.Object.create({ name: "p1", value: " v1 v1", displayType: "" }),
@@ -548,8 +548,8 @@ describe("App.MainServiceInfoConfigsController", function () {
         Em.Object.create({ name: "p4", value: "d1,d2,d3", displayType: "directories" }),
         Em.Object.create({ name: "p5", value: " v1 ", displayType: "password" }),
         Em.Object.create({ name: "p6", value: "v", displayType: "host" }),
-        Em.Object.create({ name: "javax.jdo.option.ConnectionURL", value: " v1", displayType:
"advanced" }),
-        Em.Object.create({ name: "oozie.service.JPAService.jdbc.url", value: " v1", displayType:
"advanced" })
+        Em.Object.create({ name: "javax.jdo.option.ConnectionURL", value: " v1", displayType:
"string" }),
+        Em.Object.create({ name: "oozie.service.JPAService.jdbc.url", value: " v1", displayType:
"string" })
       ]
     };
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3b573c29/ambari-web/test/data/HDP2.2/site_properties_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/data/HDP2.2/site_properties_test.js b/ambari-web/test/data/HDP2.2/site_properties_test.js
index 5c88198..01e6119 100644
--- a/ambari-web/test/data/HDP2.2/site_properties_test.js
+++ b/ambari-web/test/data/HDP2.2/site_properties_test.js
@@ -18,6 +18,7 @@
 
 var App = require('app');
 require('utils/helper');
+require('data/HDP2/gluster_fs_properties');
 var siteProperties = require('data/HDP2.2/site_properties').configProperties;
 
 describe('hdp2SiteProperties', function () {
@@ -55,6 +56,14 @@ describe('hdp2SiteProperties', function () {
     });
 
     /**
+     * displayTypes <code>supportTextConnection<code> and <code>radio button<code>
+     * can be used as exception. Other displayTypes values should be used in stack definition
+     */
+    it('Check attributes of "' + siteProperty.filename + '/' + siteProperty.name  + '"' +
'. Display type value ' + siteProperty.displayType + ' should be described in stack ', function
() {
+      expect(siteProperty.displayType).to.match(/undefined|supportTextConnection|radio button/);
+    });
+
+    /**
      * Following config attributes uniquely represent a config property
      * name
      * filename

http://git-wip-us.apache.org/repos/asf/ambari/blob/3b573c29/ambari-web/test/data/HDP2.3/site_properties_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/data/HDP2.3/site_properties_test.js b/ambari-web/test/data/HDP2.3/site_properties_test.js
index 86e83f0..1bc8a7f 100644
--- a/ambari-web/test/data/HDP2.3/site_properties_test.js
+++ b/ambari-web/test/data/HDP2.3/site_properties_test.js
@@ -18,6 +18,7 @@
 
 var App = require('app');
 require('utils/helper');
+require('data/HDP2/gluster_fs_properties');
 var siteProperties = require('data/HDP2.3/site_properties').configProperties;
 
 describe('hdp2SiteProperties', function () {
@@ -54,6 +55,15 @@ describe('hdp2SiteProperties', function () {
       expect(siteProperty.unit).to.equal(undefined);
     });
 
+
+    /**
+     * displayTypes <code>supportTextConnection<code> and <code>radio button<code>
+     * can be used as exception. Other displayTypes values should be used in stack definition
+     */
+    it('Check attributes of "' + siteProperty.filename + '/' + siteProperty.name  + '"' +
'. Display type value ' + siteProperty.displayType + ' should be described in stack ', function
() {
+      expect(siteProperty.displayType).to.match(/undefined|supportTextConnection|radio button/);
+    });
+
     /**
      * Following config attributes uniquely represent a config property
      * name

http://git-wip-us.apache.org/repos/asf/ambari/blob/3b573c29/ambari-web/test/data/HDP2/site_properties_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/data/HDP2/site_properties_test.js b/ambari-web/test/data/HDP2/site_properties_test.js
index 9310fbf..aee3072 100644
--- a/ambari-web/test/data/HDP2/site_properties_test.js
+++ b/ambari-web/test/data/HDP2/site_properties_test.js
@@ -18,6 +18,7 @@
 
 var App = require('app');
 require('utils/helper');
+require('data/HDP2/gluster_fs_properties');
 var siteProperties = require('data/HDP2/site_properties').configProperties;
 
 describe('hdp2SiteProperties', function () {
@@ -55,6 +56,14 @@ describe('hdp2SiteProperties', function () {
     });
 
     /**
+     * displayTypes <code>supportTextConnection<code> and <code>radio button<code>
+     * can be used as exception. Other displayTypes values should be used in stack definition
+     */
+    it('Check attributes of "' + siteProperty.filename + '/' + siteProperty.name  + '"' +
'. Display type value ' + siteProperty.displayType + ' should be described in stack ', function
() {
+      expect(siteProperty.displayType).to.match(/undefined|supportTextConnection|radio button/);
+    });
+
+    /**
      * Following config attributes uniquely represent a config property
      * name
      * filename

http://git-wip-us.apache.org/repos/asf/ambari/blob/3b573c29/ambari-web/test/mock_data_setup/configs_mock_data.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mock_data_setup/configs_mock_data.js b/ambari-web/test/mock_data_setup/configs_mock_data.js
index 8c46b2f..694862b 100644
--- a/ambari-web/test/mock_data_setup/configs_mock_data.js
+++ b/ambari-web/test/mock_data_setup/configs_mock_data.js
@@ -248,7 +248,7 @@ module.exports = {
         "isOverridable":true,
         "showLabel":true,
         "serviceName":"STORM",
-        "displayType":"advanced",
+        "displayType":"string",
         "displayName":"single_line_property",
         "category":"AdvancedStormSite"
       },

http://git-wip-us.apache.org/repos/asf/ambari/blob/3b573c29/ambari-web/test/utils/config_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/config_test.js b/ambari-web/test/utils/config_test.js
index 0d25b45..bd0e9af 100644
--- a/ambari-web/test/utils/config_test.js
+++ b/ambari-web/test/utils/config_test.js
@@ -223,21 +223,21 @@ describe('App.config', function () {
       },
       {
         config: {
-          displayType: 'advanced',
+          displayType: 'string',
           value: ' value'
         },
         e: ' value'
       },
       {
         config: {
-          displayType: 'advanced',
+          displayType: 'string',
           value: ' value'
         },
         e: ' value'
       },
       {
         config: {
-          displayType: 'advanced',
+          displayType: 'string',
           value: 'http://localhost ',
           name: 'javax.jdo.option.ConnectionURL'
         },
@@ -245,7 +245,7 @@ describe('App.config', function () {
       },
       {
         config: {
-          displayType: 'advanced',
+          displayType: 'string',
           value: 'http://localhost    ',
           name: 'oozie.service.JPAService.jdbc.url'
         },
@@ -461,7 +461,7 @@ describe('App.config', function () {
           property_name: 'ignore_groupsusers_create'
         },
         output: {
-          displayType: 'checkbox'
+          displayType: 'boolean'
         },
         title: 'ignore_groupsusers_create'
       },
@@ -810,7 +810,7 @@ describe('App.config', function () {
     });
     it('returns singleLine displayType', function() {
       sinon.stub(App.config, 'isContentProperty', function () {return false});
-      expect(App.config.getDefaultDisplayType('n1','f1','v1')).to.equal('advanced');
+      expect(App.config.getDefaultDisplayType('n1','f1','v1')).to.equal('string');
       App.config.isContentProperty.restore();
     });
     it('returns multiLine displayType', function() {
@@ -818,6 +818,11 @@ describe('App.config', function () {
       expect(App.config.getDefaultDisplayType('n2', 'f2', 'v1\nv2')).to.equal('multiLine');
       App.config.isContentProperty.restore();
     });
+    it('returns custom displayType for FALCON oozie-site properties', function() {
+      sinon.stub(App.config, 'isContentProperty', function () {return false});
+      expect(App.config.getDefaultDisplayType('n2', 'oozie-site.xml', 'v1\nv2', 'FALCON')).to.equal('custom');
+      App.config.isContentProperty.restore();
+    });
   });
 
   describe('#getDefaultDisplayName', function() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/3b573c29/ambari-web/test/views/common/configs/service_configs_by_category_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/configs/service_configs_by_category_view_test.js
b/ambari-web/test/views/common/configs/service_configs_by_category_view_test.js
index f9ec764..59ac49c 100644
--- a/ambari-web/test/views/common/configs/service_configs_by_category_view_test.js
+++ b/ambari-web/test/views/common/configs/service_configs_by_category_view_test.js
@@ -260,7 +260,7 @@ describe('App.ServiceConfigsByCategoryView', function () {
           name: 'n0',
           displayName: 'd0',
           value: 'v0',
-          displayType: 'advanced',
+          displayType: 'string',
           isSecureConfig: true,
           category: 'c0',
           serviceName: 's0',


Mime
View raw message