yarn-node-test.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /**
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. import { moduleForModel, test } from 'ember-qunit';
  19. moduleForModel('yarn-node', 'Unit | Model | Node', {
  20. // Specify the other units that are required for this test.
  21. needs: []
  22. });
  23. test('Basic creation test', function(assert) {
  24. let model = this.subject();
  25. assert.ok(model);
  26. assert.ok(model._notifyProperties);
  27. assert.ok(model.didLoad);
  28. assert.ok(model.totalVmemAllocatedContainersMB);
  29. assert.ok(model.vmemCheckEnabled);
  30. assert.ok(model.pmemCheckEnabled);
  31. assert.ok(model.nodeHealthy);
  32. assert.ok(model.lastNodeUpdateTime);
  33. assert.ok(model.healthReport);
  34. assert.ok(model.nmStartupTime);
  35. assert.ok(model.nodeManagerBuildVersion);
  36. assert.ok(model.hadoopBuildVersion);
  37. });
  38. test('test fields', function(assert) {
  39. let model = this.subject();
  40. assert.expect(4);
  41. Ember.run(function () {
  42. model.set("totalVmemAllocatedContainersMB", 4096);
  43. model.set("totalPmemAllocatedContainersMB", 2048);
  44. model.set("totalVCoresAllocatedContainers", 4);
  45. model.set("hadoopBuildVersion", "3.0.0-SNAPSHOT");
  46. assert.equal(model.get("totalVmemAllocatedContainersMB"), 4096);
  47. assert.equal(model.get("totalPmemAllocatedContainersMB"), 2048);
  48. assert.equal(model.get("totalVCoresAllocatedContainers"), 4);
  49. assert.equal(model.get("hadoopBuildVersion"), "3.0.0-SNAPSHOT");
  50. });
  51. });