step7_test.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. var App = require('app');
  19. var numberUtils = require('utils/number_utils');
  20. require('controllers/wizard/step7_controller');
  21. var installerStep7Controller;
  22. describe('App.InstallerStep7Controller', function () {
  23. describe('#installedServiceNames', function() {
  24. var tests = Em.A([
  25. {
  26. content: Em.Object.create({
  27. controllerName: 'installerController',
  28. services: Em.A([
  29. Em.Object.create({
  30. isInstalled: true,
  31. serviceName: 'SQOOP'
  32. }),
  33. Em.Object.create({
  34. isInstalled: true,
  35. serviceName: 'HDFS'
  36. })
  37. ])
  38. }),
  39. e: ['SQOOP', 'HDFS'],
  40. m: 'installerController with SQOOP'
  41. },
  42. {
  43. content: Em.Object.create({
  44. controllerName: 'installerController',
  45. services: Em.A([
  46. Em.Object.create({
  47. isInstalled: true,
  48. serviceName: 'HIVE'
  49. }),
  50. Em.Object.create({
  51. isInstalled: true,
  52. serviceName: 'HDFS'
  53. })
  54. ])
  55. }),
  56. e: ['HIVE', 'HDFS'],
  57. m: 'installerController without SQOOP'
  58. },
  59. {
  60. content: Em.Object.create({
  61. controllerName: 'addServiceController',
  62. services: Em.A([
  63. Em.Object.create({
  64. isInstalled: true,
  65. serviceName: 'HIVE'
  66. }),
  67. Em.Object.create({
  68. isInstalled: true,
  69. serviceName: 'HDFS'
  70. })
  71. ])
  72. }),
  73. e: ['HIVE', 'HDFS'],
  74. m: 'addServiceController without SQOOP'
  75. },
  76. {
  77. content: Em.Object.create({
  78. controllerName: 'addServiceController',
  79. services: Em.A([
  80. Em.Object.create({
  81. isInstalled: true,
  82. serviceName: 'SQOOP'
  83. }),
  84. Em.Object.create({
  85. isInstalled: true,
  86. serviceName: 'HIVE'
  87. }),
  88. Em.Object.create({
  89. isInstalled: true,
  90. serviceName: 'HDFS'
  91. })
  92. ])
  93. }),
  94. e: ['HIVE', 'HDFS'],
  95. m: 'addServiceController with SQOOP'
  96. }
  97. ]);
  98. tests.forEach(function(test) {
  99. it(test.m, function() {
  100. installerStep7Controller = App.WizardStep7Controller.create({
  101. content: test.content
  102. });
  103. expect(installerStep7Controller.get('installedServiceNames')).to.include.members(test.e);
  104. expect(test.e).to.include.members(installerStep7Controller.get('installedServiceNames'));
  105. });
  106. });
  107. });
  108. });