You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2012/10/04 02:01:27 UTC

svn commit: r1393840 [2/2] - in /incubator/ambari/branches/AMBARI-666/ambari-web: app/ app/controllers/ app/controllers/installer/ app/data/ app/data/mock/ app/models/ app/routes/ app/templates/ app/templates/installer/ app/views/ app/views/installer/ ...

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/test/installer/step6_test.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/test/installer/step6_test.js?rev=1393840&r1=1393839&r2=1393840&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/test/installer/step6_test.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/test/installer/step6_test.js Thu Oct  4 00:01:26 2012
@@ -23,118 +23,131 @@ require('controllers/installer/step6_con
 describe('App.InstallerStep6Controller', function () {
 
   var HOSTS = [ 'host1', 'host2', 'host3', 'host4' ];
-  App.InstallerStep6Controller.rawHosts = HOSTS;
+  //App.InstallerStep6Controller.set.rawHosts = HOSTS;
   var controller = App.InstallerStep6Controller.create();
+  controller.set('showHbase', false);
+  HOSTS.forEach(function (_hostName) {
+    controller.get('hosts').pushObject(Ember.Object.create({
+      hostname: _hostName,
+      isDataNode: true,
+      isTaskTracker: true,
+      isRegionServer: true
+    }));
+  });
+
 
-  describe('#selectAllDataNodes()', function () {
-    it('should set isDataNode to true on all hosts', function() {
-      controller.selectAllDataNodes();
-      expect(controller.get('hosts').everyProperty('isDataNode', true)).to.equal(true);
-    })
-  })
 
-  describe('#selectAllTaskTrackers()', function () {
-    it('should set isTaskTracker to true on all hosts', function() {
-      controller.selectAllTaskTrackers();
-      expect(controller.get('hosts').everyProperty('isTaskTracker', true)).to.equal(true);
-    })
+describe('#selectAllDataNodes()', function () {
+  controller.get('hosts').setEach('isDataNode', false);
+
+  it('should set isDataNode to true on all hosts', function () {
+    controller.selectAllDataNodes();
+    expect(controller.get('hosts').everyProperty('isDataNode', true)).to.equal(true);
   })
+})
 
-  describe('#selectAllRegionServers()', function () {
-    it('should set isRegionServer to true on all hosts', function() {
-      controller.selectAllRegionServers();
-      expect(controller.get('hosts').everyProperty('isRegionServer', true)).to.equal(true);
-    })
+describe('#selectAllTaskTrackers()', function () {
+  it('should set isTaskTracker to true on all hosts', function () {
+    controller.selectAllTaskTrackers();
+    expect(controller.get('hosts').everyProperty('isTaskTracker', true)).to.equal(true);
   })
+})
 
-  describe('#isAllDataNodes()', function () {
+describe('#selectAllRegionServers()', function () {
+  it('should set isRegionServer to true on all hosts', function () {
+    controller.selectAllRegionServers();
+    expect(controller.get('hosts').everyProperty('isRegionServer', true)).to.equal(true);
+  })
+})
 
-    beforeEach(function() {
-      controller.get('hosts').setEach('isDataNode', true);
-    })
+describe('#isAllDataNodes()', function () {
 
-    it('should return true if isDataNode is true for all services', function() {
-      expect(controller.get('isAllDataNodes')).to.equal(true);
-    })
+  beforeEach(function () {
+    controller.get('hosts').setEach('isDataNode', true);
+  })
 
-    it('should return false if isDataNode is false for one host', function() {
-      controller.get('hosts')[0].set('isDataNode', false);
-      expect(controller.get('isAllDataNodes')).to.equal(false);
-    })
+  it('should return true if isDataNode is true for all services', function () {
+    expect(controller.get('isAllDataNodes')).to.equal(true);
   })
 
-  describe('#isAllTaskTrackers()', function () {
+  it('should return false if isDataNode is false for one host', function () {
+    controller.get('hosts')[0].set('isDataNode', false);
+    expect(controller.get('isAllDataNodes')).to.equal(false);
+  })
+})
 
-    beforeEach(function() {
-      controller.get('hosts').setEach('isTaskTracker', true);
-    })
+describe('#isAllTaskTrackers()', function () {
 
-    it('should return true if isTaskTracker is true for all hosts', function() {
-      expect(controller.get('isAllTaskTrackers')).to.equal(true);
-    })
+  beforeEach(function () {
+    controller.get('hosts').setEach('isTaskTracker', true);
+  })
 
-    it('should return false if isTaskTracker is false for one host', function() {
-      controller.get('hosts')[0].set('isTaskTracker', false);
-      expect(controller.get('isAllTaskTrackers')).to.equal(false);
-    })
+  it('should return true if isTaskTracker is true for all hosts', function () {
+    expect(controller.get('isAllTaskTrackers')).to.equal(true);
+  })
 
+  it('should return false if isTaskTracker is false for one host', function () {
+    controller.get('hosts')[0].set('isTaskTracker', false);
+    expect(controller.get('isAllTaskTrackers')).to.equal(false);
   })
 
-  describe('#isAllRegionServers()', function () {
+})
 
-    beforeEach(function() {
-      controller.get('hosts').setEach('isRegionServer', true);
-    });
+describe('#isAllRegionServers()', function () {
 
-    it('should return true if isRegionServer is true for all hosts', function() {
-      expect(controller.get('isAllRegionServers')).to.equal(true);
-    })
+  beforeEach(function () {
+    controller.get('hosts').setEach('isRegionServer', true);
+  });
 
-    it('should return false if isRegionServer is false for one host', function() {
-      controller.get('hosts')[0].set('isRegionServer', false);
-      expect(controller.get('isAllRegionServers')).to.equal(false);
-    })
+  it('should return true if isRegionServer is true for all hosts', function () {
+    expect(controller.get('isAllRegionServers')).to.equal(true);
+  })
 
+  it('should return false if isRegionServer is false for one host', function () {
+    controller.get('hosts')[0].set('isRegionServer', false);
+    expect(controller.get('isAllRegionServers')).to.equal(false);
   })
 
-  describe('#validate()', function () {
+})
 
-    beforeEach(function() {
-      controller.get('hosts').setEach('isDataNode', true);
-      controller.get('hosts').setEach('isTaskTracker', true);
-      controller.get('hosts').setEach('isRegionServer', true);
-    });
+describe('#validate()', function () {
 
-    it('should return false if isDataNode is false for all hosts', function() {
-      controller.get('hosts').setEach('isDataNode', false);
-      expect(controller.validate()).to.equal(false);
-    })
+  beforeEach(function () {
+    controller.get('hosts').setEach('isDataNode', true);
+    controller.get('hosts').setEach('isTaskTracker', true);
+    controller.get('hosts').setEach('isRegionServer', true);
+  });
 
-    it('should return false if isTaskTracker is false for all hosts', function() {
-      controller.get('hosts').setEach('isTaskTracker', false);
-      expect(controller.validate()).to.equal(false);
-    })
+  it('should return false if isDataNode is false for all hosts', function () {
+    controller.get('hosts').setEach('isDataNode', false);
+    expect(controller.validate()).to.equal(false);
+  })
 
-    it('should return false if isRegionServer is false for all hosts', function() {
-      controller.get('hosts').setEach('isRegionServer', false);
-      expect(controller.validate()).to.equal(false);
-    })
+  it('should return false if isTaskTracker is false for all hosts', function () {
+    controller.get('hosts').setEach('isTaskTracker', false);
+    expect(controller.validate()).to.equal(false);
+  })
 
-    it('should return true if isDataNode, isTaskTracker, and isRegionServer is true for all hosts', function() {
-      expect(controller.validate()).to.equal(true);
-    })
+  it('should return false if isRegionServer is false for all hosts', function () {
+    controller.get('hosts').setEach('isRegionServer', false);
+    expect(controller.validate()).to.equal(false);
+  })
 
-    it('should return true if isDataNode, isTaskTracker, and isRegionServer is true for only one host', function() {
-      controller.get('hosts').setEach('isDataNode', false);
-      controller.get('hosts').setEach('isTaskTracker', false);
-      controller.get('hosts').setEach('isRegionServer', false);
-      var host = controller.get('hosts')[0];
-      host.set('isDataNode', true);
-      host.set('isTaskTracker', true);
-      host.set('isRegionServer', true);
-      expect(controller.validate()).to.equal(true);
-    })
+  it('should return true if isDataNode, isTaskTracker, and isRegionServer is true for all hosts', function () {
+    expect(controller.validate()).to.equal(true);
+  })
 
+  it('should return true if isDataNode, isTaskTracker, and isRegionServer is true for only one host', function () {
+    controller.get('hosts').setEach('isDataNode', false);
+    controller.get('hosts').setEach('isTaskTracker', false);
+    controller.get('hosts').setEach('isRegionServer', false);
+    var host = controller.get('hosts')[0];
+    host.set('isDataNode', true);
+    host.set('isTaskTracker', true);
+    host.set('isRegionServer', true);
+    expect(controller.validate()).to.equal(true);
   })
 
+})
+
 })
\ No newline at end of file

Modified: incubator/ambari/branches/AMBARI-666/ambari-web/test/installer/step7_test.js
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/AMBARI-666/ambari-web/test/installer/step7_test.js?rev=1393840&r1=1393839&r2=1393840&view=diff
==============================================================================
--- incubator/ambari/branches/AMBARI-666/ambari-web/test/installer/step7_test.js (original)
+++ incubator/ambari/branches/AMBARI-666/ambari-web/test/installer/step7_test.js Thu Oct  4 00:01:26 2012
@@ -21,15 +21,4 @@ require('controllers/installer/step7_con
 
 describe('App.InstallerStep7Controller', function () {
 
-  /*
-  describe('#validateStep1()', function () {
-    it('should return false and sets invalidClusterName to true if cluster name is empty', function () {
-      var controller = App.InstallerStep1Controller.create();
-      controller.set('clusterName', '');
-      expect(controller.validateStep1()).to.equal(false);
-      expect(controller.get('invalidClusterName')).to.equal(true);
-    })
-  })
-  */
-
 })
\ No newline at end of file