You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by rz...@apache.org on 2015/09/21 21:29:34 UTC
ambari git commit: AMBARI-13155. Compare config versions doesn't work
for Oozie (rzang)
Repository: ambari
Updated Branches:
refs/heads/trunk 2d12f1ede -> 26da70b3f
AMBARI-13155. Compare config versions doesn't work for Oozie (rzang)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/26da70b3
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/26da70b3
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/26da70b3
Branch: refs/heads/trunk
Commit: 26da70b3f06b1b2729572a4ac29588a4a17111b5
Parents: 2d12f1e
Author: Richard Zang <rz...@apache.org>
Authored: Mon Sep 21 12:28:14 2015 -0700
Committer: Richard Zang <rz...@apache.org>
Committed: Mon Sep 21 12:28:14 2015 -0700
----------------------------------------------------------------------
ambari-web/app/views/common/controls_view.js | 2 +-
.../test/views/common/controls_view_test.js | 140 ++++++++++---------
2 files changed, 77 insertions(+), 65 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/26da70b3/ambari-web/app/views/common/controls_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/controls_view.js b/ambari-web/app/views/common/controls_view.js
index c157c67..3531691 100644
--- a/ambari-web/app/views/common/controls_view.js
+++ b/ambari-web/app/views/common/controls_view.js
@@ -576,7 +576,7 @@ App.ServiceConfigRadioButtons = Ember.View.extend(App.ServiceConfigCalculateId,
if (dbInfo.dpPropertiesByServiceMap[this.get('serviceConfig.serviceName')]) {
//@TODO: dbInfo.dpPropertiesByServiceMap has corresponding property name but does not have filenames with it. this can cause issue when there are multiple db properties with same name belonging to different files
/** check if selected service has db properties**/
- return this.get('parentView.serviceConfigs').findProperty('name', dbInfo.dpPropertiesByServiceMap[this.get('serviceConfig.serviceName')][propertyType]);
+ return this.get('controller.selectedService.configs').findProperty('name', dbInfo.dpPropertiesByServiceMap[this.get('serviceConfig.serviceName')][propertyType]);
}
return null;
},
http://git-wip-us.apache.org/repos/asf/ambari/blob/26da70b3/ambari-web/test/views/common/controls_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/controls_view_test.js b/ambari-web/test/views/common/controls_view_test.js
index 6e4315c..ea54577 100644
--- a/ambari-web/test/views/common/controls_view_test.js
+++ b/ambari-web/test/views/common/controls_view_test.js
@@ -91,17 +91,19 @@ describe('App.ServiceConfigRadioButtons', function () {
value: 'New MySQL Database',
serviceName: 'HIVE'
},
- parentView: Em.Object.create({
- serviceConfigs: [
- Em.Object.create({
- name: 'javax.jdo.option.ConnectionURL',
- displayName: 'Database URL'
- }),
- Em.Object.create({
- name: 'hive_database',
- displayName: 'Hive Database'
- })
- ]
+ controller: Em.Object.create({
+ selectedService: {
+ configs: [
+ Em.Object.create({
+ name: 'javax.jdo.option.ConnectionURL',
+ displayName: 'Database URL'
+ }),
+ Em.Object.create({
+ name: 'hive_database',
+ displayName: 'Hive Database'
+ })
+ ]
+ }
}),
currentStackVersion: 'HDP-2.2',
propertyAppendTo1: 'javax.jdo.option.ConnectionURL',
@@ -118,17 +120,19 @@ describe('App.ServiceConfigRadioButtons', function () {
value: 'Existing PostgreSQL Database',
serviceName: 'HIVE'
},
- parentView: Em.Object.create({
- serviceConfigs: [
- Em.Object.create({
- name: 'javax.jdo.option.ConnectionURL',
- displayName: 'Database URL'
- }),
- Em.Object.create({
- name: 'hive_database',
- displayName: 'Hive Database'
- })
- ]
+ controller: Em.Object.create({
+ selectedService: {
+ configs: [
+ Em.Object.create({
+ name: 'javax.jdo.option.ConnectionURL',
+ displayName: 'Database URL'
+ }),
+ Em.Object.create({
+ name: 'hive_database',
+ displayName: 'Hive Database'
+ })
+ ]
+ }
}),
currentStackVersion: 'HDP-2.2',
propertyAppendTo1: 'javax.jdo.option.ConnectionURL',
@@ -145,17 +149,19 @@ describe('App.ServiceConfigRadioButtons', function () {
value: 'New Derby Database',
serviceName: 'OOZIE'
},
- parentView: Em.Object.create({
- serviceConfigs: [
- Em.Object.create({
- name: 'oozie.service.JPAService.jdbc.url',
- displayName: 'Database URL'
- }),
- Em.Object.create({
- name: 'oozie_database',
- displayName: 'Oozie Database'
- })
- ]
+ controller: Em.Object.create({
+ selectedService: {
+ configs: [
+ Em.Object.create({
+ name: 'oozie.service.JPAService.jdbc.url',
+ displayName: 'Database URL'
+ }),
+ Em.Object.create({
+ name: 'oozie_database',
+ displayName: 'Oozie Database'
+ })
+ ]
+ }
}),
currentStackVersion: 'HDP-2.2',
propertyAppendTo1: 'oozie.service.JPAService.jdbc.url',
@@ -172,17 +178,19 @@ describe('App.ServiceConfigRadioButtons', function () {
value: 'Existing Oracle Database',
serviceName: 'OOZIE'
},
- parentView: Em.Object.create({
- serviceConfigs: [
- Em.Object.create({
- name: 'oozie.service.JPAService.jdbc.url',
- displayName: 'Database URL'
- }),
- Em.Object.create({
- name: 'oozie_database',
- displayName: 'Oozie Database'
- })
- ]
+ controller: Em.Object.create({
+ selectedService: {
+ configs: [
+ Em.Object.create({
+ name: 'oozie.service.JPAService.jdbc.url',
+ displayName: 'Database URL'
+ }),
+ Em.Object.create({
+ name: 'oozie_database',
+ displayName: 'Oozie Database'
+ })
+ ]
+ }
}),
currentStackVersion: 'HDP-2.2',
propertyAppendTo1: 'oozie.service.JPAService.jdbc.url',
@@ -199,15 +207,17 @@ describe('App.ServiceConfigRadioButtons', function () {
value: 'MYSQL',
serviceName: 'RANGER'
},
- parentView: Em.Object.create({
- serviceConfigs: [
- Em.Object.create({
- name: 'ranger.jpa.jdbc.url'
- }),
- Em.Object.create({
- name: 'DB_FLAVOR'
- })
- ]
+ controller: Em.Object.create({
+ selectedService: {
+ configs: [
+ Em.Object.create({
+ name: 'ranger.jpa.jdbc.url'
+ }),
+ Em.Object.create({
+ name: 'DB_FLAVOR'
+ })
+ ]
+ }
}),
currentStackVersion: 'HDP-2.2',
propertyAppendTo1: 'ranger.jpa.jdbc.url',
@@ -224,15 +234,17 @@ describe('App.ServiceConfigRadioButtons', function () {
value: 'MSSQL',
serviceName: 'RANGER'
},
- parentView: Em.Object.create({
- serviceConfigs: [
- Em.Object.create({
- name: 'ranger.jpa.jdbc.url'
- }),
- Em.Object.create({
- name: 'DB_FLAVOR'
- })
- ]
+ controller: Em.Object.create({
+ selectedService: {
+ configs: [
+ Em.Object.create({
+ name: 'ranger.jpa.jdbc.url'
+ }),
+ Em.Object.create({
+ name: 'DB_FLAVOR'
+ })
+ ]
+ }
}),
currentStackVersion: 'HDP-2.3',
propertyAppendTo1: 'ranger.jpa.jdbc.url',
@@ -261,10 +273,10 @@ describe('App.ServiceConfigRadioButtons', function () {
cases.forEach(function (item) {
it(item.title, function () {
sinon.stub(App, 'get').withArgs('currentStackName').returns('HDP').withArgs('currentStackVersion').returns(item.currentStackVersion);
- view = App.ServiceConfigRadioButtons.create({parentView: item.parentView});
+ view = App.ServiceConfigRadioButtons.create({controller: item.controller});
sinon.stub(view, 'sendRequestRorDependentConfigs', Em.K);
view.setProperties({
- categoryConfigsAll: item.parentView.get('serviceConfigs'),
+ categoryConfigsAll: item.controller.get('selectedService.configs'),
serviceConfig: item.serviceConfig
});
var additionalView1 = view.get('categoryConfigsAll').findProperty('name', item.propertyAppendTo1).get('additionalView'),