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:24:37 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk f19a8da03 -> d5b7d404c


http://git-wip-us.apache.org/repos/asf/ambari/blob/d5b7d404/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/d5b7d404/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/d5b7d404/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..5179283 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 () {
@@ -25,7 +26,8 @@ describe('hdp2SiteProperties', function () {
    * @stackProperties: All the properties that are derived from stack definition
    */
   var stackProperties = siteProperties.filter(function(item){
-    return  (!(item.isRequiredByAgent === false || item.filename === 'alert_notification'
|| item.category === 'Ambari Principals' || item.name === 'oozie_hostname'))
+    return  (!(item.isRequiredByAgent === false || item.filename === 'alert_notification'
|| item.category === 'Ambari Principals'
+    || item.name === 'oozie_hostname' || item.serviceName === 'HAWQ'))
   });
 
   stackProperties.forEach(function(siteProperty){
@@ -54,6 +56,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/d5b7d404/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/d5b7d404/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/d5b7d404/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 4a42053..af14cbf 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'
         },
@@ -476,7 +476,7 @@ describe('App.config', function () {
           property_name: 'ignore_groupsusers_create'
         },
         output: {
-          displayType: 'checkbox'
+          displayType: 'boolean'
         },
         title: 'ignore_groupsusers_create'
       },
@@ -773,7 +773,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() {
@@ -781,6 +781,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/d5b7d404/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