ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject ambari git commit: AMBARI-14653. HBase Links Metric - more links pointing to the wrong hbase.master.info.port. (Zhe (Joe) Wang via Jaimin)
Date Mon, 18 Jan 2016 19:23:19 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 342363ff0 -> 21b6b3169


AMBARI-14653. HBase Links Metric - more links pointing to the wrong hbase.master.info.port.
(Zhe (Joe) Wang via Jaimin)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/21b6b316
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/21b6b316
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/21b6b316

Branch: refs/heads/trunk
Commit: 21b6b31696718f5190a5b2cd52c469b097e00ffa
Parents: 342363f
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Mon Jan 18 11:20:58 2016 -0800
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Mon Jan 18 11:20:58 2016 -0800

----------------------------------------------------------------------
 .../app/views/common/quick_view_link_view.js    |  5 +-
 .../test/views/common/quick_link_view_test.js   | 51 ++++++++++++++++++++
 2 files changed, 53 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/21b6b316/ambari-web/app/views/common/quick_view_link_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/quick_view_link_view.js b/ambari-web/app/views/common/quick_view_link_view.js
index e58e47f..604d24d 100644
--- a/ambari-web/app/views/common/quick_view_link_view.js
+++ b/ambari-web/app/views/common/quick_view_link_view.js
@@ -163,7 +163,7 @@ App.QuickViewLinks = Em.View.extend({
       var sites = ['core-site', 'hdfs-site'];
       if(checks){
         checks.forEach(function(check){
-          var protocolConfigSiteProp = Em.get(check, 'site')
+          var protocolConfigSiteProp = Em.get(check, 'site');
           if (sites.indexOf(protocolConfigSiteProp) < 0){
             sites.push(protocolConfigSiteProp);
           }
@@ -181,8 +181,7 @@ App.QuickViewLinks = Em.View.extend({
             }
           }
         }, this);
-
-        this.set('requiredSiteNames', sites);
+        this.set('requiredSiteNames', this.get('requiredSiteNames').pushObjects(sites).uniq());
         this.setQuickLinks();
       }
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/21b6b316/ambari-web/test/views/common/quick_link_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/quick_link_view_test.js b/ambari-web/test/views/common/quick_link_view_test.js
index cae4715..b9aecee 100644
--- a/ambari-web/test/views/common/quick_link_view_test.js
+++ b/ambari-web/test/views/common/quick_link_view_test.js
@@ -180,6 +180,57 @@ describe('App.QuickViewLinks', function () {
     });
   });
 
+  describe("#loadQuickLinksConfigSuccessCallback()", function () {
+    var mock;
+
+    beforeEach(function () {
+      sinon.stub(App.store, 'commit', Em.K);
+      mock = sinon.stub(quickViewLinks, 'getQuickLinksConfiguration');
+    });
+    afterEach(function () {
+      App.store.commit.restore();
+      mock.restore();
+    });
+    it("requiredSites consistent", function () {
+      var quickLinksConfigHBASE = {
+        protocol: {
+          type: "http"
+        },
+        links: [
+          {
+            port: {
+              site: "hbase-site"
+            }
+          }
+        ]
+      };
+      var quickLinksConfigYARN = {
+        protocol: {
+          checks: [
+            {
+              site: "yarn-site"
+            }
+          ],
+          type: "https"
+        },
+        links: [
+          {
+            port: {
+              site: "yarn-site"
+            }
+          }
+        ]
+      };
+      quickViewLinks.set('content.serviceName', 'HBASE');
+      mock.returns(quickLinksConfigHBASE);
+      quickViewLinks.loadQuickLinksConfigSuccessCallback({items: []});
+      quickViewLinks.set('content.serviceName', 'YARN');
+      mock.returns(quickLinksConfigYARN);
+      quickViewLinks.loadQuickLinksConfigSuccessCallback({items: []});
+      expect(quickViewLinks.get('requiredSiteNames')).to.be.eql(["core-site", "hdfs-site",
"hbase-site", "yarn-site"]);
+    });
+  });
+
   describe("#getQuickLinksHosts()", function () {
     beforeEach(function () {
       sinon.stub(App.ajax, 'send');


Mime
View raw message