瀏覽代碼

HUE-5048 [frontend] Remove RequireJS from jasmine tests

Johan Ahlen 9 年之前
父節點
當前提交
0f04045
共有 23 個文件被更改,包括 228 次插入392 次删除
  1. 2 5
      desktop/core/src/desktop/static/desktop/spec/apiHelperSpec.js
  2. 4 22
      desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpec.js
  3. 4 8
      desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecAlter.js
  4. 4 8
      desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecAnalyze.js
  5. 4 8
      desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecCreate.js
  6. 4 8
      desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecDescribe.js
  7. 4 8
      desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecDrop.js
  8. 4 8
      desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecError.js
  9. 4 8
      desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecInsert.js
  10. 4 8
      desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecLoad.js
  11. 4 8
      desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecLocations.js
  12. 4 8
      desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecSelect.js
  13. 4 8
      desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecSet.js
  14. 4 8
      desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecShow.js
  15. 4 10
      desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecUpdate.js
  16. 4 8
      desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecUse.js
  17. 8 9
      desktop/core/src/desktop/static/desktop/spec/autocompleterTestUtils.js
  18. 3 8
      desktop/core/src/desktop/static/desktop/spec/hdfsAutocompleterSpec.js
  19. 2 4
      desktop/core/src/desktop/static/desktop/spec/sqlAutocompleter2Spec.js
  20. 3 8
      desktop/core/src/desktop/static/desktop/spec/sqlAutocompleterSpec.js
  21. 93 95
      desktop/core/src/desktop/static/desktop/spec/sqlFunctionsSpec.js
  22. 7 33
      desktop/core/src/desktop/templates/common_jasmine.mako
  23. 50 94
      desktop/core/src/desktop/templates/jasmineRunner.html

+ 2 - 5
desktop/core/src/desktop/static/desktop/spec/apiHelperSpec.js

@@ -13,10 +13,7 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/apiHelper'
-], function(ko, ApiHelper) {
+(function() {
 
   describe("apiHelper.js", function() {
     var subject = ApiHelper.getInstance({
@@ -63,4 +60,4 @@ define([
       });
     });
   });
-});
+})();

+ 4 - 22
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpec.js

@@ -13,36 +13,18 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/autocomplete/sql',
-  'desktop/spec/autocompleterTestUtils',
-  'desktop/spec/autocomplete/sqlSpecAlter',
-  'desktop/spec/autocomplete/sqlSpecAnalyze',
-  'desktop/spec/autocomplete/sqlSpecCreate',
-  'desktop/spec/autocomplete/sqlSpecDescribe',
-  'desktop/spec/autocomplete/sqlSpecDrop',
-  'desktop/spec/autocomplete/sqlSpecError',
-  'desktop/spec/autocomplete/sqlSpecInsert',
-  'desktop/spec/autocomplete/sqlSpecLoad',
-  'desktop/spec/autocomplete/sqlSpecLocations',
-  'desktop/spec/autocomplete/sqlSpecSelect',
-  'desktop/spec/autocomplete/sqlSpecSet',
-  'desktop/spec/autocomplete/sqlSpecShow',
-  'desktop/spec/autocomplete/sqlSpecUpdate',
-  'desktop/spec/autocomplete/sqlSpecUse'
-], function(ko, sql, testUtils) {
 
+(function () {
   describe('sql.js', function() {
 
     beforeAll(function () {
       sql.yy.parseError = function (msg) {
         throw Error(msg);
       };
-      jasmine.addMatchers(testUtils.testDefinitionMatcher);
+      jasmine.addMatchers(SqlTestUtils.testDefinitionMatcher);
     });
 
-    var assertAutoComplete = testUtils.assertAutocomplete;
+    var assertAutoComplete = SqlTestUtils.assertAutocomplete;
 
     it('should suggest keywords for ";;|"', function() {
       assertAutoComplete({
@@ -701,4 +683,4 @@ define([
       });
     });
   });
-});
+})();

+ 4 - 8
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecAlter.js

@@ -13,22 +13,18 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/autocomplete/sql',
-  'desktop/spec/autocompleterTestUtils'
-], function(ko, sql, testUtils) {
 
+(function () {
   describe('sql.js ALTER statements', function() {
 
     beforeAll(function () {
       sql.yy.parseError = function (msg) {
         throw Error(msg);
       };
-      jasmine.addMatchers(testUtils.testDefinitionMatcher);
+      jasmine.addMatchers(SqlTestUtils.testDefinitionMatcher);
     });
 
-    var assertAutoComplete = testUtils.assertAutocomplete;
+    var assertAutoComplete = SqlTestUtils.assertAutocomplete;
 
     describe('ALTER INDEX', function () {
       it('should handle "ALTER INDEX baa ON boo.ba PARTITION (bla=1) REBUILD;|"', function() {
@@ -1933,4 +1929,4 @@ define([
       });
     })
   });
-});
+})();

+ 4 - 8
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecAnalyze.js

@@ -13,22 +13,18 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/autocomplete/sql',
-  'desktop/spec/autocompleterTestUtils'
-], function(ko, sql, testUtils) {
 
+(function () {
   describe('sql.js ANALYZE statements', function() {
 
     beforeAll(function () {
       sql.yy.parseError = function (msg) {
         throw Error(msg);
       };
-      jasmine.addMatchers(testUtils.testDefinitionMatcher);
+      jasmine.addMatchers(SqlTestUtils.testDefinitionMatcher);
     });
 
-    var assertAutoComplete = testUtils.assertAutocomplete;
+    var assertAutoComplete = SqlTestUtils.assertAutocomplete;
 
     describe('ANALYZE TABLE', function () {
       it('should handle "ANALYZE TABLE boo.baa PARTITION (bla=1, boo=\'baa\') COMPUTE STATISTICS FOR COLUMNS CACHE METADATA NOSCAN;|"', function() {
@@ -568,4 +564,4 @@ define([
       });
     });
   });
-});
+})();

+ 4 - 8
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecCreate.js

@@ -13,22 +13,18 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/autocomplete/sql',
-  'desktop/spec/autocompleterTestUtils'
-], function(ko, sql, testUtils) {
 
+(function () {
   describe('sql.js CREATE statements', function() {
 
     beforeAll(function () {
       sql.yy.parseError = function (msg) {
         throw Error(msg);
       };
-      jasmine.addMatchers(testUtils.testDefinitionMatcher);
+      jasmine.addMatchers(SqlTestUtils.testDefinitionMatcher);
     });
 
-    var assertAutoComplete = testUtils.assertAutocomplete;
+    var assertAutoComplete = SqlTestUtils.assertAutocomplete;
 
     it('should suggest keywords for "|"', function() {
       assertAutoComplete({
@@ -2415,4 +2411,4 @@ define([
     });
 
   });
-});
+})();

+ 4 - 8
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecDescribe.js

@@ -13,22 +13,18 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/autocomplete/sql',
-  'desktop/spec/autocompleterTestUtils'
-], function(ko, sql, testUtils) {
 
+(function () {
   describe('sql.js DESCRIBE statements', function() {
 
     beforeAll(function () {
       sql.yy.parseError = function (msg) {
         throw Error(msg);
       };
-      jasmine.addMatchers(testUtils.testDefinitionMatcher);
+      jasmine.addMatchers(SqlTestUtils.testDefinitionMatcher);
     });
 
-    var assertAutoComplete = testUtils.assertAutocomplete;
+    var assertAutoComplete = SqlTestUtils.assertAutocomplete;
 
 
     describe('hive specific', function () {
@@ -524,4 +520,4 @@ define([
       });
     });
   });
-});
+})();

+ 4 - 8
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecDrop.js

@@ -13,22 +13,18 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/autocomplete/sql',
-  'desktop/spec/autocompleterTestUtils'
-], function(ko, sql, testUtils) {
 
+(function () {
   describe('sql.js DROP statements', function() {
 
     beforeAll(function () {
       sql.yy.parseError = function (msg) {
         throw Error(msg);
       };
-      jasmine.addMatchers(testUtils.testDefinitionMatcher);
+      jasmine.addMatchers(SqlTestUtils.testDefinitionMatcher);
     });
 
-    var assertAutoComplete = testUtils.assertAutocomplete;
+    var assertAutoComplete = SqlTestUtils.assertAutocomplete;
 
     it('should suggest keywords for "|"', function() {
       assertAutoComplete({
@@ -982,4 +978,4 @@ define([
       });
     })
   });
-});
+})();

+ 4 - 8
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecError.js

@@ -13,22 +13,18 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/autocomplete/sql',
-  'desktop/spec/autocompleterTestUtils'
-], function(ko, sql, testUtils) {
 
+(function () {
   describe('sql.js Error statements', function() {
 
     beforeAll(function () {
       sql.yy.parseError = function (msg) {
         throw Error(msg);
       };
-      jasmine.addMatchers(testUtils.testDefinitionMatcher);
+      jasmine.addMatchers(SqlTestUtils.testDefinitionMatcher);
     });
 
-    var assertAutoComplete = testUtils.assertAutocomplete;
+    var assertAutoComplete = SqlTestUtils.assertAutocomplete;
 
     it('should suggest columns for "SELECT BAABO BOOAA BLARGH, | FROM testTable"', function() {
       assertAutoComplete({
@@ -135,4 +131,4 @@ define([
       });
     });
   });
-});
+})();

+ 4 - 8
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecInsert.js

@@ -13,22 +13,18 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/autocomplete/sql',
-  'desktop/spec/autocompleterTestUtils'
-], function(ko, sql, testUtils) {
 
+(function () {
   describe('sql.js INSERT statements', function() {
 
     beforeAll(function () {
       sql.yy.parseError = function (msg) {
         throw Error(msg);
       };
-      jasmine.addMatchers(testUtils.testDefinitionMatcher);
+      jasmine.addMatchers(SqlTestUtils.testDefinitionMatcher);
     });
 
-    var assertAutoComplete = testUtils.assertAutocomplete;
+    var assertAutoComplete = SqlTestUtils.assertAutocomplete;
 
     it('should handle "INSERT INTO bla.boo VALUES (1, 2, \'a\', 3); |"', function() {
       assertAutoComplete({
@@ -1195,4 +1191,4 @@ define([
       });
     });
   });
-});
+})();

+ 4 - 8
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecLoad.js

@@ -13,22 +13,18 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/autocomplete/sql',
-  'desktop/spec/autocompleterTestUtils'
-], function(ko, sql, testUtils) {
 
+(function () {
   describe('sql.js LOAD statements', function() {
 
     beforeAll(function () {
       sql.yy.parseError = function (msg) {
         throw Error(msg);
       };
-      jasmine.addMatchers(testUtils.testDefinitionMatcher);
+      jasmine.addMatchers(SqlTestUtils.testDefinitionMatcher);
     });
 
-    var assertAutoComplete = testUtils.assertAutocomplete;
+    var assertAutoComplete = SqlTestUtils.assertAutocomplete;
 
     describe('Impala specific', function () {
       it('should suggest keywords for "|"', function() {
@@ -319,4 +315,4 @@ define([
       });
     });
   });
-});
+})();

+ 4 - 8
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecLocations.js

@@ -13,23 +13,19 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/autocomplete/sql',
-  'desktop/spec/autocompleterTestUtils'
-], function(ko, sql, testUtils) {
 
+(function () {
   describe('sql.js locations', function() {
 
     beforeAll(function () {
       sql.yy.parseError = function (msg) {
         throw Error(msg);
       };
-      jasmine.addMatchers(testUtils.testDefinitionMatcher);
+      jasmine.addMatchers(SqlTestUtils.testDefinitionMatcher);
     });
 
     var assertLocations = function (options) {
-      testUtils.assertAutocomplete({
+      SqlTestUtils.assertAutocomplete({
         dialect: options.dialect,
         beforeCursor: options.beforeCursor,
         afterCursor: options.afterCursor || '',
@@ -392,4 +388,4 @@ define([
       });
     })
   });
-});
+})();

+ 4 - 8
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecSelect.js

@@ -13,22 +13,18 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/autocomplete/sql',
-  'desktop/spec/autocompleterTestUtils'
-], function(ko, sql, testUtils) {
 
+(function () {
   describe('sql.js SELECT statements', function() {
 
     beforeAll(function () {
       sql.yy.parseError = function (msg) {
         throw Error(msg);
       };
-      jasmine.addMatchers(testUtils.testDefinitionMatcher);
+      jasmine.addMatchers(SqlTestUtils.testDefinitionMatcher);
     });
 
-    var assertAutoComplete = testUtils.assertAutocomplete;
+    var assertAutoComplete = SqlTestUtils.assertAutocomplete;
 
     it('should suggest keywords for "|"', function() {
       assertAutoComplete({
@@ -7164,4 +7160,4 @@ define([
       });
     });
   });
-});
+})();

+ 4 - 8
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecSet.js

@@ -13,22 +13,18 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/autocomplete/sql',
-  'desktop/spec/autocompleterTestUtils'
-], function(ko, sql, testUtils) {
 
+(function () {
   describe('sql.js SET statements', function() {
 
     beforeAll(function () {
       sql.yy.parseError = function (msg) {
         throw Error(msg);
       };
-      jasmine.addMatchers(testUtils.testDefinitionMatcher);
+      jasmine.addMatchers(SqlTestUtils.testDefinitionMatcher);
     });
 
-    var assertAutoComplete = testUtils.assertAutocomplete;
+    var assertAutoComplete = SqlTestUtils.assertAutocomplete;
 
     it('should suggest keywords for "|"', function () {
       assertAutoComplete({
@@ -107,4 +103,4 @@ define([
       });
     });
   });
-});
+})();

+ 4 - 8
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecShow.js

@@ -13,22 +13,18 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/autocomplete/sql',
-  'desktop/spec/autocompleterTestUtils'
-], function(ko, sql, testUtils) {
 
+(function () {
   describe('sql.js SHOW statements', function() {
 
     beforeAll(function () {
       sql.yy.parseError = function (msg) {
         throw Error(msg);
       };
-      jasmine.addMatchers(testUtils.testDefinitionMatcher);
+      jasmine.addMatchers(SqlTestUtils.testDefinitionMatcher);
     });
 
-    var assertAutoComplete = testUtils.assertAutocomplete;
+    var assertAutoComplete = SqlTestUtils.assertAutocomplete;
 
     it('should suggest keywords for "|"', function() {
       assertAutoComplete({
@@ -1543,4 +1539,4 @@ define([
       });
     });
   });
-});
+})();

+ 4 - 10
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecUpdate.js

@@ -13,22 +13,18 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/autocomplete/sql',
-  'desktop/spec/autocompleterTestUtils'
-], function(ko, sql, testUtils) {
 
+(function () {
   describe('sql.js UPDATE statements', function() {
 
     beforeAll(function () {
       sql.yy.parseError = function (msg) {
         throw Error(msg);
       };
-      jasmine.addMatchers(testUtils.testDefinitionMatcher);
+      jasmine.addMatchers(SqlTestUtils.testDefinitionMatcher);
     });
 
-    var assertAutoComplete = testUtils.assertAutocomplete;
+    var assertAutoComplete = SqlTestUtils.assertAutocomplete;
 
     it('should suggest keywords for "|"', function() {
       assertAutoComplete({
@@ -207,8 +203,6 @@ define([
       });
     });
 
-
-
     it('should suggest columns for "UPDATE bar.foo SET bla = \'foo\' WHERE id = 1 AND |"', function() {
       assertAutoComplete({
         beforeCursor: 'UPDATE bar.foo SET bla = \'foo\' WHERE id = 1 AND ',
@@ -228,4 +222,4 @@ define([
       });
     });
   });
-});
+})();

+ 4 - 8
desktop/core/src/desktop/static/desktop/spec/autocomplete/sqlSpecUse.js

@@ -13,22 +13,18 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/autocomplete/sql',
-  'desktop/spec/autocompleterTestUtils'
-], function(ko, sql, testUtils) {
 
+(function () {
   describe('sql.js USE statements', function() {
 
     beforeAll(function () {
       sql.yy.parseError = function (msg) {
         throw Error(msg);
       };
-      jasmine.addMatchers(testUtils.testDefinitionMatcher);
+      jasmine.addMatchers(SqlTestUtils.testDefinitionMatcher);
     });
 
-    var assertAutoComplete = testUtils.assertAutocomplete;
+    var assertAutoComplete = SqlTestUtils.assertAutocomplete;
 
     it('should suggest keywords for "|"', function() {
       assertAutoComplete({
@@ -137,4 +133,4 @@ define([
       });
     });
   });
-});
+})();

+ 8 - 9
desktop/core/src/desktop/static/desktop/spec/autocompleterTestUtils.js

@@ -13,10 +13,8 @@
 // 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.
-define([
-  'desktop/js/autocomplete/sql',
-  'desktop/js/sqlFunctions'
-], function(sql, sqlFunctions) {
+
+var SqlTestUtils = (function() {
   return {
     autocompleteMatcher : {
       toEqualAutocompleteValues : function() {
@@ -151,17 +149,18 @@ define([
         }
       }
     },
+
     assertAutocomplete: function(testDefinition) {
       var debug = false;
       if (typeof testDefinition.dialect === 'undefined') {
-        expect(sql.parseSql(testDefinition.beforeCursor, testDefinition.afterCursor, testDefinition.dialect, sqlFunctions, debug)).toEqualDefinition(testDefinition);
+        expect(sql.parseSql(testDefinition.beforeCursor, testDefinition.afterCursor, testDefinition.dialect, debug)).toEqualDefinition(testDefinition);
         testDefinition.dialect = 'hive';
-        expect(sql.parseSql(testDefinition.beforeCursor, testDefinition.afterCursor,  testDefinition.dialect, sqlFunctions, debug)).toEqualDefinition(testDefinition);
+        expect(sql.parseSql(testDefinition.beforeCursor, testDefinition.afterCursor,  testDefinition.dialect, debug)).toEqualDefinition(testDefinition);
         testDefinition.dialect = 'impala';
-        expect(sql.parseSql(testDefinition.beforeCursor, testDefinition.afterCursor,  testDefinition.dialect, sqlFunctions, debug)).toEqualDefinition(testDefinition);
+        expect(sql.parseSql(testDefinition.beforeCursor, testDefinition.afterCursor,  testDefinition.dialect, debug)).toEqualDefinition(testDefinition);
       } else {
-        expect(sql.parseSql(testDefinition.beforeCursor, testDefinition.afterCursor, testDefinition.dialect, sqlFunctions, debug)).toEqualDefinition(testDefinition);
+        expect(sql.parseSql(testDefinition.beforeCursor, testDefinition.afterCursor, testDefinition.dialect, debug)).toEqualDefinition(testDefinition);
       }
     }
   }
-});
+})();

+ 3 - 8
desktop/core/src/desktop/static/desktop/spec/hdfsAutocompleterSpec.js

@@ -13,12 +13,7 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/hdfsAutocompleter',
-  'desktop/js/apiHelper',
-  'desktop/spec/autocompleterTestUtils'
-], function(ko, HdfsAutocompleter, ApiHelper, testUtils) {
+(function () {
   describe("hdfsAutocompleter.js", function() {
     var subject;
 
@@ -41,7 +36,7 @@ define([
 
 
     beforeAll(function() {
-      jasmine.addMatchers(testUtils.autocompleteMatcher);
+      jasmine.addMatchers(SqlTestUtils.autocompleteMatcher);
       $.totalStorage = function(key, value) {
         return null;
       };
@@ -172,4 +167,4 @@ define([
       });
     });
   });
-});
+})();

+ 2 - 4
desktop/core/src/desktop/static/desktop/spec/sqlAutocompleter2Spec.js

@@ -13,9 +13,7 @@
 // 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.
-define([
-  'desktop/js/sqlAutocompleter2'
-], function (SqlAutocompleter2) {
+(function () {
   describe('sqlAutocompleter2.js', function () {
 
     var hiveSubject = new SqlAutocompleter2({
@@ -82,4 +80,4 @@ define([
     });
 
   });
-});
+})();

+ 3 - 8
desktop/core/src/desktop/static/desktop/spec/sqlAutocompleterSpec.js

@@ -13,12 +13,7 @@
 // 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.
-define([
-  'knockout',
-  'desktop/js/sqlAutocompleter',
-  'desktop/js/apiHelper',
-  'desktop/spec/autocompleterTestUtils'
-], function (ko, SqlAutocompleter, ApiHelper, testUtils) {
+(function () {
   describe('sqlAutocompleter.js', function () {
     var apiHelper = ApiHelper.getInstance({
       i18n: {},
@@ -28,7 +23,7 @@ define([
     var langTools = ace.require('ace/ext/language_tools');
 
     beforeAll(function () {
-      jasmine.addMatchers(testUtils.autocompleteMatcher);
+      jasmine.addMatchers(SqlTestUtils.autocompleteMatcher);
       $.totalStorage = function (key, value) {
         return null;
       };
@@ -1618,4 +1613,4 @@ define([
       });
     })
   });
-});
+})();

+ 93 - 95
desktop/core/src/desktop/static/desktop/spec/sqlFunctionsSpec.js

@@ -13,13 +13,11 @@
 // 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.
-define([
-  'desktop/js/sqlFunctions'
-], function (sqlFunctions) {
-  describe('sqlFunctions.js', function () {
+(function () {
+  describe('SqlFunctions.js', function () {
     it('should suggest only BOOLEAN functions when return type is set to BOOLEAN for Hive', function () {
       var completions = [];
-      sqlFunctions.suggestFunctions('hive', ['BOOLEAN'], undefined, undefined, completions);
+      SqlFunctions.suggestFunctions('hive', ['BOOLEAN'], undefined, undefined, completions);
 
       expect(completions.length).not.toEqual(0);
 
@@ -32,12 +30,12 @@ define([
 
     it('should suggest only STRING functions when return type is set to STRING for Hive', function () {
       var completions = [];
-      sqlFunctions.suggestFunctions('hive', ['STRING'], undefined, undefined, completions);
+      SqlFunctions.suggestFunctions('hive', ['STRING'], undefined, undefined, completions);
 
       expect(completions.length).not.toEqual(0);
 
       var completionsWithCorrectType = completions.filter(function (completion) {
-        return sqlFunctions.matchesType('hive', ['STRING'], [completion.meta]);
+        return SqlFunctions.matchesType('hive', ['STRING'], [completion.meta]);
       });
 
       expect(completionsWithCorrectType.length).toEqual(completions.length);
@@ -45,7 +43,7 @@ define([
 
     it('should suggest only NUMBER functions when return type is set to NUMBER for Hive', function () {
       var completions = [];
-      sqlFunctions.suggestFunctions('hive', ['NUMBER'], undefined, undefined, completions);
+      SqlFunctions.suggestFunctions('hive', ['NUMBER'], undefined, undefined, completions);
 
       expect(completions.length).not.toEqual(0);
 
@@ -54,7 +52,7 @@ define([
       var completionsWithCorrectType = completions.filter(function (completion) {
         atleastOneInt = atleastOneInt || completion.meta === 'INT';
         atleastOneString = atleastOneString || completion.meta === 'STRING';
-        return sqlFunctions.matchesType('hive', ['NUMBER'], [completion.meta]);
+        return SqlFunctions.matchesType('hive', ['NUMBER'], [completion.meta]);
       });
 
       expect(atleastOneInt).toBeTruthy();
@@ -64,7 +62,7 @@ define([
 
     it('should suggest only NUMBER functions when return type is set to NUMBER for Impala', function () {
       var completions = [];
-      sqlFunctions.suggestFunctions('impala', ['NUMBER'], undefined, undefined, completions);
+      SqlFunctions.suggestFunctions('impala', ['NUMBER'], undefined, undefined, completions);
 
       expect(completions.length).not.toEqual(0);
 
@@ -73,7 +71,7 @@ define([
       var completionsWithCorrectType = completions.filter(function (completion) {
         atleastOneInt = atleastOneInt || completion.meta === 'INT';
         stringPresent = stringPresent || completion.meta === 'STRING';
-        return sqlFunctions.matchesType('hive', ['NUMBER'], [completion.meta]);
+        return SqlFunctions.matchesType('hive', ['NUMBER'], [completion.meta]);
       });
 
       expect(atleastOneInt).toBeTruthy();
@@ -82,98 +80,98 @@ define([
     });
 
     it('should matchTypes for NUMBER', function () {
-      expect(sqlFunctions.matchesType('hive', ['NUMBER'], ['INT'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['NUMBER'], ['BIGINT'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['NUMBER'], ['DOUBLE'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['NUMBER'], ['DECIMAL'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['NUMBER'], ['T'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['NUMBER'], ['STRING'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['INT'], ['NUMBER'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['BIGINT'], ['NUMBER'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['DOUBLE'], ['NUMBER'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['DECIMAL'], ['NUMBER'])).toBeTruthy();
-
-      expect(sqlFunctions.matchesType('hive', ['STRING'], ['NUMBER'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['T'], ['NUMBER'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['NUMBER'], ['BOOLEAN'])).toBeFalsy();
-      expect(sqlFunctions.matchesType('hive', ['BOOLEAN'], ['NUMBER'])).toBeFalsy();
+      expect(SqlFunctions.matchesType('hive', ['NUMBER'], ['INT'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['NUMBER'], ['BIGINT'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['NUMBER'], ['DOUBLE'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['NUMBER'], ['DECIMAL'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['NUMBER'], ['T'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['NUMBER'], ['STRING'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['INT'], ['NUMBER'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['BIGINT'], ['NUMBER'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['DOUBLE'], ['NUMBER'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['DECIMAL'], ['NUMBER'])).toBeTruthy();
+
+      expect(SqlFunctions.matchesType('hive', ['STRING'], ['NUMBER'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['T'], ['NUMBER'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['NUMBER'], ['BOOLEAN'])).toBeFalsy();
+      expect(SqlFunctions.matchesType('hive', ['BOOLEAN'], ['NUMBER'])).toBeFalsy();
     });
 
     it('should strip precision', function () {
-      expect(sqlFunctions.matchesType('hive', ['STRING'], ['VARCHAR(10)'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['NUMBER'], ['DECIMAL(10,1)'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['T'], ['CHAR(1)'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['STRING'], ['VARCHAR(10)'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['NUMBER'], ['DECIMAL(10,1)'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['T'], ['CHAR(1)'])).toBeTruthy();
     });
 
     it('should matchTypes for BIGINT', function () {
-      expect(sqlFunctions.matchesType('hive', ['BIGINT'], ['BIGINT'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['BIGINT'], ['INT'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['BIGINT'], ['SMALLINT'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['BIGINT'], ['TINYINT'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['BIGINT'], ['T'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['BIGINT'], ['BOOLEAN'])).toBeFalsy();
-      expect(sqlFunctions.matchesType('hive', ['BIGINT'], ['STRING'])).toBeFalsy();
-      expect(sqlFunctions.matchesType('hive', ['INT'], ['BIGINT'])).toBeFalsy();
-      expect(sqlFunctions.matchesType('hive', ['SMALLINT'], ['BIGINT'])).toBeFalsy();
-      expect(sqlFunctions.matchesType('hive', ['TINYINT'], ['BIGINT'])).toBeFalsy();
-      expect(sqlFunctions.matchesType('hive', ['DECIMAL'], ['BIGINT'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['T'], ['BIGINT'])).toBeTruthy();
-      expect(sqlFunctions.matchesType('hive', ['BOOLEAN'], ['BIGINT'])).toBeFalsy();
-      expect(sqlFunctions.matchesType('hive', ['STRING'], ['BIGINT'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['BIGINT'], ['BIGINT'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['BIGINT'], ['INT'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['BIGINT'], ['SMALLINT'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['BIGINT'], ['TINYINT'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['BIGINT'], ['T'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['BIGINT'], ['BOOLEAN'])).toBeFalsy();
+      expect(SqlFunctions.matchesType('hive', ['BIGINT'], ['STRING'])).toBeFalsy();
+      expect(SqlFunctions.matchesType('hive', ['INT'], ['BIGINT'])).toBeFalsy();
+      expect(SqlFunctions.matchesType('hive', ['SMALLINT'], ['BIGINT'])).toBeFalsy();
+      expect(SqlFunctions.matchesType('hive', ['TINYINT'], ['BIGINT'])).toBeFalsy();
+      expect(SqlFunctions.matchesType('hive', ['DECIMAL'], ['BIGINT'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['T'], ['BIGINT'])).toBeTruthy();
+      expect(SqlFunctions.matchesType('hive', ['BOOLEAN'], ['BIGINT'])).toBeFalsy();
+      expect(SqlFunctions.matchesType('hive', ['STRING'], ['BIGINT'])).toBeTruthy();
     });
 
     it('should give the expected argument types at a specific position', function () {
-      expect(sqlFunctions.getArgumentTypes('hive', 'cos', 1)).toEqual(['DECIMAL', 'DOUBLE']);
-      expect(sqlFunctions.getArgumentTypes('hive', 'cos', 2)).toEqual([]);
-      expect(sqlFunctions.getArgumentTypes('impala', 'cos', 1)).toEqual(['DOUBLE']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'cos', 2)).toEqual([]);
-
-      expect(sqlFunctions.getArgumentTypes('hive', 'greatest', 1)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('hive', 'greatest', 200)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'greatest', 1)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'greatest', 200)).toEqual(['T']);
-
-      expect(sqlFunctions.getArgumentTypes('hive', 'strleft', 1)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('hive', 'strleft', 2)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('hive', 'strleft', 3)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('hive', 'strleft', 200)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'strleft', 1)).toEqual(['STRING']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'strleft', 2)).toEqual(['INT']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'strleft', 3)).toEqual([]);
-      expect(sqlFunctions.getArgumentTypes('impala', 'strleft', 200)).toEqual([]);
-
-      expect(sqlFunctions.getArgumentTypes('hive', 'concat', 10)).toEqual(['BINARY', 'STRING']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'concat', 10)).toEqual(['STRING']);
-
-      expect(sqlFunctions.getArgumentTypes('hive', 'substring_index', 1)).toEqual(['STRING']);
-      expect(sqlFunctions.getArgumentTypes('hive', 'substring_index', 2)).toEqual(['STRING']);
-      expect(sqlFunctions.getArgumentTypes('hive', 'substring_index', 3)).toEqual(['INT']);
-      expect(sqlFunctions.getArgumentTypes('hive', 'substring_index', 200)).toEqual([]);
-      expect(sqlFunctions.getArgumentTypes('impala', 'substring_index', 1)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'substring_index', 2)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'substring_index', 3)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'substring_index', 200)).toEqual(['T']);
-
-      expect(sqlFunctions.getArgumentTypes('hive', 'weeks_add', 1)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('hive', 'weeks_add', 2)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('hive', 'weeks_add', 3)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('hive', 'weeks_add', 200)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'weeks_add', 1)).toEqual(['TIMESTAMP']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'weeks_add', 2)).toEqual(['BIGINT', 'INT']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'weeks_add', 3)).toEqual([]);
-      expect(sqlFunctions.getArgumentTypes('impala', 'weeks_add', 200)).toEqual([]);
-
-      expect(sqlFunctions.getArgumentTypes('hive', 'reflect', 1)).toEqual(['STRING']);
-      expect(sqlFunctions.getArgumentTypes('hive', 'reflect', 2)).toEqual(['STRING']);
-      expect(sqlFunctions.getArgumentTypes('hive', 'reflect', 3)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('hive', 'reflect', 200)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'reflect', 1)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'reflect', 200)).toEqual(['T']);
-
-      expect(sqlFunctions.getArgumentTypes('hive', 'blabla', 2)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('hive', 'blabla', 200)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'blabla', 2)).toEqual(['T']);
-      expect(sqlFunctions.getArgumentTypes('impala', 'blabla', 200)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('hive', 'cos', 1)).toEqual(['DECIMAL', 'DOUBLE']);
+      expect(SqlFunctions.getArgumentTypes('hive', 'cos', 2)).toEqual([]);
+      expect(SqlFunctions.getArgumentTypes('impala', 'cos', 1)).toEqual(['DOUBLE']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'cos', 2)).toEqual([]);
+
+      expect(SqlFunctions.getArgumentTypes('hive', 'greatest', 1)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('hive', 'greatest', 200)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'greatest', 1)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'greatest', 200)).toEqual(['T']);
+
+      expect(SqlFunctions.getArgumentTypes('hive', 'strleft', 1)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('hive', 'strleft', 2)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('hive', 'strleft', 3)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('hive', 'strleft', 200)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'strleft', 1)).toEqual(['STRING']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'strleft', 2)).toEqual(['INT']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'strleft', 3)).toEqual([]);
+      expect(SqlFunctions.getArgumentTypes('impala', 'strleft', 200)).toEqual([]);
+
+      expect(SqlFunctions.getArgumentTypes('hive', 'concat', 10)).toEqual(['BINARY', 'STRING']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'concat', 10)).toEqual(['STRING']);
+
+      expect(SqlFunctions.getArgumentTypes('hive', 'substring_index', 1)).toEqual(['STRING']);
+      expect(SqlFunctions.getArgumentTypes('hive', 'substring_index', 2)).toEqual(['STRING']);
+      expect(SqlFunctions.getArgumentTypes('hive', 'substring_index', 3)).toEqual(['INT']);
+      expect(SqlFunctions.getArgumentTypes('hive', 'substring_index', 200)).toEqual([]);
+      expect(SqlFunctions.getArgumentTypes('impala', 'substring_index', 1)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'substring_index', 2)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'substring_index', 3)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'substring_index', 200)).toEqual(['T']);
+
+      expect(SqlFunctions.getArgumentTypes('hive', 'weeks_add', 1)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('hive', 'weeks_add', 2)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('hive', 'weeks_add', 3)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('hive', 'weeks_add', 200)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'weeks_add', 1)).toEqual(['TIMESTAMP']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'weeks_add', 2)).toEqual(['BIGINT', 'INT']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'weeks_add', 3)).toEqual([]);
+      expect(SqlFunctions.getArgumentTypes('impala', 'weeks_add', 200)).toEqual([]);
+
+      expect(SqlFunctions.getArgumentTypes('hive', 'reflect', 1)).toEqual(['STRING']);
+      expect(SqlFunctions.getArgumentTypes('hive', 'reflect', 2)).toEqual(['STRING']);
+      expect(SqlFunctions.getArgumentTypes('hive', 'reflect', 3)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('hive', 'reflect', 200)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'reflect', 1)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'reflect', 200)).toEqual(['T']);
+
+      expect(SqlFunctions.getArgumentTypes('hive', 'blabla', 2)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('hive', 'blabla', 200)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'blabla', 2)).toEqual(['T']);
+      expect(SqlFunctions.getArgumentTypes('impala', 'blabla', 200)).toEqual(['T']);
     });
   });
-});
+})();

+ 7 - 33
desktop/core/src/desktop/templates/common_jasmine.mako

@@ -14,8 +14,6 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 
-<%namespace name="require" file="/require.mako" />
-
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
         "http://www.w3.org/TR/html4/loose.dtd">
 <html>
@@ -29,37 +27,13 @@
   <script type="text/javascript" src="${ static('desktop/js/jquery.migration.js') }"></script>
   <script type="text/javascript" src="${ static('desktop/js/hue.utils.js') }"></script>
   <script type="text/javascript" src="${ static('desktop/ext/js/jquery/plugins/jquery.total-storage.min.js') }"></script>
-
-  <script src="${ static('desktop/js/ace/ace.js') }"></script>
-  <script src="${ static('desktop/js/ace/ext-language_tools.js') }"></script>
-  <script src="${ static('desktop/js/ace.extended.js') }"></script>
-
-  ${ require.config() }
-
-  <script type="text/javascript" charset="utf-8">
-    // Adds the jasmine dependencies to the existing require config.
-    require.config({
-      urlArgs: "random=" + Math.random(),
-      baseUrl: "${ static('') }",
-      paths: {
-        'jasmine': 'desktop/ext/js/jasmine-2.3.4/jasmine',
-        'jasmine-html': 'desktop/ext/js/jasmine-2.3.4/jasmine-html',
-        'jasmine-boot': 'desktop/ext/js/jasmine-2.3.4/boot',
-        'mock-ajax':  'desktop/ext/js/jasmine-2.3.4/mock-ajax'
-      },
-      shim: {
-        'jasmine-html': {
-          deps: ['jasmine']
-        },
-        'jasmine-boot': {
-          deps: ['jasmine', 'jasmine-html']
-        },
-        'mock-ajax': {
-          deps: ['jasmine-boot']
-        }
-      }
-    })
-  </script>
+  <script type="text/javascript" src="${ static('desktop/js/ace/ace.js') }"></script>
+  <script type="text/javascript" src="${ static('desktop/js/ace/ext-language_tools.js') }"></script>
+  <script type="text/javascript" src="${ static('desktop/js/ace.extended.js') }"></script>
+  <script type="text/javascript" src="${ static('desktop/ext/js/jasmine-2.3.4/jasmine') }"></script>
+  <script type="text/javascript" src="${ static('desktop/ext/js/jasmine-2.3.4/jasmine-html') }"></script>
+  <script type="text/javascript" src="${ static('desktop/ext/js/jasmine-2.3.4/boot') }"></script>
+  <script type="text/javascript" src="${ static('desktop/ext/js/jasmine-2.3.4/mock-ajax') }"></script>
 
   <%block name="specs"/>
 </head>

+ 50 - 94
desktop/core/src/desktop/templates/jasmineRunner.html

@@ -21,107 +21,63 @@
   <script type="text/javascript" src="../static/desktop/js/jquery.migration.js"></script>
   <script type="text/javascript" src="../static/desktop/js/hue.utils.js"></script>
   <script type="text/javascript" src="../static/desktop/ext/js/jquery/plugins/jquery.total-storage.min.js"></script>
+  <script type="text/javascript" src="../static/desktop/js/ace/ace.js"></script>
+  <script type="text/javascript" src="../static/desktop/js/ace/ext-language_tools.js"></script>
+  <script type="text/javascript" src="../static/desktop/js/ace.extended.js"></script>
+  <script type="text/javascript" src="../static/desktop/ext/js/knockout.min.js"></script>
+  <script type="text/javascript" src="../static/desktop/ext/js/knockout-mapping.min.js"></script>
+  <script type="text/javascript" src="../static/desktop/js/apiHelper.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/autocompleterTestUtils.js"></script>
 
-  <script src="../static/desktop/js/ace/ace.js"></script>
-  <script src="../static/desktop/js/ace/ext-language_tools.js"></script>
-  <script src="../static/desktop/js/ace.extended.js"></script>
+  <script type="text/javascript" src="../static/desktop/ext/js/jasmine-2.3.4/jasmine.js"></script>
+  <script type="text/javascript" src="../static/desktop/ext/js/jasmine-2.3.4/jasmine-html.js"></script>
+  <script type="text/javascript" src="../static/desktop/ext/js/jasmine-2.3.4/boot.js"></script>
+  <script type="text/javascript" src="../static/desktop/ext/js/jasmine-2.3.4/mock-ajax.js"></script>
 
-  <script src="../static/desktop/ext/js/require.js"></script>
-  <script>
-    define('jquery', [], function() {
-      return jQuery;
-    });
-    require.config({
-      urlArgs: "bust=" + (new Date()).getTime(),
-      baseUrl: "../static/",
-      paths: {
-        "jquery.ui.sortable": "desktop/ext/js/jquery/plugins/jquery-ui-1.10.4.custom.min",
-        "knockout": "desktop/ext/js/knockout.min",
-        "ko.charts" : "desktop/js/ko.charts",
-        "knockout-mapping" : "desktop/ext/js/knockout-mapping.min",
-        "knockout-sortable" : "desktop/ext/js/knockout-sortable.min",
-        "ko.editable" : "desktop/js/ko.editable",
-        "ko.switch-case" : "desktop/js/ko.switch-case",
-        "ko.hue-bindings" : "desktop/js/ko.hue-bindings"
-      },
-      shim: {
-        "knockout": { exports: "ko" },
-        "knockout-mapping": { deps: ["knockout"] },
-        "knockout-sortable": { deps: ["knockout", "jquery", "jquery.ui.sortable"] },
-        "ko.editable": { deps: ["knockout"] },
-        "ko.switch-case": { deps: ["knockout"] },
-        "ace.extended": { deps: ["ace"] },
-        "ace.ext-language-tools": { deps: ["ace"] }
-      },
-      deps: ["knockout", "knockout-mapping"],
-      callback: function(ko, mapping) {
-        ko.mapping = mapping;
-        window.hueDebug = {
-          ko: ko,
-          viewModel: function () {
-            return ko.dataFor(document.body);
-          }
-        }
-      }
-    });
-  </script>
+  <script type="text/javascript" src="../static/desktop/spec/apiHelperSpec.js"></script>
 
+  <script type="text/javascript" src="../static/desktop/js/sqlAutocompleter.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/sqlAutocompleterSpec.js"></script>
 
-  <script type="text/javascript" charset="utf-8">
-    // Adds the jasmine dependencies to the existing require config.
-    require.config({
-      urlArgs: "random=" + Math.random(),
-      baseUrl: "../static/",
-      paths: {
-        'jasmine': 'desktop/ext/js/jasmine-2.3.4/jasmine',
-        'jasmine-html': 'desktop/ext/js/jasmine-2.3.4/jasmine-html',
-        'jasmine-boot': 'desktop/ext/js/jasmine-2.3.4/boot',
-        'jasmine-junit': 'desktop/ext/js/jasmine-2.3.4/junit_reporter',
-        'jasmine-terminal': 'desktop/ext/js/jasmine-2.3.4/terminal_reporter',
-        'mock-ajax':  'desktop/ext/js/jasmine-2.3.4/mock-ajax'
-      },
-      shim: {
-        'jasmine-html': {
-          deps: ['jasmine']
-        },
-        'jasmine-boot': {
-          deps: ['jasmine', 'jasmine-html', 'jasmine-junit', 'jasmine-terminal']
-        },
-        'mock-ajax': {
-          deps: ['jasmine-boot']
-        }
-      }
-    })
-  </script>
+  <script type="text/javascript" src="../static/desktop/js/sqlAutocompleter2.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/sqlAutocompleter2Spec.js"></script>
 
+  <script type="text/javascript" src="../static/desktop/js/sqlFunctions.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/sqlFunctionsSpec.js"></script>
 
-  <script type="text/javascript" charset="utf-8">
-    require(['jasmine-boot', 'jasmine', 'mock-ajax'], function () {
-      // Add specs below
-      require([
-        'desktop/spec/sqlAutocompleterSpec',
-        'desktop/spec/sqlAutocompleter2Spec',
-        'desktop/spec/sqlFunctionsSpec',
-        'desktop/spec/hdfsAutocompleterSpec',
-        'desktop/spec/apiHelperSpec',
-        'desktop/spec/autocomplete/sqlSpec'
-      ], function () {
-        if (/PhantomJS/.test(window.navigator.userAgent)) {
-          console.log("Running Jasmine tests with JUnitXmlReporter and TerminalReporter");
-          jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
-            savePath: '../../',
-            consolidateAll: false
-          }));
-          jasmine.getEnv().addReporter(new jasmineReporters.TerminalReporter());
-        }
-        window.onload();
-      });
-    });
-  </script>
+  <script type="text/javascript" src="../static/desktop/js/hdfsAutocompleter.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/hdfsAutocompleterSpec.js"></script>
 
-</head>
 
-<body>
+  <script type="text/javascript" src="../static/desktop/js/autocomplete/sql.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/autocomplete/sqlSpec.js"></script>
 
-</body>
+  <script type="text/javascript" src="../static/desktop/spec/autocomplete/sqlSpecAlter.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/autocomplete/sqlSpecAnalyze.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/autocomplete/sqlSpecCreate.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/autocomplete/sqlSpecDescribe.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/autocomplete/sqlSpecDrop.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/autocomplete/sqlSpecError.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/autocomplete/sqlSpecInsert.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/autocomplete/sqlSpecLoad.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/autocomplete/sqlSpecLocations.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/autocomplete/sqlSpecSelect.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/autocomplete/sqlSpecSet.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/autocomplete/sqlSpecShow.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/autocomplete/sqlSpecUpdate.js"></script>
+  <script type="text/javascript" src="../static/desktop/spec/autocomplete/sqlSpecUse.js"></script>
+
+  <script type="text/javascript" charset="utf-8">
+    if (/PhantomJS/.test(window.navigator.userAgent)) {
+      console.log("Running Jasmine tests with JUnitXmlReporter and TerminalReporter");
+      jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
+        savePath: '../../',
+        consolidateAll: false
+      }));
+      jasmine.getEnv().addReporter(new jasmineReporters.TerminalReporter());
+    }
+    window.onload();
+  </script>
+</head>
+<body></body>
 </html>