ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [07/50] [abbrv] ambari git commit: AMBARI-13673. Remove redundant App.db-functions (onechiporenko)
Date Wed, 04 Nov 2015 13:36:34 GMT
AMBARI-13673. Remove redundant App.db-functions (onechiporenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: c5d1aeeb0d21adf8c4204e9a52a4bdabe490e5f0
Parents: 0492aa4
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Mon Nov 2 12:17:28 2015 +0200
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Mon Nov 2 12:17:28 2015 +0200

----------------------------------------------------------------------
 ambari-web/app/assets/test/tests.js             |   1 +
 ambari-web/app/utils/db.js                      | 685 ++++---------------
 ambari-web/app/utils/ember_reopen.js            |  16 +-
 .../wizard/slave_component_groups_controller.js |  31 -
 .../test/controllers/wizard/step6_test.js       |   5 -
 .../test/controllers/wizard/step7_test.js       |   2 -
 .../test/controllers/wizard/step8_test.js       |   5 -
 ambari-web/test/controllers/wizard_test.js      |   2 +-
 ambari-web/test/init_router_test.js             |  30 -
 .../test/mixins/common/reload_popup_test.js     |   3 -
 ambari-web/test/router_test.js                  |   8 +-
 ambari-web/test/utils/db_test.js                |  97 +++
 ambari-web/test/views/common/table_view_test.js |   2 +
 .../upgrade_version_box_view_test.js            |   9 +
 .../views/main/alert_definitions_view_test.js   |  13 +
 .../main/alerts/definition_details_view_test.js |   4 +-
 .../select_definitions_popup_body_view_test.js  |  11 +
 ambari-web/test/views/main/host/details_test.js |   1 -
 18 files changed, 295 insertions(+), 630 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/app/assets/test/tests.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/test/tests.js b/ambari-web/app/assets/test/tests.js
index 111b892..cb292a5 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -168,6 +168,7 @@ var files = [
   'test/utils/date/timezone_test',
   'test/utils/data_manipulation_test',
   'test/utils/config_test',
+  'test/utils/db_test',
   'test/utils/form_field_test',
   'test/utils/host_progress_popup_test',
   'test/utils/misc_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/app/utils/db.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/db.js b/ambari-web/app/utils/db.js
index f66cf55..366f5a4 100644
--- a/ambari-web/app/utils/db.js
+++ b/ambari-web/app/utils/db.js
@@ -17,7 +17,7 @@
  */
 var App = require('app');
 App.db = {};
-var InitialData =  {
+var InitialData = {
   'app': {
     'loginName': '',
     'authenticated': false,
@@ -31,12 +31,12 @@ var InitialData =  {
     }
   },
 
-  'Installer' : {},
-  'AddHost' : {},
-  'AddService' : {},
-  'WidgetWizard' : {},
+  'Installer': {},
+  'AddHost': {},
+  'AddService': {},
+  'WidgetWizard': {},
   'KerberosWizard': {},
-  'ReassignMaster' : {},
+  'ReassignMaster': {},
   'AddSecurity': {},
   'AddAlertDefinition': {
     content: {}
@@ -51,16 +51,17 @@ var InitialData =  {
 
 };
 
-if (typeof Storage !== 'undefined') {
-  Storage.prototype.setObject = function (key, value) {
-    this.setItem(key, JSON.stringify(value));
-  };
+function checkNamespace(namespace) {
+  if (!namespace) {
+    return false;
+  }
+  if (Em.isNone(Em.get(App.db.data, namespace))) {
+    Em.setFullPath(App.db.data, namespace, {});
+  }
+  return true;
+}
 
-  Storage.prototype.getObject = function (key) {
-    var value = this.getItem(key);
-    return value && JSON.parse(value);
-  };
-} else {
+if (typeof Storage === 'undefined') {
   // stub for unit testing purposes
   window.localStorage = {};
   localStorage.setItem = function (key, val) {
@@ -72,64 +73,68 @@ if (typeof Storage !== 'undefined') {
   window.localStorage.setObject = function (key, value) {
     this[key] = value;
   };
-  window.localStorage.getObject = function (key, value) {
+  window.localStorage.getObject = function (key) {
     return this[key];
   };
 }
+else {
+  Storage.prototype.setObject = function (key, value) {
+    this.setItem(key, JSON.stringify(value));
+  };
+
+  Storage.prototype.getObject = function (key) {
+    var value = this.getItem(key);
+    return value && JSON.parse(value);
+  };
+}
 
 App.db.cleanUp = function () {
-  console.log('TRACE: Entering db:cleanup function');
   App.db.data = InitialData;
-  console.log("In cleanup./..");
   localStorage.setObject('ambari', App.db.data);
 };
 
-App.db.cleanTmp = function() {
+App.db.cleanTmp = function () {
   App.db.data.tmp = {};
   localStorage.setObject('ambari', App.db.data);
 };
 
-App.db.cleanAddHost = function() {
-  App.db.data.AddHost = {};
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.updateStorage = function() {
+App.db.updateStorage = function () {
   App.db.data = localStorage.getObject('ambari');
-  if (App.db.data && App.db.data.app && App.db.data.app.tables && App.db.data.app.configs) {
+  if (Em.get(App, 'db.data.app.tables') && Em.get(App, 'db.data.app.configs')) {
     return true;
   }
-  console.warn("local storage is deprecated!");
   App.db.cleanUp();
   return false;
 };
 
 /*
-  Initialize wizard namespaces if they are not initialized on login.
-  This will be required during upgrade.
+ Initialize wizard namespaces if they are not initialized on login.
+ This will be required during upgrade.
  */
-App.db.mergeStorage = function() {
+App.db.mergeStorage = function () {
   if (localStorage.getObject('ambari') == null) {
-    console.log('doing a cleanup');
     App.db.cleanUp();
   } else {
-    localStorage.setObject('ambari', $.extend(true,{}, InitialData, App.db.data));
+    localStorage.setObject('ambari', $.extend(true, {}, InitialData, App.db.data));
   }
 };
 
 // called whenever user logs in
 if (localStorage.getObject('ambari') == null) {
-  console.log('doing a cleanup');
   App.db.cleanUp();
 }
 
+/**
+ *
+ * @param {string} namespace
+ * @param {string} key
+ * @returns {*}
+ */
 App.db.get = function (namespace, key) {
-  console.log('TRACE: Entering db:get' + key);
   App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data[namespace]) {
-    App.db.data[namespace] = {};
-  }
-  return App.db.data[namespace][key];
+  Em.assert('`namespace` should be defined', !!namespace);
+  checkNamespace(namespace);
+  return Em.get(Em.get(App.db.data, namespace), key);
 };
 
 /**
@@ -140,23 +145,22 @@ App.db.get = function (namespace, key) {
  */
 App.db.getProperties = function (namespace, listOfProperties) {
   App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data[namespace]) {
-    App.db.data[namespace] = {};
-  }
-  var ret = {};
-  listOfProperties.forEach(function (k) {
-    ret[k] = App.db.data[namespace][k];
-  });
-  return ret;
+  Em.assert('`namespace` should be defined', !!namespace);
+  checkNamespace(namespace);
+  return Em.getProperties(Em.get(App.db.data, namespace), listOfProperties);
 };
 
+/**
+ *
+ * @param {string} namespace
+ * @param {string} key
+ * @param {*} value
+ */
 App.db.set = function (namespace, key, value) {
-  console.log('TRACE: Entering db:set' + key + ';value: ', value);
   App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data[namespace]) {
-    App.db.data[namespace] = {};
-  }
-  App.db.data[namespace][key] = value;
+  Em.assert('`namespace` should be defined', !!namespace);
+  checkNamespace(namespace);
+  Em.set(Em.get(App.db.data, namespace), key, value);
   localStorage.setObject('ambari', App.db.data);
 };
 
@@ -167,25 +171,14 @@ App.db.set = function (namespace, key, value) {
  */
 App.db.setProperties = function (namespace, hash) {
   App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data[namespace]) {
-    App.db.data[namespace] = {};
-  }
-  for (var k in hash) {
-    if (hash.hasOwnProperty(k)) {
-      App.db.data[namespace][k] = hash[k];
-    }
-  }
+  Em.assert('`namespace` should be defined', !!namespace);
+  checkNamespace(namespace);
+  Em.setProperties(Em.get(App.db.data, namespace), hash);
   localStorage.setObject('ambari', App.db.data);
 };
-/*
- * setter methods
- */
 
 App.db.setLoginName = function (name) {
-  console.log('TRACE: Entering db:setLoginName function');
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.app.loginName = name;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('app', 'loginName', name);
 };
 
 /**
@@ -193,199 +186,60 @@ App.db.setLoginName = function (name) {
  * @param user
  */
 App.db.setUser = function (user) {
-  console.log('TRACE: Entering db:setUser function');
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.app.user = user;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('app', 'user', user);
 };
 
 App.db.setAuthenticated = function (authenticated) {
-  console.log('TRACE: Entering db:setAuthenticated function');
-
-  App.db.data = localStorage.getObject('ambari');
-  console.log('present value of authentication is: ' + App.db.data.app.authenticated);
-  console.log('desired value of authentication is: ' + authenticated);
-  App.db.data.app.authenticated = authenticated;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('app', 'authenticated', authenticated);
   App.db.data = localStorage.getObject('ambari');
-  console.log('Now present value of authentication is: ' + App.db.data.app.authenticated);
 };
 
-App.db.setFilterConditions = function(name, filterConditions) {
-  console.log('TRACE: Entering db:setFilterConditions function');
-  App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data.app.tables.filterConditions) {
-    App.db.data.app.tables.filterConditions = {};
-  }
-  App.db.data.app.tables.filterConditions[name] = filterConditions;
-  localStorage.setObject('ambari', App.db.data);
+App.db.setFilterConditions = function (name, filterConditions) {
+  App.db.set('app.tables.filterConditions', name, filterConditions);
 };
 
-App.db.setDisplayLength = function(name, displayLength) {
-  console.log('TRACE: Entering db:setDisplayLength function');
-  App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data.app.tables.displayLength) {
-    App.db.data.app.tables.displayLength = {};
-  }
-  App.db.data.app.tables.displayLength[name] = displayLength;
-  localStorage.setObject('ambari', App.db.data);
+App.db.setDisplayLength = function (name, displayLength) {
+  App.db.set('app.tables.displayLength', name, displayLength);
 };
 
-App.db.setStartIndex = function(name, startIndex) {
-  console.log('TRACE: Entering db:setStartIndex function');
-  App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data.app.tables.startIndex) {
-    App.db.data.app.tables.startIndex = {};
-  }
-  App.db.data.app.tables.startIndex[name] = startIndex;
-  localStorage.setObject('ambari', App.db.data);
+App.db.setStartIndex = function (name, startIndex) {
+  App.db.set('app.tables.startIndex', name, startIndex);
 };
 
-App.db.setSortingStatuses = function(name, sortingConditions) {
-  console.log('TRACE: Entering db:setSortingConditions function');
-  App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data.app.tables.sortingConditions) {
-    App.db.data.app.tables.sortingConditions = {};
-  }
-  App.db.data.app.tables.sortingConditions[name] = sortingConditions;
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setSelectedHosts = function(name, selectedHosts) {
-  console.log('TRACE: Entering db:setSelectedHosts function');
-  App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data.app.tables.selectedItems) {
-    App.db.data.app.tables.selectedItems = {};
-  }
-  App.db.data.app.tables.selectedItems[name] = selectedHosts;
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setAllHostNames = function (hostNames) {
-  console.log('TRACE: Entering db:setAllHostNames function');
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.Installer.hostNames = hostNames;
-  localStorage.setObject('ambari', App.db.data);
+App.db.setSortingStatuses = function (name, sortingConditions) {
+  App.db.set('app.tables.sortingConditions', name, sortingConditions);
 };
 
-App.db.setAllHostNamesPattern = function (hostNames) {
-  console.log('TRACE: Entering db:setAllHostNamesPattern function');
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.Installer.hostNamesPattern = hostNames;
-  localStorage.setObject('ambari', App.db.data);
+App.db.setSelectedHosts = function (name, selectedHosts) {
+  App.db.set('app.tables.selectedItems', name, selectedHosts);
 };
 
 App.db.setHosts = function (hostInfo) {
-  console.log('TRACE: Entering db:setHosts function');
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.Installer.hostInfo = hostInfo;
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setInstallOptions = function (installOptions) {
-  console.log('TRACE: Entering db:setInstallOptions function');
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.Installer.installOptions = installOptions;
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setBootStatus = function (status) {
-  console.log('TRACE: Entering db:setBootStatus function');
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.Installer.bootStatus = status;
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setService = function (serviceInfo) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.Installer.serviceInfo = serviceInfo;
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setSelectedServiceNames = function (serviceNames) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.Installer.selectedServiceNames = serviceNames;
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setClientsForSelectedServices = function (clientInfo) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.Installer.clientInfo = clientInfo;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('Installer', 'hostInfo', hostInfo);
 };
 
 App.db.setMasterComponentHosts = function (masterComponentHosts) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.Installer.masterComponentHosts = masterComponentHosts;
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setSlaveComponentHosts = function (slaveComponentHosts) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.Installer.slaveComponentHosts = slaveComponentHosts;
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setServiceConfigs = function (serviceConfigs) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.Installer.serviceConfigs = serviceConfigs;
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setServiceConfigProperties = function (configProperties) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.Installer.configProperties = configProperties;
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setCluster = function (status) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.Installer.clusterStatus = status;
-  console.log('db.setClusterStatus called: ' + JSON.stringify(status));
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setUpgradeOptions = function (upgradeOptions) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.StackUpgrade.upgradeOptions = upgradeOptions;
-  console.log('db.setUpgradeOptions called: ' + JSON.stringify(upgradeOptions));
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('Installer', 'masterComponentHosts', masterComponentHosts);
 };
 
 App.db.setMasterToReassign = function (masterComponent) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.ReassignMaster.masterComponent = masterComponent;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('ReassignMaster', 'masterComponent', masterComponent);
 };
 
 App.db.setReassignTasksStatuses = function (tasksStatuses) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.ReassignMaster.tasksStatuses = tasksStatuses;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('ReassignMaster', 'tasksStatuses', tasksStatuses);
 };
 
 App.db.setReassignTasksRequestIds = function (requestIds) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.ReassignMaster.tasksRequestIds = requestIds;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('ReassignMaster', 'tasksRequestIds', requestIds);
 };
 
 App.db.setStacks = function (stacks) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.Installer.stacksVersions = stacks;
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setServices = function (services) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.app.services = services;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('Installer', 'stacksVersions', stacks);
 };
 
 App.db.setConfigs = function (configs) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.app.configs = configs;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('app', 'configs', configs);
 };
 
 /**
@@ -394,10 +248,7 @@ App.db.setConfigs = function (configs) {
  * @param currentStep
  */
 App.db.setWizardCurrentStep = function (wizardType, currentStep) {
-  console.log('TRACE: Entering db:setWizardCurrentStep function');
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data[wizardType.capitalize()].currentStep = currentStep;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set(wizardType.capitalize(), 'currentStep', currentStep);
 };
 
 /**
@@ -408,237 +259,119 @@ App.db.setLocalStorage = function () {
 };
 
 App.db.setSecurityWizardStatus = function (status) {
-  App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data.AddSecurity) {
-    App.db.data.AddSecurity = {};
-  }
-  App.db.data.AddSecurity.status = status;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('AddSecurity', 'status', status);
 };
 
 App.db.setDisableSecurityStatus = function (status) {
-  App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data.AddSecurity) {
-    App.db.data.AddSecurity = {};
-  }
-  App.db.data.AddSecurity.disableSecurityStatus = status;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('AddSecurity', 'disableSecurityStatus', status);
 };
 
 App.db.setSecurityDeployCommands = function (commands) {
-  App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data.AddSecurity) {
-    App.db.data.AddSecurity = {};
-  }
-  App.db.data.AddSecurity.securityDeployCommands = commands;
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setSecureConfigProperties  = function (secureConfigs) {
-  App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data.AddSecurity) {
-    App.db.data.AddSecurity = {};
-  }
-  App.db.data.AddSecurity.secureConfigProperties = secureConfigs;
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setSecureUserInfo  = function (userInfo) {
-  App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data.AddSecurity) {
-    App.db.data.AddSecurity = {};
-  }
-  App.db.data.AddSecurity.secureUserInfo = userInfo;
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setIsNameNodeHa = function (haStatus) {
-  App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data.AddSecurity) {
-    App.db.data.AddSecurity = {};
-  }
-  App.db.data.AddSecurity.haStatus = haStatus;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('AddSecurity', 'securityDeployCommands', commands);
 };
 
 App.db.setHighAvailabilityWizardConfigTag = function (tag) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.HighAvailabilityWizard[tag.name] = tag.value;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('HighAvailabilityWizard', tag.name, tag.value);
 };
 
 App.db.setHighAvailabilityWizardHdfsClientHosts = function (hostNames) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.HighAvailabilityWizard.hdfsClientHostNames = hostNames;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('HighAvailabilityWizard', 'hdfsClientHostNames', hostNames);
 };
 
 App.db.setHighAvailabilityWizardTasksStatuses = function (tasksStatuses) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.HighAvailabilityWizard.tasksStatuses = tasksStatuses;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('HighAvailabilityWizard', 'tasksStatuses', tasksStatuses);
 };
 
 App.db.setHighAvailabilityWizardTasksRequestIds = function (requestIds) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.HighAvailabilityWizard.tasksRequestIds = requestIds;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('HighAvailabilityWizard', 'tasksRequestIds', requestIds);
 };
 
 App.db.setHighAvailabilityWizardHdfsUser = function (hdfsUser) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.HighAvailabilityWizard.hdfsUser = hdfsUser;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('HighAvailabilityWizard', 'hdfsUser', hdfsUser);
 };
 
 App.db.setHighAvailabilityWizardRequestIds = function (requestIds) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.HighAvailabilityWizard.requestIds = requestIds;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('HighAvailabilityWizard', 'requestIds', requestIds);
 };
 
 App.db.setHighAvailabilityWizardNameServiceId = function (nameServiceId) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.HighAvailabilityWizard.nameServiceId = nameServiceId;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('HighAvailabilityWizard', 'nameServiceId', nameServiceId);
 };
 
-
 App.db.setRollBackHighAvailabilityWizardAddNNHost = function (host) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.RollbackHighAvailabilityWizard.addNNHost = host;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('RollbackHighAvailabilityWizard', 'addNNHost', host);
 };
 
 App.db.setRollBackHighAvailabilityWizardSNNHost = function (host) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.RollbackHighAvailabilityWizard.sNNHost = host;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('RollbackHighAvailabilityWizard', 'sNNHost', host);
 };
 
 App.db.setRollBackHighAvailabilityWizardSelectedAddNN = function (host) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.RollbackHighAvailabilityWizard.selectedAddNN = host;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('RollbackHighAvailabilityWizard', 'selectedAddNN', host);
 };
 
 App.db.setRollBackHighAvailabilityWizardSelectedSNN = function (host) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.RollbackHighAvailabilityWizard.selectedSNNH = host;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('RollbackHighAvailabilityWizard', 'selectedSNNH', host);
 };
 
 App.db.setRollbackHighAvailabilityWizardTasksStatuses = function (tasksStatuses) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.RollbackHighAvailabilityWizard.tasksStatuses = tasksStatuses;
-  localStorage.setObject('ambari', App.db.data);
-};
-
-App.db.setRollbackHighAvailabilityWizardTasksRequestIds = function (requestIds) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.RollbackHighAvailabilityWizard.tasksRequestIds = requestIds;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('RollbackHighAvailabilityWizard', 'tasksStatuses', tasksStatuses);
 };
 
 App.db.setRollbackHighAvailabilityWizardRequestIds = function (requestIds) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.RollbackHighAvailabilityWizard.requestIds = requestIds;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('RollbackHighAvailabilityWizard', 'requestIds', requestIds);
 };
 
 App.db.setReassignMasterWizardRequestIds = function (requestIds) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.ReassignMaster.requestIds = requestIds;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('ReassignMaster', 'requestIds', requestIds);
 };
 
 App.db.setReassignMasterWizardComponentDir = function (componentDir) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.ReassignMaster.componentDir = componentDir;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('ReassignMaster', 'componentDir', componentDir);
 };
 
 App.db.setReassignMasterWizardReassignHosts = function (reassignHosts) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.ReassignMaster.reassignHosts = reassignHosts;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('ReassignMaster', 'reassignHosts', reassignHosts);
 };
 
 App.db.setKerberosWizardConfigTag = function (tag) {
-  App.db.data = localStorage.getObject('ambari');
-  App.db.data.KerberosWizard[tag.name] = tag.value;
-  localStorage.setObject('ambari', App.db.data);
+  App.db.set('KerberosWizard', tag.name, tag.value);
 };
 
-/*
- *  getter methods
- */
-
 /**
  * Get user model from db
  * @return {*}
  */
 App.db.getUser = function () {
-  console.log('TRACE: Entering db:getUser function');
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.app.user;
+  return App.db.get('app', 'user');
 };
 
 App.db.getLoginName = function () {
-  console.log('Trace: Entering db:getLoginName function');
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.app.loginName;
+  return App.db.get('app', 'loginName');
 };
 
 App.db.getAuthenticated = function () {
-  console.log('Trace: Entering db:getAuthenticated function');
-  App.db.data = localStorage.getObject('ambari');
-  return Boolean(App.db.data.app.authenticated);
+  return Boolean(App.db.get('app', 'authenticated'));
 };
 
-App.db.getFilterConditions = function(name) {
-  console.log('TRACE: Entering db:getFilterConditions function');
-  App.db.data = localStorage.getObject('ambari');
-  if (App.db.data.app.tables.filterConditions[name]) {
-    return App.db.data.app.tables.filterConditions[name];
-  }
-  return null;
+App.db.getFilterConditions = function (name) {
+  return name ? App.db.get('app.tables.filterConditions', name) : null;
 };
 
-App.db.getDisplayLength = function(name) {
-  console.log('TRACE: Entering db:getDisplayLength function');
-  App.db.data = localStorage.getObject('ambari');
-  if (App.db.data.app.tables.displayLength[name]) {
-    return App.db.data.app.tables.displayLength[name];
-  }
-  return null;
+App.db.getDisplayLength = function (name) {
+  return name ? App.db.get('app.tables.displayLength', name) : null;
 };
 
-App.db.getStartIndex = function(name) {
-  console.log('TRACE: Entering db:getStartIndex function');
-  App.db.data = localStorage.getObject('ambari');
-  if (App.db.data.app.tables.startIndex[name]) {
-    return App.db.data.app.tables.startIndex[name];
-  }
-  return null;
+App.db.getStartIndex = function (name) {
+  return name ? App.db.get('app.tables.startIndex', name): null;
 };
 
-App.db.getSortingStatuses = function(name) {
-  console.log('TRACE: Entering db:getSortingConditions function');
-  App.db.data = localStorage.getObject('ambari');
-  if (App.db.data.app.tables.sortingConditions[name]) {
-    return App.db.data.app.tables.sortingConditions[name];
-  }
-  return null;
+App.db.getSortingStatuses = function (name) {
+  return name ? App.db.get('app.tables.sortingConditions', name): null;
 };
 
-App.db.getSelectedHosts = function(name) {
-  console.log('TRACE: Entering db:getSelectedHosts function');
-  App.db.data = localStorage.getObject('ambari');
-  if (App.db.data.app.tables.selectedItems[name]) {
-    return App.db.data.app.tables.selectedItems[name];
-  }
-  return [];
+App.db.getSelectedHosts = function (name) {
+  return App.db.get('app.tables.selectedItems', name) || [];
 };
 
 /**
@@ -647,243 +380,103 @@ App.db.getSelectedHosts = function(name) {
  * @return {*}
  */
 App.db.getWizardCurrentStep = function (wizardType) {
-  console.log('Trace: Entering db:getWizardCurrentStep function for ', wizardType);
-  if (App.db.data[wizardType.capitalize()]) {
-    return App.db.data[wizardType.capitalize()].currentStep;
-  }
-  return 0;
+  return App.db.get(wizardType.capitalize(), 'currentStep') || 0;
 };
 
 App.db.getAllHostNames = function () {
-  console.log('TRACE: Entering db:getHostNames function');
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.Installer.hostNames;
-};
-
-App.db.getAllHostNamesPattern = function () {
-  console.log('TRACE: Entering db:getHostNamesPattern function');
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.Installer.hostNamesPattern;
-};
-App.db.getInstallOptions = function () {
-  console.log('TRACE: Entering db:getInstallOptions function');
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.Installer.installOptions;
-};
-
-App.db.isCompleted = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.Installer.completed;
+  return App.db.get('Installer', 'hostNames');
 };
 
 App.db.getHosts = function () {
-  console.log('TRACE: Entering db:getHosts function');
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.Installer.hostInfo;
-};
-
-App.db.getBootStatus = function () {
-  console.log('TRACE: Entering db:getBootStatus function');
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.Installer.bootStatus;
-};
-
-App.db.getService = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.Installer.serviceInfo;
-};
-
-App.db.getSelectedServiceNames = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.Installer.selectedServiceNames;
-};
-
-App.db.getClientsForSelectedServices = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.Installer.clientInfo;
-};
-
-App.db.getMasterComponentHosts = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.Installer.masterComponentHosts;
-};
-
-App.db.getSlaveComponentHosts = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.Installer.slaveComponentHosts;
-};
-
-App.db.getServiceConfigs = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.Installer.serviceConfigs;
-};
-
-App.db.getServiceConfigProperties = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.Installer.configProperties;
-};
-
-App.db.getCluster = function () {
-  console.log('TRACE: Entering db:getClusterStatus function');
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.Installer.clusterStatus;
+  return App.db.get('Installer', 'hostInfo');
 };
 
 App.db.getMasterToReassign = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.ReassignMaster.masterComponent;
+  return App.db.get('ReassignMaster', 'masterComponent');
 };
 
 App.db.getReassignTasksStatuses = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.ReassignMaster.tasksStatuses;
+  return App.db.get('ReassignMaster', 'tasksStatuses');
 };
 
 App.db.getReassignTasksRequestIds = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.ReassignMaster.tasksRequestIds;
-};
-
-App.db.getUpgradeOptions = function () {
-  console.log('TRACE: Entering db:getUpgradeOptions function');
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.StackUpgrade.upgradeOptions;
+  return App.db.get('ReassignMaster', 'tasksRequestIds');
 };
 
 App.db.getSecurityWizardStatus = function () {
-  App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data.AddSecurity) {
-    App.db.data.AddSecurity = {};
-  }
-  return App.db.data.AddSecurity.status;
+  return App.db.get('AddSecurity', 'status');
 };
 
 App.db.getDisableSecurityStatus = function () {
-  App.db.data = localStorage.getObject('ambari');
-  if (!App.db.data.AddSecurity) {
-    App.db.data.AddSecurity = {};
-  }
-  return App.db.data.AddSecurity.disableSecurityStatus;
-};
-
-App.db.getSecurityDeployCommands = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.AddSecurity.securityDeployCommands;
-};
-
-App.db.getSecureConfigProperties = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.AddSecurity.secureConfigProperties;
-};
-
-App.db.getSecureUserInfo  = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.AddSecurity.secureUserInfo;
-};
-
-App.db.getIsNameNodeHa = function (haStatus) {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.AddSecurity.haStatus;
+  return App.db.get('AddSecurity', 'disableSecurityStatus');
 };
 
 App.db.getStacks = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.Installer.stacksVersions;
-};
-
-App.db.getServices = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.app.services;
+  return App.db.get('Installer', 'stacksVersions');
 };
 
 App.db.getHighAvailabilityWizardHdfsUser = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.HighAvailabilityWizard.hdfsUser;
+  return App.db.get('HighAvailabilityWizard', 'hdfsUser');
 };
 
 App.db.getHighAvailabilityWizardTasksStatuses = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.HighAvailabilityWizard.tasksStatuses;
+  return App.db.get('HighAvailabilityWizard', 'tasksStatuses');
 };
 
 App.db.getHighAvailabilityWizardTasksRequestIds = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.HighAvailabilityWizard.tasksRequestIds;
+  return App.db.get('HighAvailabilityWizard', 'tasksRequestIds');
 };
 
 App.db.getHighAvailabilityWizardFailedTask = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.HighAvailabilityWizard.failedTask;
+  return App.db.get('HighAvailabilityWizard', 'failedTask');
 };
 
 App.db.getHighAvailabilityWizardHdfsClientHosts = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.HighAvailabilityWizard.hdfsClientHostNames;
+  return App.db.get('HighAvailabilityWizard', 'hdfsClientHostNames');
 };
 
 App.db.getHighAvailabilityWizardConfigTag = function (tag) {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.HighAvailabilityWizard[tag];
+  return App.db.get('HighAvailabilityWizard', tag);
 };
 
 App.db.getHighAvailabilityWizardRequestIds = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.HighAvailabilityWizard.requestIds;
+  return App.db.get('HighAvailabilityWizard', 'requestIds');
 };
 
 App.db.getHighAvailabilityWizardNameServiceId = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.HighAvailabilityWizard.nameServiceId;
+  return App.db.get('HighAvailabilityWizard', 'nameServiceId');
 };
 
 App.db.getRollbackHighAvailabilityWizardTasksStatuses = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.RollbackHighAvailabilityWizard.tasksStatuses;
-};
-
-App.db.getRollbackHighAvailabilityWizardTasksRequestIds = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.ReassignMaster.tasksRequestIds;
+  return App.db.get('RollbackHighAvailabilityWizard', 'tasksStatuses');
 };
 
 App.db.getRollbackHighAvailabilityWizardRequestIds = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.RollbackHighAvailabilityWizard.requestIds;
+  return App.db.get('RollbackHighAvailabilityWizard', 'requestIds');
 };
 
-App.db.getRollBackHighAvailabilityWizardAddNNHost = function (host) {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.RollbackHighAvailabilityWizard.addNNHost;
+App.db.getRollBackHighAvailabilityWizardAddNNHost = function () {
+  return App.db.get('RollbackHighAvailabilityWizard', 'addNNHost');
 };
 
-App.db.getRollBackHighAvailabilityWizardSNNHost = function (host) {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.RollbackHighAvailabilityWizard.sNNHost;
+App.db.getRollBackHighAvailabilityWizardSNNHost = function () {
+  return App.db.get('RollbackHighAvailabilityWizard', 'sNNHost');
 };
 
 App.db.getReassignMasterWizardRequestIds = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.ReassignMaster.requestIds;
+  return App.db.get('ReassignMaster', 'requestIds');
 };
 
 App.db.getReassignMasterWizardComponentDir = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.ReassignMaster.componentDir;
+  return App.db.get('ReassignMaster', 'componentDir');
 };
 
 App.db.getConfigs = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.app.configs;
+  return App.db.get('app', 'configs');
 };
 
 App.db.getReassignMasterWizardReassignHosts = function () {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.ReassignMaster.reassignHosts;
-};
-
-App.db.getKerberosWizardConfigTag = function (tag) {
-  App.db.data = localStorage.getObject('ambari');
-  return App.db.data.KerberosWizard[tag];
+  return App.db.get('ReassignMaster', 'reassignHosts');
 };
 
 module.exports = App.db;

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/app/utils/ember_reopen.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ember_reopen.js b/ambari-web/app/utils/ember_reopen.js
index 4446f1e..08f61b8 100644
--- a/ambari-web/app/utils/ember_reopen.js
+++ b/ambari-web/app/utils/ember_reopen.js
@@ -151,7 +151,7 @@ Ember.RadioButton = Ember.Checkbox.extend({
  *   var a = {b: {}};
  *   var path = 'b.c.d';
  *   var value = 1;
- *   Em.setFullPath(a, path, value); // a = {b: {c: {d: 1}}
+ *   Em.setFullPath(a, path, value); // a = {b: {c: {d: 1}}}
  * </code>
  *
  * @param {object} obj
@@ -174,6 +174,20 @@ Ember.setFullPath = function (obj, path, value) {
   });
 };
 
+/**
+ *
+ * @param {object} target
+ * @param {string[]} propertyNames
+ * @returns {{}}
+ */
+Ember.getProperties = function (target, propertyNames) {
+  var ret = {};
+  for(var i = 0; i < propertyNames.length; i++) {
+    ret[propertyNames[i]] = Em.get(target, propertyNames[i]);
+  }
+  return ret;
+};
+
 Em.View.reopen({
   /**
    * overwritten set method of Ember.View to avoid uncaught errors

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/test/controllers/wizard/slave_component_groups_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/slave_component_groups_controller.js b/ambari-web/test/controllers/wizard/slave_component_groups_controller.js
index e692a4f..a0bb296 100644
--- a/ambari-web/test/controllers/wizard/slave_component_groups_controller.js
+++ b/ambari-web/test/controllers/wizard/slave_component_groups_controller.js
@@ -273,37 +273,6 @@ describe('App.SlaveComponentGroupsController', function () {
     });
   });
 
-  describe('#selectedSlaveComponent', function () {
-    beforeEach(function () {
-      sinon.stub(App.router, 'get').returns(Em.A([
-        Em.Object.create({
-          serviceName: 'HDFS',
-          configCategories: Em.A([
-            Em.Object.create({
-              isForSlaveComponent: true,
-              primaryName: 'sl1',
-              slaveConfigs: Em.A([]),
-              name: 'name'
-            })
-          ])
-        })
-      ]));
-    });
-    afterEach(function () {
-      App.router.get.restore();
-    });
-    it('should return selected component name', function () {
-      var controller = App.SlaveComponentGroupsController.create({
-        content: {}
-      });
-      controller.set('selectedComponentName', Em.Object.create({
-        displayName: 'name'
-      }));
-      controller.set('selectedComponentName', 'value')
-      expect(controller.get('selectedSlaveComponent')).to.be.null;
-    });
-  });
-
   describe('#removeSlaveComponentGroup', function () {
     beforeEach(function() {
       sinon.stub(controller, 'componentProperties').returns(Em.A([]));

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/test/controllers/wizard/step6_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step6_test.js b/ambari-web/test/controllers/wizard/step6_test.js
index b5630c6..bbb7442 100644
--- a/ambari-web/test/controllers/wizard/step6_test.js
+++ b/ambari-web/test/controllers/wizard/step6_test.js
@@ -47,7 +47,6 @@ var controller,
 describe('App.WizardStep6Controller', function () {
 
   beforeEach(function () {
-    sinon.stub(console, 'error', Em.K);
     controller = App.WizardStep6Controller.create();
     controller.set('content', Em.Object.create({
       hosts: {},
@@ -72,10 +71,6 @@ describe('App.WizardStep6Controller', function () {
 
   });
 
-  afterEach(function () {
-    console.error.restore();
-  });
-
   describe('#isAddHostWizard', function () {
     it('true if content.controllerName is addHostController', function () {
       controller.set('content.controllerName', 'addHostController');

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/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 36caa02..eaa5108 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -106,12 +106,10 @@ describe('App.InstallerStep7Controller', function () {
         serviceConfigProperties: []
       })
     });
-    sinon.stub(console, 'error', Em.K);
   });
 
   afterEach(function() {
     App.config.setPreDefinedServiceConfigs.restore();
-    console.error.restore();
   });
 
   describe('#installedServiceNames', function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/test/controllers/wizard/step8_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step8_test.js b/ambari-web/test/controllers/wizard/step8_test.js
index 0eb3ed5..56c795c 100644
--- a/ambari-web/test/controllers/wizard/step8_test.js
+++ b/ambari-web/test/controllers/wizard/step8_test.js
@@ -60,11 +60,6 @@ describe('App.WizardStep8Controller', function () {
       configs: configs
     });
     configurationController = App.MainServiceInfoConfigsController.create({});
-    sinon.stub(console, 'error', Em.K);
-  });
-
-  afterEach(function () {
-    console.error.restore();
   });
 
   var siteObjTests = Em.A([

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/test/controllers/wizard_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard_test.js b/ambari-web/test/controllers/wizard_test.js
index 420e8eb..316ec2d 100644
--- a/ambari-web/test/controllers/wizard_test.js
+++ b/ambari-web/test/controllers/wizard_test.js
@@ -145,7 +145,7 @@ describe('App.WizardController', function () {
 
     wizardController.setProperties({
       content: {},
-      name: 'wizard'
+      name: 'wizardController'
     });
 
     beforeEach(function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/test/init_router_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/init_router_test.js b/ambari-web/test/init_router_test.js
deleted file mode 100644
index a6365e7..0000000
--- a/ambari-web/test/init_router_test.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-var App = require('app');
-
-//mock App.router object
-App.router = Em.Object.create({
-  transitionTo: Em.K,
-  configurationController: Em.Object.create({
-    getConfigsByTags: Em.K
-  }),
-  backgroundOperationsController: Em.Object.create({
-    services: []
-  })
-});

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/test/mixins/common/reload_popup_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/common/reload_popup_test.js b/ambari-web/test/mixins/common/reload_popup_test.js
index 32b815f..7ed0cff 100644
--- a/ambari-web/test/mixins/common/reload_popup_test.js
+++ b/ambari-web/test/mixins/common/reload_popup_test.js
@@ -144,7 +144,6 @@ describe('App.ReloadPopupMixin', function () {
 
     beforeEach(function () {
       sinon.stub(obj, 'closeReloadPopup', Em.K);
-      sinon.stub(console, 'log', Em.K);
       sinon.stub(App.ajax, 'defaultErrorHandler', Em.K);
       sinon.stub(obj, 'showReloadPopup', Em.K);
       sinon.stub(App, 'get').withArgs('maxRetries').returns(3);
@@ -153,7 +152,6 @@ describe('App.ReloadPopupMixin', function () {
 
     afterEach(function () {
       obj.closeReloadPopup.restore();
-      console.log.restore();
       App.ajax.defaultErrorHandler.restore();
       obj.showReloadPopup.restore();
       App.get.restore();
@@ -167,7 +165,6 @@ describe('App.ReloadPopupMixin', function () {
         }
         obj.reloadErrorCallback.apply(obj, item.args);
         expect(obj.closeReloadPopup.callCount).to.equal(item.closeReloadPopupCallCount);
-        expect(console.log.callCount).to.equal(item.consoleLogCallCount);
         expect(App.ajax.defaultErrorHandler.callCount).to.equal(item.defaultErrorHandlerCallCount);
         expect(obj.showReloadPopup.callCount).to.equal(item.showReloadPopupCallCount);
         expect(window.setTimeout.callCount).to.equal(item.setTimeoutCount);

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/test/router_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/router_test.js b/ambari-web/test/router_test.js
index 057a13f..4539525 100644
--- a/ambari-web/test/router_test.js
+++ b/ambari-web/test/router_test.js
@@ -212,10 +212,10 @@ describe('App.Router', function () {
   describe("#loginGetClustersSuccessCallback()", function () {
     var mock = {dataLoading: Em.K};
     beforeEach(function () {
-      sinon.stub(router, 'setClusterInstalled');
-      sinon.stub(router, 'transitionToApp');
-      sinon.stub(router, 'transitionToViews');
-      sinon.stub(router, 'transitionToAdminView');
+      sinon.stub(router, 'setClusterInstalled', Em.K);
+      sinon.stub(router, 'transitionToApp', Em.K);
+      sinon.stub(router, 'transitionToViews', Em.K);
+      sinon.stub(router, 'transitionToAdminView', Em.K);
       sinon.stub(App.router, 'get').returns(mock);
       sinon.spy(mock, 'dataLoading');
       App.setProperties({

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/test/utils/db_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/db_test.js b/ambari-web/test/utils/db_test.js
new file mode 100644
index 0000000..67ad5fe
--- /dev/null
+++ b/ambari-web/test/utils/db_test.js
@@ -0,0 +1,97 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+describe('App.db', function () {
+
+  describe('#App.db.set', function () {
+
+    afterEach(function () {
+      App.db.cleanUp();
+    });
+
+    it('should create one object', function () {
+      App.db.set('a', 'b', 1);
+      expect(App.db.data.a.b).to.equal(1);
+    });
+
+    it('should create nested objects', function () {
+      App.db.set('b.c', 'd', 1);
+      expect(App.db.data.b.c.d).to.equal(1);
+    });
+
+  });
+
+  describe('#App.db.get', function () {
+
+    after(function () {
+      App.db.cleanUp();
+    });
+
+    it('should return undefined', function () {
+      var ret = App.db.get('a', 'b');
+      expect(ret).to.be.undefined;
+    });
+
+    it('should return set value', function () {
+      App.db.set('a', 'b', 10);
+      var ret = App.db.get('a', 'b');
+      expect(ret).to.equal(10);
+    });
+
+  });
+
+  describe('#App.db.setProperties', function () {
+
+    afterEach(function () {
+      App.db.cleanUp();
+    });
+
+    it('should create one object', function () {
+      App.db.setProperties('a', {b: 1, c: 2});
+      expect(App.db.data.a).to.eql({b: 1, c: 2});
+    });
+
+    it('should create nested objects', function () {
+      App.db.setProperties('b.c', {b: 1, c: 2});
+      expect(App.db.data.b.c).to.eql({b: 1, c: 2});
+    });
+
+  });
+
+  describe('#App.db.getProperties', function () {
+
+    after(function () {
+      App.db.cleanUp();
+    });
+
+    it('should return undefined', function () {
+      var ret = App.db.getProperties('a', ['b', 'c']);
+      expect(ret).to.eql({b: undefined, c: undefined});
+    });
+
+    it('should return set value', function () {
+      App.db.setProperties('a', {b: 1, c: 2});
+      var ret = App.db.getProperties('a', ['b', 'c']);
+      expect(ret).to.eql({b: 1, c: 2});
+    });
+
+  });
+
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/test/views/common/table_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/table_view_test.js b/ambari-web/test/views/common/table_view_test.js
index 76800a6..ab7c89b 100644
--- a/ambari-web/test/views/common/table_view_test.js
+++ b/ambari-web/test/views/common/table_view_test.js
@@ -30,10 +30,12 @@ describe('App.TableView', function () {
 
   beforeEach(function() {
     App.db.cleanUp();
+    sinon.stub(App.db, 'setFilterConditions', Em.K);
   });
 
   afterEach(function() {
     App.db.cleanUp();
+    App.db.setFilterConditions.restore();
   });
 
   describe('#init', function() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
index a638687..84ad604 100644
--- a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
+++ b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_version_box_view_test.js
@@ -25,7 +25,10 @@ describe('App.UpgradeVersionBoxView', function () {
   var view;
 
   beforeEach(function () {
+    sinon.stub(App.db, 'setFilterConditions', Em.K);
+    sinon.stub(App.db, 'getFilterConditions', function () {return [];});
     view = App.UpgradeVersionBoxView.create({
+      initFilters: Em.K,
       controller: Em.Object.create({
         upgrade: Em.K
       }),
@@ -36,6 +39,11 @@ describe('App.UpgradeVersionBoxView', function () {
     });
   });
 
+  afterEach(function () {
+    App.db.setFilterConditions.restore();
+    App.db.getFilterConditions.restore();
+  });
+
   describe("#isUpgrading", function () {
     afterEach(function () {
       App.set('upgradeState', 'INIT');
@@ -173,6 +181,7 @@ describe('App.UpgradeVersionBoxView', function () {
     });
     it("link parent element is disabled", function () {
       jQueryMock.returns({
+        height: Em.K,
         hasClass: Em.K,
         parent: function () {
           return {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/test/views/main/alert_definitions_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/alert_definitions_view_test.js b/ambari-web/test/views/main/alert_definitions_view_test.js
index c817e88..ad62856 100644
--- a/ambari-web/test/views/main/alert_definitions_view_test.js
+++ b/ambari-web/test/views/main/alert_definitions_view_test.js
@@ -26,6 +26,19 @@ describe('App.MainAlertDefinitionsView', function () {
 
   beforeEach(function () {
     view = App.MainAlertDefinitionsView.create({});
+    sinon.stub(App.db, 'setFilterConditions', Em.K);
+    sinon.stub(App.db, 'getFilterConditions', Em.K);
+    sinon.stub(App.db, 'getDisplayLength', Em.K);
+    sinon.stub(App.db, 'setStartIndex', Em.K);
+    sinon.stub(view, 'initFilters', Em.K);
+  });
+
+  afterEach(function () {
+    App.db.setFilterConditions.restore();
+    App.db.getFilterConditions.restore();
+    App.db.getDisplayLength.restore();
+    App.db.setStartIndex.restore();
+    view.initFilters.restore();
   });
 
   describe('#serviceFilterView', function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/test/views/main/alerts/definition_details_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/alerts/definition_details_view_test.js b/ambari-web/test/views/main/alerts/definition_details_view_test.js
index ff336a0..ae4ac99 100644
--- a/ambari-web/test/views/main/alerts/definition_details_view_test.js
+++ b/ambari-web/test/views/main/alerts/definition_details_view_test.js
@@ -24,7 +24,9 @@ describe('App.MainAlertDefinitionDetailsView', function () {
 
   beforeEach(function () {
 
-    view = App.MainAlertDefinitionDetailsView.create();
+    view = App.MainAlertDefinitionDetailsView.create({
+      initFilters: Em.K
+    });
 
     instanceTableRow = view.get('instanceTableRow').create();
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/test/views/main/alerts/manage_alert_groups/select_definitions_popup_body_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/alerts/manage_alert_groups/select_definitions_popup_body_view_test.js b/ambari-web/test/views/main/alerts/manage_alert_groups/select_definitions_popup_body_view_test.js
index d7b3e95..9ba7bf6 100644
--- a/ambari-web/test/views/main/alerts/manage_alert_groups/select_definitions_popup_body_view_test.js
+++ b/ambari-web/test/views/main/alerts/manage_alert_groups/select_definitions_popup_body_view_test.js
@@ -28,6 +28,17 @@ describe('App.SelectDefinitionsPopupBodyView', function () {
     view = App.SelectDefinitionsPopupBodyView.create({
       parentView: Em.Object.create()
     });
+    sinon.stub(App.db, 'setFilterConditions', Em.K);
+    sinon.stub(App.db, 'getFilterConditions', function () {
+      return [];
+    });
+    sinon.stub(view, 'initFilters', Em.K)
+  });
+
+  afterEach(function () {
+    App.db.setFilterConditions.restore();
+    App.db.getFilterConditions.restore();
+    view.initFilters.restore();
   });
 
   describe("#filteredContentObs()", function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5d1aeeb/ambari-web/test/views/main/host/details_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/host/details_test.js b/ambari-web/test/views/main/host/details_test.js
index 05739f7..34f4c28 100644
--- a/ambari-web/test/views/main/host/details_test.js
+++ b/ambari-web/test/views/main/host/details_test.js
@@ -134,7 +134,6 @@ describe('App.MainHostDetailsView', function () {
 
     it('should get only clients with configs', function() {
       expect(view.get('clientsWithConfigs')).to.have.length(1);
-      console.log(view.get('content.hostComponents'));
       view.get('content.hostComponents').pushObject(Em.Object.create({
         isClient: true,
         service: Em.Object.create({


Mime
View raw message