You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2015/04/10 15:25:54 UTC

ambari git commit: AMBARI-10436 RU - Fails if in Oozie if hadoop-lzo codec is enabled after version bits have been distributed. (atkach)

Repository: ambari
Updated Branches:
  refs/heads/trunk 26472889f -> fc8552e54


AMBARI-10436 RU - Fails if in Oozie if hadoop-lzo codec is enabled after version bits have been distributed. (atkach)


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

Branch: refs/heads/trunk
Commit: fc8552e54cf59b342de5f0ebbdfd26090780fd6b
Parents: 2647288
Author: Andrii Tkach <at...@hortonworks.com>
Authored: Fri Apr 10 16:09:52 2015 +0300
Committer: Andrii Tkach <at...@hortonworks.com>
Committed: Fri Apr 10 16:25:44 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/messages.js                      |   1 +
 ambari-web/app/styles/stack_versions.less       |  13 +-
 .../admin/stack_upgrade/upgrade_version_box.hbs |  15 +-
 .../stack_upgrade/upgrade_version_box_view.js   |  28 +-
 .../upgrade_version_box_view_test.js            | 489 ++++++++++++++++++-
 5 files changed, 527 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/fc8552e5/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index cf0f61e..cc92d2d 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -1351,6 +1351,7 @@ Em.I18n.translations = {
     ' and go to the <b>Ambari Administration</b> interface. You can return to cluster management by using the' +
     ' “Go to Dashboard” link in the Ambari Administration > Clusters section.',
   'admin.stackVersions.version.installNow': "Install Packages",
+  'admin.stackVersions.version.reinstall': "Reinstall Packages",
   'admin.stackVersions.version.performUpgrade': "Perform Upgrade",
   'admin.stackVersions.version.upgrade.pause': "Upgrade: Action Required",
   'admin.stackVersions.version.upgrade.running': "Upgrade: In Process",

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc8552e5/ambari-web/app/styles/stack_versions.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/stack_versions.less b/ambari-web/app/styles/stack_versions.less
index a54953b..a979ab5 100644
--- a/ambari-web/app/styles/stack_versions.less
+++ b/ambari-web/app/styles/stack_versions.less
@@ -144,7 +144,7 @@
     position: relative;
     background: none repeat scroll 0 0 #fff;
     border: 1px solid #d2d9dd;
-    height: 168px;
+    height: 198px;
     margin: 15px 15px 0 0;
     padding: 5px 0px;
     a.not-active:hover {
@@ -159,7 +159,7 @@
       color: orange;
     }
     .state {
-      margin: 15px 0;
+      margin: 30px 0;
       line-height: 30px;
       padding-top: 5px;
       height: 30px;
@@ -173,7 +173,7 @@
       }
     }
     .installing {
-      margin-top: 10px;
+      margin-top: 25px;
       padding-top: 0;
       padding-bottom: 10px;
       .progress {
@@ -182,6 +182,13 @@
         margin: 0 20%;
       }
     }
+    .multiple-buttons-container {
+      margin: 10px 0;
+      height: 60px;
+      button {
+        margin-top: 5px;
+      }
+    }
     .host-link a {
       color: #0088cc;
       font-size: 14px;

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc8552e5/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs
index 621e959..08324e1 100644
--- a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs
+++ b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_version_box.hbs
@@ -27,13 +27,16 @@
   </a>
 </p>
 <p class="repository-name">({{view.content.repositoryVersion}})</p>
-<div {{bindAttr class="view.stateElement.isInstalling:installing :align-center :state"}}>
+<div {{bindAttr class="view.stateElement.isInstalling:installing view.stateElement.hasMultipleButtons:multiple-buttons-container :align-center :state"}}>
   {{#if view.stateElement.isButton}}
-    <button class="btn btn-primary"
-      {{action runAction target="view"}}
-      {{bindAttr disabled="view.stateElement.isDisabled"}}>
-      {{view.stateElement.text}}
-    </button>
+    {{#each button in view.stateElement.buttons}}
+      <button class="btn btn-primary"
+        {{action runAction button.action target="view"}}
+        {{bindAttr disabled="view.stateElement.isDisabled"}}>
+        {{button.text}}
+      </button>
+      <br />
+    {{/each}}
   {{/if}}
   {{#if view.stateElement.isLabel}}
     <span {{bindAttr class="view.stateElement.class"}}>{{view.stateElement.text}}</span>

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc8552e5/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
index 51d85a1..3a77b82 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
@@ -106,7 +106,11 @@ App.UpgradeVersionBoxView = Em.View.extend({
       isInstalling: function () {
         return this.get('status') === 'INSTALLING';
       }.property('status'),
-      isDisabled: false
+      isDisabled: false,
+      buttons: [],
+      hasMultipleButtons: function () {
+        return this.get('buttons.length') > 1;
+      }.property('buttons.length')
     });
     var isInstalling = this.get('parentView.repoVersions').someProperty('status', 'INSTALLING');
 
@@ -116,8 +120,10 @@ App.UpgradeVersionBoxView = Em.View.extend({
       element.set('class', 'label label-success');
     } else if (['INIT', 'INSTALL_FAILED', 'OUT_OF_SYNC'].contains(status)) {
       element.set('isButton', true);
-      element.set('text', Em.I18n.t('admin.stackVersions.version.installNow'));
-      element.set('action', 'installRepoVersionConfirmation');
+      element.get('buttons').pushObject({
+        text: Em.I18n.t('admin.stackVersions.version.installNow'),
+        action: 'installRepoVersionConfirmation'
+      });
       element.set('isDisabled', !App.isAccessible('ADMIN') || this.get('controller.requestInProgress') || isInstalling);
     } else if (status === 'INSTALLING') {
       element.set('iconClass', 'icon-cog');
@@ -127,8 +133,16 @@ App.UpgradeVersionBoxView = Em.View.extend({
     } else if (status === 'INSTALLED' && !this.get('isUpgrading')) {
       if (stringUtils.compareVersions(this.get('content.repositoryVersion'), currentVersion.repository_version) === 1) {
         element.set('isButton', true);
-        element.set('text', Em.I18n.t('admin.stackVersions.version.performUpgrade'));
-        element.set('action', 'confirmUpgrade');
+        element.get('buttons').pushObjects([
+          {
+            text: Em.I18n.t('admin.stackVersions.version.performUpgrade'),
+            action: 'confirmUpgrade'
+          },
+          {
+            text: Em.I18n.t('admin.stackVersions.version.reinstall'),
+            action: 'installRepoVersionConfirmation'
+          }
+        ]);
         element.set('isDisabled', !App.isAccessible('ADMIN') || this.get('controller.requestInProgress') || isInstalling);
       } else {
         element.set('iconClass', 'icon-ok');
@@ -167,8 +181,8 @@ App.UpgradeVersionBoxView = Em.View.extend({
   /**
    * run custom action of controller
    */
-  runAction: function () {
-    var action = this.get('stateElement.action');
+  runAction: function (event) {
+    var action = event && event.context || this.get('stateElement.action');
     if (action) {
       this.get('controller')[action](this.get('content'));
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/fc8552e5/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 62d6635..28d881c 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
@@ -122,7 +122,6 @@ describe('App.UpgradeVersionBoxView', function () {
 
   describe("#runAction()", function () {
     beforeEach(function () {
-      view.set('stateElement', Em.Object.create({}));
       sinon.stub(view.get('controller'), 'upgrade').returns(1);
     });
     afterEach(function () {
@@ -130,12 +129,19 @@ describe('App.UpgradeVersionBoxView', function () {
     });
     it("action = null", function () {
       view.set('stateElement.action', null);
-      view.runAction();
+      view.runAction({context: null});
       expect(view.get('controller').upgrade.called).to.be.false;
     });
     it("action = 'upgrade'", function () {
       view.set('content', 'content');
-      view.set('stateElement.action', 'upgrade');
+      view.runAction({context: 'upgrade'});
+      expect(view.get('controller').upgrade.calledWith('content')).to.be.true;
+    });
+    it("action is taken from stateElement", function () {
+      view.setProperties({
+        'content': 'content',
+        'stateElement.action': 'upgrade'
+      });
       view.runAction();
       expect(view.get('controller').upgrade.calledWith('content')).to.be.true;
     });
@@ -233,5 +239,482 @@ describe('App.UpgradeVersionBoxView', function () {
     });
   });
 
+  describe('stateElement', function () {
+
+    var cases = [
+      {
+        inputData: {
+          'content.status': 'CURRENT'
+        },
+        expected: {
+          status: 'CURRENT',
+          isLabel: true,
+          text: Em.I18n.t('common.current'),
+          class: 'label label-success',
+          hasMultipleButtons: false
+        },
+        title: 'current version'
+      },
+      {
+        inputData: {
+          'content.status': 'INIT',
+          'controller.requestInProgress': false,
+          'parentView.repoVersions': [
+            Em.Object.create({
+              status: 'INIT'
+            })
+          ]
+        },
+        setup: function () {
+          this.isAccessibleMock.withArgs('ADMIN').returns(false);
+        },
+        expected: {
+          status: 'INIT',
+          isButton: true,
+          buttons: [
+            {
+              text: Em.I18n.t('admin.stackVersions.version.installNow'),
+              action: 'installRepoVersionConfirmation'
+            }
+          ],
+          isDisabled: true,
+          hasMultipleButtons: false
+        },
+        title: 'INIT state, no admin access, no requests in progress'
+      },
+      {
+        inputData: {
+          'content.status': 'INIT',
+          'controller.requestInProgress': true,
+          'parentView.repoVersions': [
+            Em.Object.create({
+              status: 'INIT'
+            })
+          ]
+        },
+        setup: function () {
+          this.isAccessibleMock.withArgs('ADMIN').returns(false);
+        },
+        expected: {
+          status: 'INIT',
+          isButton: true,
+          buttons: [
+            {
+              text: Em.I18n.t('admin.stackVersions.version.installNow'),
+              action: 'installRepoVersionConfirmation'
+            }
+          ],
+          isDisabled: true,
+          hasMultipleButtons: false
+        },
+        title: 'INIT state, no admin access, request in progress, not installation'
+      },
+      {
+        inputData: {
+          'content.status': 'INSTALL_FAILED',
+          'controller.requestInProgress': true,
+          'parentView.repoVersions': [
+            Em.Object.create({
+              status: 'INSTALL_FAILED'
+            }),
+            Em.Object.create({
+              status: 'INSTALLING'
+            })
+          ]
+        },
+        setup: function () {
+          this.isAccessibleMock.withArgs('ADMIN').returns(false);
+        },
+        expected: {
+          status: 'INSTALL_FAILED',
+          isButton: true,
+          buttons: [
+            {
+              text: Em.I18n.t('admin.stackVersions.version.installNow'),
+              action: 'installRepoVersionConfirmation'
+            }
+          ],
+          isDisabled: true,
+          hasMultipleButtons: false
+        },
+        title: 'install failed, no admin access, request in progress, another installation running'
+      },
+      {
+        inputData: {
+          'content.status': 'INSTALL_FAILED',
+          'controller.requestInProgress': false,
+          'parentView.repoVersions': [
+            Em.Object.create({
+              status: 'INSTALL_FAILED'
+            }),
+            Em.Object.create({
+              status: 'INSTALLING'
+            })
+          ]
+        },
+        setup: function () {
+          this.isAccessibleMock.withArgs('ADMIN').returns(false);
+        },
+        expected: {
+          status: 'INSTALL_FAILED',
+          isButton: true,
+          buttons: [
+            {
+              text: Em.I18n.t('admin.stackVersions.version.installNow'),
+              action: 'installRepoVersionConfirmation'
+            }
+          ],
+          isDisabled: true,
+          hasMultipleButtons: false
+        },
+        title: 'install failed, no admin access, no requests in progress, another installation running'
+      },
+      {
+        inputData: {
+          'content.status': 'OUT_OF_SYNC',
+          'controller.requestInProgress': false,
+          'parentView.repoVersions': [
+            Em.Object.create({
+              status: 'OUT_OF_SYNC'
+            })
+          ]
+        },
+        setup: function () {
+          this.isAccessibleMock.withArgs('ADMIN').returns(true);
+        },
+        expected: {
+          status: 'OUT_OF_SYNC',
+          isButton: true,
+          buttons: [
+            {
+              text: Em.I18n.t('admin.stackVersions.version.installNow'),
+              action: 'installRepoVersionConfirmation'
+            }
+          ],
+          isDisabled: false,
+          hasMultipleButtons: false
+        },
+        title: 'version out of sync, admin access, no requests in progress, no installation'
+      },
+      {
+        inputData: {
+          'content.status': 'OUT_OF_SYNC',
+          'controller.requestInProgress': true,
+          'parentView.repoVersions': [
+            Em.Object.create({
+              status: 'OUT_OF_SYNC'
+            })
+          ]
+        },
+        setup: function () {
+          this.isAccessibleMock.withArgs('ADMIN').returns(true);
+        },
+        expected: {
+          status: 'OUT_OF_SYNC',
+          isButton: true,
+          buttons: [
+            {
+              text: Em.I18n.t('admin.stackVersions.version.installNow'),
+              action: 'installRepoVersionConfirmation'
+            }
+          ],
+          isDisabled: true,
+          hasMultipleButtons: false
+        },
+        title: 'version out of sync, admin access, request in progress, no installation'
+      },
+      {
+        inputData: {
+          'content.status': 'INSTALLED',
+          'controller.currentVersion': {
+            repository_version: '2.2.1'
+          },
+          'content.repositoryVersion': '2.2.0',
+          'controller.upgradeVersion': 'HDP-2.2.1',
+          'content.displayName': 'HDP-2.2.0'
+        },
+        expected: {
+          status: 'INSTALLED',
+          isLink: true,
+          iconClass: 'icon-ok',
+          text: Em.I18n.t('common.installed'),
+          action: null,
+          hasMultipleButtons: false
+        },
+        title: 'installed version, earlier than current one'
+      },
+      {
+        inputData: {
+          'content.status': 'INSTALLED',
+          'controller.requestInProgress': true,
+          'parentView.repoVersions': [
+            Em.Object.create({
+              status: 'INSTALLED'
+            }),
+            Em.Object.create({
+              status: 'INSTALLING'
+            })
+          ],
+          'controller.currentVersion': {
+            repository_version: '2.2.0'
+          },
+          'content.repositoryVersion': '2.2.1',
+          'controller.upgradeVersion': 'HDP-2.2.0',
+          'content.displayName': 'HDP-2.2.1'
+        },
+        setup: function () {
+          this.isAccessibleMock.withArgs('ADMIN').returns(true);
+        },
+        expected: {
+          status: 'INSTALLED',
+          isButton: true,
+          buttons: [
+            {
+              text: Em.I18n.t('admin.stackVersions.version.performUpgrade'),
+              action: 'confirmUpgrade'
+            },
+            {
+              text: Em.I18n.t('admin.stackVersions.version.reinstall'),
+              action: 'installRepoVersionConfirmation'
+            }
+          ],
+          isDisabled: true,
+          hasMultipleButtons: true
+        },
+        title: 'installed version, later than current one, admin access, request in progress, another installation running'
+      },
+      {
+        inputData: {
+          'content.status': 'INSTALLED',
+          'controller.requestInProgress': false,
+          'parentView.repoVersions': [
+            Em.Object.create({
+              status: 'INSTALLED'
+            }),
+            Em.Object.create({
+              status: 'INSTALLING'
+            })
+          ],
+          'controller.currentVersion': {
+            repository_version: '2.2.0'
+          },
+          'content.repositoryVersion': '2.2.1',
+          'controller.upgradeVersion': 'HDP-2.2.1',
+          'content.displayName': 'HDP-2.2.0'
+        },
+        setup: function () {
+          this.isAccessibleMock.withArgs('ADMIN').returns(true);
+        },
+        expected: {
+          status: 'INSTALLED',
+          isButton: true,
+          buttons: [
+            {
+              text: Em.I18n.t('admin.stackVersions.version.performUpgrade'),
+              action: 'confirmUpgrade'
+            },
+            {
+              text: Em.I18n.t('admin.stackVersions.version.reinstall'),
+              action: 'installRepoVersionConfirmation'
+            }
+          ],
+          isDisabled: true,
+          hasMultipleButtons: true
+        },
+        title: 'installed version, later than current one, admin access, no requests in progress, another installation running'
+      },
+      {
+        inputData: {
+          'content.status': 'INSTALLED',
+          'controller.isDowngrade': true,
+          'controller.upgradeVersion': 'HDP-2.2.1',
+          'content.displayName': 'HDP-2.2.1'
+        },
+        setup: function () {
+          this.getMock.withArgs('upgradeState').returns(null);
+        },
+        expected: {
+          status: 'INSTALLED',
+          isLink: true,
+          action: 'openUpgradeDialog',
+          iconClass: 'icon-cog',
+          text: Em.I18n.t('admin.stackVersions.version.downgrade.running'),
+          hasMultipleButtons: false
+        },
+        title: 'downgrading'
+      },
+      {
+        inputData: {
+          'content.status': 'INSTALLED',
+          'isUpgrading': true,
+          'controller.isDowngrade': false,
+          'controller.upgradeVersion': 'HDP-2.2.1',
+          'content.displayName': 'HDP-2.2.1'
+        },
+        setup: function () {
+          this.getMock.withArgs('upgradeState').returns('IN_PROGRESS');
+        },
+        expected: {
+          status: 'INSTALLED',
+          isLink: true,
+          action: 'openUpgradeDialog',
+          iconClass: 'icon-cog',
+          text: Em.I18n.t('admin.stackVersions.version.upgrade.running'),
+          hasMultipleButtons: false
+        },
+        title: 'upgrading'
+      },
+      {
+        inputData: {
+          'content.status': 'UPGRADING',
+          'isUpgrading': true,
+          'controller.isDowngrade': false,
+          'controller.upgradeVersion': 'HDP-2.2.1',
+          'content.displayName': 'HDP-2.2.1'
+        },
+        setup: function () {
+          this.getMock.withArgs('upgradeState').returns('HOLDING');
+        },
+        expected: {
+          status: 'UPGRADING',
+          isLink: true,
+          action: 'openUpgradeDialog',
+          iconClass: 'icon-pause',
+          text: Em.I18n.t('admin.stackVersions.version.upgrade.pause'),
+          hasMultipleButtons: false
+        },
+        title: 'upgrading, holding'
+      },
+      {
+        inputData: {
+          'content.status': 'UPGRADING',
+          'isUpgrading': true,
+          'controller.isDowngrade': false,
+          'controller.upgradeVersion': 'HDP-2.2.1',
+          'content.displayName': 'HDP-2.2.1'
+        },
+        setup: function () {
+          this.getMock.withArgs('upgradeState').returns('HOLDING_FAILED');
+        },
+        expected: {
+          status: 'UPGRADING',
+          isLink: true,
+          action: 'openUpgradeDialog',
+          iconClass: 'icon-pause',
+          text: Em.I18n.t('admin.stackVersions.version.upgrade.pause'),
+          hasMultipleButtons: false
+        },
+        title: 'upgrading, holding failed'
+      },
+      {
+        inputData: {
+          'content.status': 'UPGRADE_FAILED',
+          'isUpgrading': true,
+          'controller.isDowngrade': false,
+          'controller.upgradeVersion': 'HDP-2.2.1',
+          'content.displayName': 'HDP-2.2.1'
+        },
+        setup: function () {
+          this.getMock.withArgs('upgradeState').returns('HOLDING_TIMEDOUT');
+        },
+        expected: {
+          status: 'UPGRADE_FAILED',
+          isLink: true,
+          action: 'openUpgradeDialog',
+          iconClass: 'icon-pause',
+          text: Em.I18n.t('admin.stackVersions.version.upgrade.pause'),
+          hasMultipleButtons: false
+        },
+        title: 'upgrade failed, holding finished on timeout'
+      },
+      {
+        inputData: {
+          'content.status': 'UPGRADE_FAILED',
+          'isUpgrading': true,
+          'controller.isDowngrade': true,
+          'controller.upgradeVersion': 'HDP-2.2.1',
+          'content.displayName': 'HDP-2.2.1'
+        },
+        setup: function () {
+          this.getMock.withArgs('upgradeState').returns('HOLDING');
+        },
+        expected: {
+          status: 'UPGRADE_FAILED',
+          isLink: true,
+          action: 'openUpgradeDialog',
+          iconClass: 'icon-pause',
+          text: Em.I18n.t('admin.stackVersions.version.downgrade.pause'),
+          hasMultipleButtons: false
+        },
+        title: 'downgrading, holding'
+      },
+      {
+        inputData: {
+          'content.status': 'UPGRADED',
+          'isUpgrading': true,
+          'controller.isDowngrade': true,
+          'controller.upgradeVersion': 'HDP-2.2.1',
+          'content.displayName': 'HDP-2.2.1'
+        },
+        setup: function () {
+          this.getMock.withArgs('upgradeState').returns('HOLDING_FAILED');
+        },
+        expected: {
+          status: 'UPGRADED',
+          isLink: true,
+          action: 'openUpgradeDialog',
+          iconClass: 'icon-pause',
+          text: Em.I18n.t('admin.stackVersions.version.downgrade.pause'),
+          hasMultipleButtons: false
+        },
+        title: 'downgrading, holding failed'
+      },
+      {
+        inputData: {
+          'content.status': 'UPGRADED',
+          'isUpgrading': true,
+          'controller.isDowngrade': true,
+          'controller.upgradeVersion': 'HDP-2.2.1',
+          'content.displayName': 'HDP-2.2.1'
+        },
+        setup: function () {
+          this.getMock.withArgs('upgradeState').returns('HOLDING_TIMEDOUT');
+        },
+        expected: {
+          status: 'UPGRADED',
+          isLink: true,
+          action: 'openUpgradeDialog',
+          iconClass: 'icon-pause',
+          text: Em.I18n.t('admin.stackVersions.version.downgrade.pause'),
+          hasMultipleButtons: false
+        },
+        title: 'downgrading, holding finished on timeout'
+      }
+    ];
+
+    beforeEach(function () {
+      this.getMock = sinon.stub(App, 'get');
+      this.isAccessibleMock = sinon.stub(App, 'isAccessible');
+    });
+    afterEach(function () {
+      this.getMock.restore();
+      this.isAccessibleMock.restore();
+    });
+
+    cases.forEach(function (item) {
+      it(item.title, function () {
+        if (item.setup) {
+          item.setup.call(this);
+        }
+        view.setProperties(item.inputData);
+        var result = view.get('stateElement').getProperties(Em.keys(item.expected));
+        if (result.buttons) {
+          result.buttons = result.buttons.toArray();
+        }
+        expect(result).to.eql(item.expected);
+      });
+    }, this);
+
+  });
 
 });
\ No newline at end of file