[48/50] [abbrv] ambari git commit: AMBARI-14663. Ambari Web UT failure in trunk (App.InstallerStep7Controller) (onechiporenko)

2016-01-15 Thread ncole
AMBARI-14663. Ambari Web UT failure in trunk (App.InstallerStep7Controller) 
(onechiporenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 121481ce11a1e8af90febc995f14d21222716fcf
Parents: dfcea58
Author: Oleg Nechiporenko 
Authored: Thu Jan 14 13:07:30 2016 +0200
Committer: Nate Cole 
Committed: Thu Jan 14 11:43:30 2016 -0500

--
 .../test/controllers/wizard/step7_test.js   | 36 ++--
 .../config_recommendation_parser_test.js| 12 +++
 .../host_components/install_component_test.js   |  4 +--
 3 files changed, 33 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/121481ce/ambari-web/test/controllers/wizard/step7_test.js
--
diff --git a/ambari-web/test/controllers/wizard/step7_test.js 
b/ambari-web/test/controllers/wizard/step7_test.js
index d8c4552..b7a48c9 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -108,7 +108,11 @@ function getController() {
 describe('App.InstallerStep7Controller', function () {
 
   beforeEach(function () {
-sinon.stub(App.ajax, 'send', Em.K);
+sinon.stub(App.ajax, 'send', function () {
+  return {
+then: Em.K
+  }
+});
 sinon.stub(App.config, 'setPreDefinedServiceConfigs', Em.K);
 installerStep7Controller = getController();
   });
@@ -1169,6 +1173,7 @@ describe('App.InstallerStep7Controller', function () {
   });
 
   describe('#updateHawqConfigs', function() {
+var isSingleNode = false;
 var testHawqSiteConfigs = [
   {
 name: 'hawq_standby_address_host',
@@ -1180,24 +1185,33 @@ describe('App.InstallerStep7Controller', function () {
   }
 ];
 var oldHawqSiteLength = testHawqSiteConfigs.length;
+
+beforeEach(function () {
+  sinon.stub(App, 'get', function () {
+return isSingleNode;
+  });
+});
+
+afterEach(function () {
+  App.get.restore()
+});
+
 it('hawq_standby_address_host should be removed on single node cluster', 
function() {
-  sinon.stub(App, 'get').withArgs('isSingleNode').returns(true);
+  isSingleNode = true;
   var hawqSiteConfigs = testHawqSiteConfigs.slice();
   var updatedHawqSiteConfigs = 
installerStep7Controller.updateHawqConfigs(hawqSiteConfigs);
-  expect(updatedHawqSiteConfigs.length).to.be.eql(oldHawqSiteLength-1);
-  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_standby_address_host')).to.be.eql(undefined);
-  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_master_address_host').value).to.be.eql('h1');
-  App.get.restore()
+  expect(updatedHawqSiteConfigs.length).to.be.equal(oldHawqSiteLength-1);
+  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_standby_address_host')).to.not.exist;
+  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_master_address_host').value).to.be.equal('h1');
 });
 
 it('hawq_standby_address_host should not be removed on multi node 
clusters', function() {
-  sinon.stub(App, 'get').withArgs('isSingleNode').returns(false);
+  isSingleNode = false;
   var hawqSiteConfigs = testHawqSiteConfigs.slice();
   var updatedHawqSiteConfigs = 
installerStep7Controller.updateHawqConfigs(hawqSiteConfigs);
-  expect(updatedHawqSiteConfigs.length).to.be.eql(oldHawqSiteLength);
-  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_standby_address_host').value).to.be.eql('h2');
-  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_master_address_host').value).to.be.eql('h1');
-  App.get.restore();
+  expect(updatedHawqSiteConfigs.length).to.be.equal(oldHawqSiteLength);
+  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_standby_address_host').value).to.be.equal('h2');
+  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_master_address_host').value).to.be.equal('h1');
 });
 
   });

http://git-wip-us.apache.org/repos/asf/ambari/blob/121481ce/ambari-web/test/mixins/common/configs/config_recommendation_parser_test.js
--
diff --git 
a/ambari-web/test/mixins/common/configs/config_recommendation_parser_test.js 
b/ambari-web/test/mixins/common/configs/config_recommendation_parser_test.js
index 12959f6..e895859 100644
--- a/ambari-web/test/mixins/common/configs/config_recommendation_parser_test.js
+++ 

[27/50] ambari git commit: AMBARI-14663. Ambari Web UT failure in trunk (App.InstallerStep7Controller) (onechiporenko)

2016-01-15 Thread ncole
AMBARI-14663. Ambari Web UT failure in trunk (App.InstallerStep7Controller) 
(onechiporenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 8ae2c8b7c78231a486bdba1bbd7c67e1951521bc
Parents: d5d07e7
Author: Oleg Nechiporenko 
Authored: Thu Jan 14 13:07:30 2016 +0200
Committer: Oleg Nechiporenko 
Committed: Thu Jan 14 13:07:30 2016 +0200

--
 .../test/controllers/wizard/step7_test.js   | 36 ++--
 .../config_recommendation_parser_test.js| 12 +++
 .../host_components/install_component_test.js   |  4 +--
 3 files changed, 33 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8ae2c8b7/ambari-web/test/controllers/wizard/step7_test.js
--
diff --git a/ambari-web/test/controllers/wizard/step7_test.js 
b/ambari-web/test/controllers/wizard/step7_test.js
index d8c4552..b7a48c9 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -108,7 +108,11 @@ function getController() {
 describe('App.InstallerStep7Controller', function () {
 
   beforeEach(function () {
-sinon.stub(App.ajax, 'send', Em.K);
+sinon.stub(App.ajax, 'send', function () {
+  return {
+then: Em.K
+  }
+});
 sinon.stub(App.config, 'setPreDefinedServiceConfigs', Em.K);
 installerStep7Controller = getController();
   });
@@ -1169,6 +1173,7 @@ describe('App.InstallerStep7Controller', function () {
   });
 
   describe('#updateHawqConfigs', function() {
+var isSingleNode = false;
 var testHawqSiteConfigs = [
   {
 name: 'hawq_standby_address_host',
@@ -1180,24 +1185,33 @@ describe('App.InstallerStep7Controller', function () {
   }
 ];
 var oldHawqSiteLength = testHawqSiteConfigs.length;
+
+beforeEach(function () {
+  sinon.stub(App, 'get', function () {
+return isSingleNode;
+  });
+});
+
+afterEach(function () {
+  App.get.restore()
+});
+
 it('hawq_standby_address_host should be removed on single node cluster', 
function() {
-  sinon.stub(App, 'get').withArgs('isSingleNode').returns(true);
+  isSingleNode = true;
   var hawqSiteConfigs = testHawqSiteConfigs.slice();
   var updatedHawqSiteConfigs = 
installerStep7Controller.updateHawqConfigs(hawqSiteConfigs);
-  expect(updatedHawqSiteConfigs.length).to.be.eql(oldHawqSiteLength-1);
-  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_standby_address_host')).to.be.eql(undefined);
-  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_master_address_host').value).to.be.eql('h1');
-  App.get.restore()
+  expect(updatedHawqSiteConfigs.length).to.be.equal(oldHawqSiteLength-1);
+  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_standby_address_host')).to.not.exist;
+  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_master_address_host').value).to.be.equal('h1');
 });
 
 it('hawq_standby_address_host should not be removed on multi node 
clusters', function() {
-  sinon.stub(App, 'get').withArgs('isSingleNode').returns(false);
+  isSingleNode = false;
   var hawqSiteConfigs = testHawqSiteConfigs.slice();
   var updatedHawqSiteConfigs = 
installerStep7Controller.updateHawqConfigs(hawqSiteConfigs);
-  expect(updatedHawqSiteConfigs.length).to.be.eql(oldHawqSiteLength);
-  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_standby_address_host').value).to.be.eql('h2');
-  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_master_address_host').value).to.be.eql('h1');
-  App.get.restore();
+  expect(updatedHawqSiteConfigs.length).to.be.equal(oldHawqSiteLength);
+  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_standby_address_host').value).to.be.equal('h2');
+  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_master_address_host').value).to.be.equal('h1');
 });
 
   });

http://git-wip-us.apache.org/repos/asf/ambari/blob/8ae2c8b7/ambari-web/test/mixins/common/configs/config_recommendation_parser_test.js
--
diff --git 
a/ambari-web/test/mixins/common/configs/config_recommendation_parser_test.js 
b/ambari-web/test/mixins/common/configs/config_recommendation_parser_test.js
index 12959f6..e895859 100644
--- a/ambari-web/test/mixins/common/configs/config_recommendation_parser_test.js
+++ 

ambari git commit: AMBARI-14663. Ambari Web UT failure in trunk (App.InstallerStep7Controller) (onechiporenko)

2016-01-14 Thread onechiporenko
Repository: ambari
Updated Branches:
  refs/heads/trunk d5d07e767 -> 8ae2c8b7c


AMBARI-14663. Ambari Web UT failure in trunk (App.InstallerStep7Controller) 
(onechiporenko)


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

Branch: refs/heads/trunk
Commit: 8ae2c8b7c78231a486bdba1bbd7c67e1951521bc
Parents: d5d07e7
Author: Oleg Nechiporenko 
Authored: Thu Jan 14 13:07:30 2016 +0200
Committer: Oleg Nechiporenko 
Committed: Thu Jan 14 13:07:30 2016 +0200

--
 .../test/controllers/wizard/step7_test.js   | 36 ++--
 .../config_recommendation_parser_test.js| 12 +++
 .../host_components/install_component_test.js   |  4 +--
 3 files changed, 33 insertions(+), 19 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/ambari/blob/8ae2c8b7/ambari-web/test/controllers/wizard/step7_test.js
--
diff --git a/ambari-web/test/controllers/wizard/step7_test.js 
b/ambari-web/test/controllers/wizard/step7_test.js
index d8c4552..b7a48c9 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -108,7 +108,11 @@ function getController() {
 describe('App.InstallerStep7Controller', function () {
 
   beforeEach(function () {
-sinon.stub(App.ajax, 'send', Em.K);
+sinon.stub(App.ajax, 'send', function () {
+  return {
+then: Em.K
+  }
+});
 sinon.stub(App.config, 'setPreDefinedServiceConfigs', Em.K);
 installerStep7Controller = getController();
   });
@@ -1169,6 +1173,7 @@ describe('App.InstallerStep7Controller', function () {
   });
 
   describe('#updateHawqConfigs', function() {
+var isSingleNode = false;
 var testHawqSiteConfigs = [
   {
 name: 'hawq_standby_address_host',
@@ -1180,24 +1185,33 @@ describe('App.InstallerStep7Controller', function () {
   }
 ];
 var oldHawqSiteLength = testHawqSiteConfigs.length;
+
+beforeEach(function () {
+  sinon.stub(App, 'get', function () {
+return isSingleNode;
+  });
+});
+
+afterEach(function () {
+  App.get.restore()
+});
+
 it('hawq_standby_address_host should be removed on single node cluster', 
function() {
-  sinon.stub(App, 'get').withArgs('isSingleNode').returns(true);
+  isSingleNode = true;
   var hawqSiteConfigs = testHawqSiteConfigs.slice();
   var updatedHawqSiteConfigs = 
installerStep7Controller.updateHawqConfigs(hawqSiteConfigs);
-  expect(updatedHawqSiteConfigs.length).to.be.eql(oldHawqSiteLength-1);
-  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_standby_address_host')).to.be.eql(undefined);
-  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_master_address_host').value).to.be.eql('h1');
-  App.get.restore()
+  expect(updatedHawqSiteConfigs.length).to.be.equal(oldHawqSiteLength-1);
+  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_standby_address_host')).to.not.exist;
+  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_master_address_host').value).to.be.equal('h1');
 });
 
 it('hawq_standby_address_host should not be removed on multi node 
clusters', function() {
-  sinon.stub(App, 'get').withArgs('isSingleNode').returns(false);
+  isSingleNode = false;
   var hawqSiteConfigs = testHawqSiteConfigs.slice();
   var updatedHawqSiteConfigs = 
installerStep7Controller.updateHawqConfigs(hawqSiteConfigs);
-  expect(updatedHawqSiteConfigs.length).to.be.eql(oldHawqSiteLength);
-  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_standby_address_host').value).to.be.eql('h2');
-  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_master_address_host').value).to.be.eql('h1');
-  App.get.restore();
+  expect(updatedHawqSiteConfigs.length).to.be.equal(oldHawqSiteLength);
+  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_standby_address_host').value).to.be.equal('h2');
+  expect(updatedHawqSiteConfigs.findProperty('name', 
'hawq_master_address_host').value).to.be.equal('h1');
 });
 
   });

http://git-wip-us.apache.org/repos/asf/ambari/blob/8ae2c8b7/ambari-web/test/mixins/common/configs/config_recommendation_parser_test.js
--
diff --git 
a/ambari-web/test/mixins/common/configs/config_recommendation_parser_test.js 
b/ambari-web/test/mixins/common/configs/config_recommendation_parser_test.js
index 12959f6..e895859 100644
---