http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/config/environment.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/config/environment.js b/contrib/views/hive/src/main/resources/ui/hive-web/config/environment.js deleted file mode 100644 index 992d91c..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/config/environment.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -/* jshint node: true */ - -module.exports = function(environment) { - var ENV = { - modulePrefix: 'hive', - environment: environment, - baseURL: '/', - locationType: 'hash', - EmberENV: { - FEATURES: { - // Here you can enable experimental features on an ember canary build - // e.g. 'with-controller': true - } - }, - - contentSecurityPolicy: { - 'connect-src': "'self' ws://localhost:35729 ws://0.0.0.0:35729", - 'style-src': "'self' 'unsafe-inline'" - }, - - APP: { - // Here you can pass flags/options to your application instance - // when it is created - } - }; - - if (environment === 'development') { - // ENV.APP.LOG_RESOLVER = true; - ENV.APP.LOG_ACTIVE_GENERATION = true; - // ENV.APP.LOG_TRANSITIONS = true; - // ENV.APP.LOG_TRANSITIONS_INTERNAL = true; - ENV.APP.LOG_VIEW_LOOKUPS = true; - } - - if (environment === 'test') { - // Testem prefers this... - ENV.baseURL = '/'; - ENV.locationType = 'auto'; - - // keep test console output quieter - ENV.APP.LOG_ACTIVE_GENERATION = false; - ENV.APP.LOG_VIEW_LOOKUPS = false; - - ENV.APP.rootElement = '#ember-testing'; - } - - if (environment === 'production') { - - } - - return ENV; -};
http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/package.json ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/package.json b/contrib/views/hive/src/main/resources/ui/hive-web/package.json deleted file mode 100644 index 6fe68e2..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "hive", - "version": "0.0.0", - "private": true, - "directories": { - "doc": "doc", - "test": "tests" - }, - "scripts": { - "start": "ember server", - "build": "ember build", - "test": "ember test", - "preinstall": "chmod +x node/npm/bin/node-gyp-bin/node-gyp", - "postinstall": "bash node/with_new_path.sh node node_modules/.bin/bower --allow-root install" - }, - "repository": "https://github.com/stefanpenner/ember-cli", - "engines": { - "node": ">= 0.10.32" - }, - "author": "", - "license": "MIT", - "devDependencies": { - "body-parser": "^1.2.0", - "bower": ">= 1.3.12", - "broccoli-asset-rev": "^2.0.0", - "broccoli-sass": "^0.6.3", - "ember-cli": "0.2.2", - "ember-cli-autoprefixer": "0.4.1", - "ember-cli-blanket": "^0.5.0", - "ember-cli-content-security-policy": "0.3.0", - "ember-cli-font-awesome": "0.0.4", - "ember-cli-htmlbars": "0.7.4", - "ember-cli-ic-ajax": "0.1.1", - "ember-cli-inject-live-reload": "^1.3.0", - "ember-cli-jquery-ui": "0.0.12", - "ember-cli-moment": "0.0.1", - "ember-cli-pretender": "^0.3.1", - "ember-cli-qunit": "0.3.14", - "ember-cli-selectize": "0.0.19", - "ember-cli-uglify": "1.0.1", - "ember-cli-uploader": "^0.3.9", - "ember-data": "1.0.0-beta.16.1", - "ember-dynamic-component": "0.0.1", - "ember-export-application-global": "^1.0.0", - "express": "^4.8.5" - } -} http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/testem.json ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/testem.json b/contrib/views/hive/src/main/resources/ui/hive-web/testem.json deleted file mode 100644 index 78029a1..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/testem.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "framework": "qunit", - "test_page": "tests/index.html?hidepassed&nocontainer", - "launch_in_ci": [ - "PhantomJS" - ], - "launch_in_dev": [ - "Chrome" - ] -} http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/.jshintrc ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/.jshintrc b/contrib/views/hive/src/main/resources/ui/hive-web/tests/.jshintrc deleted file mode 100644 index 6ebf71a..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/.jshintrc +++ /dev/null @@ -1,74 +0,0 @@ -{ - "predef": [ - "document", - "window", - "location", - "setTimeout", - "$", - "-Promise", - "QUnit", - "define", - "console", - "equal", - "notEqual", - "notStrictEqual", - "test", - "asyncTest", - "testBoth", - "testWithDefault", - "raises", - "throws", - "deepEqual", - "start", - "stop", - "ok", - "strictEqual", - "module", - "moduleFor", - "moduleForComponent", - "moduleForModel", - "process", - "expect", - "visit", - "exists", - "fillIn", - "click", - "keyEvent", - "triggerEvent", - "find", - "findWithAssert", - "wait", - "DS", - "isolatedContainer", - "startApp", - "andThen", - "currentURL", - "currentPath", - "currentRouteName" - ], - "node": false, - "browser": false, - "boss": true, - "curly": false, - "debug": false, - "devel": false, - "eqeqeq": true, - "evil": true, - "forin": false, - "immed": false, - "laxbreak": false, - "newcap": true, - "noarg": true, - "noempty": false, - "nonew": false, - "nomen": false, - "onevar": false, - "plusplus": false, - "regexp": false, - "undef": true, - "sub": true, - "strict": false, - "white": false, - "eqnull": true, - "esnext": true -} http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/blanket-options.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/blanket-options.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/blanket-options.js deleted file mode 100644 index 63e022b..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/blanket-options.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -/*globals blanket, module */ - -var options = { - modulePrefix: "hive", - filter: "//.*hive/.*/", - antifilter: "//.*(tests|template).*/", - loaderExclusions: ['ember-cli-jquery-ui', 'hive/config/environment'], - enableCoverage: true, - cliOptions: { - reporters: ['json'] - } -}; - -if (typeof exports === 'undefined') { - blanket.options(options); -} else { - module.exports = options; -} http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/helpers/api-mock.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/helpers/api-mock.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/helpers/api-mock.js deleted file mode 100644 index 5bf41e6..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/helpers/api-mock.js +++ /dev/null @@ -1,304 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import applicationAdapter from 'hive/adapters/database'; - -export default function() { - var baseUrl = applicationAdapter.create().buildURL(); - var databases = ['db1', 'db2', 'db3']; - - this.get(baseUrl + '/resources/ddl/database', function (req) { - var db = { - databases: databases - }; - - return [200, {"Content-Type": "application/json"}, JSON.stringify(db)]; - }); - - this.get(baseUrl + '/resources/ddl/database/db1/table.page', function (req) { - var tables = { - rows: [ - ['table1'], - ['table2'], - ['table3'] - ] - }; - - return [200, {"Content-Type": "application/json"}, JSON.stringify(tables)]; - }); - - this.get(baseUrl + '/resources/ddl/database/db1/table', function (req) { - var tables = { - tables: [ - ['table1'], - ['table2'], - ['table3'] - ], - database: 'db1' - }; - - return [200, {"Content-Type": "application/json"}, JSON.stringify(tables)]; - }); - - this.get(baseUrl + '/resources/ddl/database/db1/table/table1.page', function (req) { - var columns = { - rows: [ - ['column1', 'STRING'], - ['column2', 'STRING'], - ['column3', 'STRING'] - ] - }; - - return [200, {"Content-Type": "application/json"}, JSON.stringify(columns)]; - }); - - this.get(baseUrl + '/udfs', function (req) { - var udf = { - "udfs": [{ - "name": "TestColumn", - "classname": "TestClassName", - "fileResource": 1, - "id": 1, - "owner": "owner1" - }, - { - "name": "Test2Columns", - "classname": "Test2ClassName", - "fileResource": 1, - "id": 2, - "owner": "owner2" - }] - }; - - return [200, {"Content-Type": "application/json"}, JSON.stringify(udf)]; - }); - - this.post(baseUrl + '/jobs', function (req) { - var job = { - "job": { - "status":"Finished", - "dataBase":"db1", - "dateSubmitted":1421677418, - "logFile":"job1/logs", - "properties":{}, - "fileResources":[], - "statusDir":"job1", - "id":1, - "title":"Worksheet", - "duration":2, - "forcedContent":"", - "owner":"admin", - "confFile":"job1/conf", - "queryId":null, - "queryFile":"job1.hql" - } - }; - - return [200, {"Content-Type": "application/json"}, JSON.stringify(job)]; - }); - - this.get(baseUrl + '/resources/file/job1.hql', function (req) { - var file = { - "file": { - "filePath": "job1.hql", - "fileContent": "select * from big", - "hasNext": false, - "page": 0, - "pageCount": 1 - } - }; - - return [200, {"Content-Type": "application/json"}, JSON.stringify(file)]; - }); - - this.get(baseUrl + '/savedQueries', function(req) { - var savedQueries = { - "savedQueries": [{ - "queryFile": "saved1.hql", - "dataBase": "db1", - "title": "saved1", - "shortQuery": "", - "id": 1, - "owner": "owner1" - }, { - "queryFile": "saved2.hql", - "dataBase": "db2", - "title": "saved2", - "shortQuery": "select count(field_0) from big;", - "id": 2, - "owner": "owner2" - }] - }; - - return [200, {"Content-Type": "application/json"}, JSON.stringify(savedQueries)]; - }); - - this.get(baseUrl + '/savedQueries/defaultSettings', function (req) { - var defaultSettings = { - "defaultSettings" : [] - }; - - return [200, {"Content-Type": "application/json"}, JSON.stringify(defaultSettings)]; - }); - - this.get(baseUrl + '/resources/file/saved1.hql', function (req) { - var file = { - "file": { - "filePath": "saved1.hql", - "fileContent": "select * from saved1", - "hasNext": false, - "page": 0, - "pageCount": 0 - } - }; - - return [200, {"Content-Type": "application/json"}, JSON.stringify(file)]; - }); - - this.get(baseUrl + '/jobs', function (req) { - var jobs = { - "jobs": [ - { - "title": "Query1", - "queryFile": "saved1.hql", - "statusDir": "statusdir", - "dateSubmitted": 1421240048, - "duration": 97199, - "status": "Finished", - "forcedContent": "", - "id": 1, - "owner": "admin", - "logFile": "logs1", - "confFile": "conf1" - }, - { - "title": "Query2", - "queryFile": "saved1.hql", - "statusDir": "statusdir", - "dateSubmitted": 1421240048, - "duration": 97199, - "status": "Finished", - "forcedContent": "", - "id": 2, - "owner": "admin", - "logFile": "logs2", - "confFile": "conf2" - }, - { - "title": "Query3", - "queryFile": "saved1.hql", - "statusDir": "statusdir", - "dateSubmitted": 1421240048, - "duration": 97199, - "status": "Running", - "forcedContent": "", - "id": 3, - "owner": "admin", - "logFile": "logs3", - "confFile": "conf3" - }, - { - "title": "Query4", - "queryFile": "saved1.hql", - "statusDir": "statusdir", - "dateSubmitted": 1421240048, - "duration": 97199, - "status": "Error", - "forcedContent": "", - "id": 4, - "owner": "admin", - "logFile": "logs4", - "confFile": "con51" - } - ] - }; - - return [200, {"Content-Type": "application/json"}, JSON.stringify(jobs)]; - }); - - this.get(baseUrl + '/fileResources', function (req) { - var files = { - "fileResources": [ - { - "name": "TestName", - "path": "TestPath", - "id": 1, - "owner": "owner1" - } - ] - }; - - return [200, {"Content-Type": "application/json"}, JSON.stringify(files)]; - }); - - this.delete(baseUrl + '/fileResources/1', function (req) { - return [200, {"Content-Type": "application/json"}, JSON.stringify({})]; - }); - - this.put(baseUrl + '/udfs/1', function (req) { - return [200, {"Content-Type": "application/json"}, JSON.stringify({})]; - }); - - - this.get(baseUrl + '/fileResources/1', function (req) { - var files = { - "fileResources": [ - { - "name": "TestName", - "path": "TestPath", - "id": 1, - "owner": "owner1" - } - ] - }; - - return [200, {"Content-Type": "application/json"}, JSON.stringify(files)]; - }); - - this.get(baseUrl + '/api/v1/views/TEZ', function (req) { - var data = { - versions: [ - { - href: baseUrl + '/api/v1/view/TEZ/versions/1', - ViewVersionInfo: {version: '1', view_name: 'TEZ'} - } - ] - }; - - return [200, {"Content-Type": "application/json"}, JSON.stringify(data)]; - }); - - this.delete(baseUrl + '/savedQueries/1', function (req) { - return [200, {"Content-Type": "application/json"}, JSON.stringify({})]; - }); - - this.get(baseUrl + '/api/v1/views/TEZ/versions/1', function (req) { - var data = { - instances: [ - { - ViewInstanceInfo: { - instance_name: 'tez', - version: 1 - } - } - ] - }; - - return [200, {"Content-Type": "application/json"}, JSON.stringify(data)]; - }); -} http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/helpers/dbclick.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/helpers/dbclick.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/helpers/dbclick.js deleted file mode 100644 index e6dfe83..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/helpers/dbclick.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -Ember.Test.registerAsyncHelper('dblclick', - function (app, selector, context) { - var $el = findWithAssert(selector, context); - Ember.run(function () { - $el.dblclick(); - }); - } -); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/helpers/resolver.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/helpers/resolver.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/helpers/resolver.js deleted file mode 100644 index f94998c..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/helpers/resolver.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Resolver from 'ember/resolver'; -import config from '../../config/environment'; - -var resolver = Resolver.create(); - -resolver.namespace = { - modulePrefix: config.modulePrefix, - podModulePrefix: config.podModulePrefix -}; - -export default resolver; http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/helpers/start-app.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/helpers/start-app.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/helpers/start-app.js deleted file mode 100644 index ab1a9d2..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/helpers/start-app.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Ember from 'ember'; -import Application from '../../app'; -import Router from '../../router'; -import config from '../../config/environment'; - -export default function startApp(attrs) { - var App; - - var attributes = Ember.merge({}, config.APP); - attributes = Ember.merge(attributes, attrs); // use defaults, but you can override; - - Router.reopen({ - location: 'none' - }); - - Ember.run(function() { - App = Application.create(attributes); - App.setupForTesting(); - App.injectTestHelpers(); - }); - - // App.reset(); // this shouldn't be needed, i want to be able to "start an app at a specific URL" - - return App; -} http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/img/spinner.gif ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/img/spinner.gif b/contrib/views/hive/src/main/resources/ui/hive-web/tests/img/spinner.gif deleted file mode 100644 index e921e36..0000000 Binary files a/contrib/views/hive/src/main/resources/ui/hive-web/tests/img/spinner.gif and /dev/null differ http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/index.html ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/index.html b/contrib/views/hive/src/main/resources/ui/hive-web/tests/index.html deleted file mode 100644 index 9faecc6..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/index.html +++ /dev/null @@ -1,71 +0,0 @@ -<!-- - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. ---> -<!DOCTYPE html> -<html> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <title>Hive Tests</title> - <meta name="description" content=""> - <meta name="viewport" content="width=device-width, initial-scale=1"> - - {{content-for 'head'}} - {{content-for 'test-head'}} - - <link rel="stylesheet" href="assets/vendor.css"> - <link rel="stylesheet" href="assets/hive.css"> - <link rel="stylesheet" href="assets/test-support.css"> - <style>#blanket-main { position: relative; z-index: 99999; }</style> - <style> - #ember-testing-container { - position: absolute; - background: white; - bottom: 0; - right: 0; - width: 640px; - height: 384px; - overflow: auto; - z-index: 9999; - border: 1px solid #ccc; - } - #ember-testing { - zoom: 50%; - } - </style> - - {{content-for 'head-footer'}} - {{content-for 'test-head-footer'}} - </head> - <body> - <div id="qunit"></div> - <div id="qunit-fixture"></div> - - {{content-for 'body'}} - {{content-for 'test-body'}} - <script src="assets/vendor.js"></script> - <script src="assets/test-support.js"></script> - <script src="assets/hive.js"></script> - <script src="assets/blanket-options.js"></script> - <script src="assets/blanket-loader.js"></script> - <script src="testem.js"></script> - <script src="assets/test-loader.js"></script> - - {{content-for 'body-footer'}} - {{content-for 'test-body-footer'}} - </body> -</html> http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/database-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/database-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/database-test.js deleted file mode 100644 index 1af72c8..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/database-test.js +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Ember from 'ember'; -import { test } from 'ember-qunit'; -import startApp from '../helpers/start-app'; -import api from '../helpers/api-mock'; - -var App; -var server; - -module('Integration: Databases', { - setup: function() { - App = startApp(); - /* global Pretender: true */ - server = new Pretender(api); - }, - teardown: function() { - Ember.run(App, App.destroy); - server.shutdown(); - } -}); - -test('Database Explorer is displayed and populated with databases from server.', function (assert) { - assert.expect(2); - - visit('/'); - - andThen(function() { - equal(find('.database-explorer').length, 1, 'Databases panel is visible.'); - equal(find('.database-explorer .databases').children().length, 3, 'Databases are listed.'); - }); -}); - -test('Expanding a database will retrieve the first page of tables for that database.', function () { - expect(1); - - visit('/'); - - andThen(function () { - var targetDB = find('.fa-database').first(); - - click(targetDB); - - andThen(function () { - equal(find('.fa-table').length, 3); - }); - }); -}); - -test('Expanding a table will retrieve the first page of columns for that table.', function () { - expect(2); - - visit('/'); - - andThen(function () { - var targetDB = find('.fa-database').first(); - - click(targetDB); - - andThen(function () { - var targetTable = find('.fa-table').first(); - - click(targetTable); - - andThen(function () { - equal(find('.columns').length, 1, 'Columns container was loaded.'); - equal(find('.columns strong').length, 3, '3 columns were loaded for selected table.'); - }); - }); - }); -}); - -test('Searching for a table will display table results and column search field', function () { - expect(2); - - visit('/'); - - andThen(function () { - fillIn(find('input').first(), 'table'); - keyEvent(find('input').first(), 'keyup', 13); - - andThen(function () { - equal(find('input').length, 2, 'Columns search input has been rendered.'); - equal(find('.nav-tabs li').length, 2, 'Results tab has been redendered.'); - }); - }); -}); - - -test('Users can search tables', function (assert) { - assert.expect(4); - - visit('/'); - - andThen(function () { - fillIn(find('.database-explorer .search-tables-text'), 'not_found'); - keyEvent(find('.database-explorer .search-tables-text'), 'keyup', 13); - }); - - andThen(function () { - assert.ok(find('.alert-warning .database-explorer-alert'), 'Alert is show when a table is not found'); - }); - - andThen(function () { - fillIn(find('.database-explorer .search-tables-text'), 'table'); - keyEvent(find('.database-explorer .search-tables-text'), 'keyup', 13); - }); - - andThen(function () { - assert.ok(find('.database-explorer .nav-tabs li:last').hasClass('active'), 'Search results tab is active'); - assert.ok(find('.database-explorer .databases .fa-database').length, 'Found databases are shown'); - assert.ok(find('.database-explorer .databases .tables').length, 'Found tables are shown'); - }); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/history-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/history-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/history-test.js deleted file mode 100644 index 35a950d..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/history-test.js +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Ember from 'ember'; -import { test } from 'ember-qunit'; -import startApp from '../helpers/start-app'; -import api from '../helpers/api-mock'; - -var App; -var server; - -module('Integration: History', { - setup: function() { - App = startApp(); - /* global Pretender: true */ - server = new Pretender(api); - }, - - teardown: function() { - Ember.run(App, App.destroy); - server.shutdown(); - } -}); - -test('Save Queries should list saved queries', function() { - expect(1); - - visit("/history"); - - andThen(function() { - equal(find('#content .table tbody tr').length, 4); - }); -}); - -test('User should be able to filter the jobs', function() { - expect(4); - - visit("/history"); - - fillIn('column-filter input[placeholder=title]', "Query1"); - keyEvent('column-filter input[placeholder=title]', 'keyup'); - - andThen(function() { - equal(find('#content .table tbody tr:visible').length, 1, 'User is able to filter by title'); - }); - - click('.clear-filters'); - andThen(function() { - equal(find('#content .table tbody tr:visible').length, 4); - }); - - - fillIn('column-filter input[placeholder=status]', "Finished"); - keyEvent('column-filter input[placeholder=status]', 'keyup'); - - andThen(function() { - equal(find('#content .table tbody tr:visible').length, 2, 'User is able to filter by status'); - }); - - click('.clear-filters'); - andThen(function() { - equal(find('#content .table tbody tr:visible').length, 4); - }); -}); - -test('A query item should expand to show the HQL', function() { - expect(3); - visit("/history"); - - andThen(function() { - equal(find('.table-expandable tbody .secondary-row').length, 0, 'All queries are collapsed'); - }); - - click('.table-expandable tbody tr:first-child'); - - andThen(function() { - equal(find('.table-expandable tbody .secondary-row').length, 1, 'One query is expanded'); - ok(find('.table-expandable tbody tr:first-child').next().hasClass('secondary-row'), 'Clicked query is expanded'); - }); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/query-editor-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/query-editor-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/query-editor-test.js deleted file mode 100644 index 3073013..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/query-editor-test.js +++ /dev/null @@ -1,126 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Ember from 'ember'; -import { test } from 'ember-qunit'; -import startApp from '../helpers/start-app'; -import api from '../helpers/api-mock'; -import '../helpers/dbclick'; - -var App; -var server; - -module('Integration: Query Editor', { - setup: function() { - App = startApp(); - /* global Pretender: true */ - server = new Pretender(api); - }, - - teardown: function() { - Ember.run(App, App.destroy); - server.shutdown(); - } -}); - -test('Query Editor is visible', function() { - expect(1); - - visit("/"); - - andThen(function() { - equal(find('.query-editor-panel').length, 1, 'Query Editor is visible'); - }); -}); - -test('Can execute query either with full or partial selection', function() { - expect(3); - - var query1 = "select count(*) from table1;", - query2 = "select color from z;", - query3 = "select fruit from z;", - query4 = query2 + "\n" + query3, - editor; - - visit("/"); - - Ember.run(function() { - editor = find('.CodeMirror').get(0).CodeMirror; - editor.setValue(query1); - }); - - click('.execute-query'); - - andThen(function() { - equal(find('.query-process-results-panel').length, 1, 'Job tabs are visible.'); - }); - - Ember.run(function() { - editor.setValue(query4); - editor.setSelection({ line: 1, ch: 0 }, { line: 1, ch: 20 }); - }); - - click('.execute-query'); - - andThen(function() { - equal(editor.getValue(), query4, 'Editor value didn\'t change'); - equal(editor.getSelection(), query3, 'Query 3 is selected'); - }); -}); - - -test('Can save query', function() { - expect(2); - - visit("/"); - - andThen(function() { - equal(find('.modal-dialog').length, 0, 'Modal dialog is hidden'); - }); - - Ember.run(function() { - find('.CodeMirror').get(0).CodeMirror.setValue('select count(*) from table1'); - }); - - click('.save-query-as'); - - andThen(function() { - equal(find('.modal-dialog').length, 1, 'Modal dialog is shown'); - }); - - click('.modal-footer .btn-danger'); -}); - -test('Can change tab title', function (assert) { - assert.expect(1); - - visit('/'); - - andThen(function () { - dblclick('.query-editor-panel tabs li:first a'); - - andThen(function () { - fillIn('.modal-body input', 'WS'); - click('.modal-footer .btn-success'); - - andThen(function () { - assert.equal(find('.query-editor-panel tabs li:first a').text().trim(), 'WS', 'Tab renamed'); - }); - }); - }); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/saved-queries-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/saved-queries-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/saved-queries-test.js deleted file mode 100644 index fdbcd4e..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/saved-queries-test.js +++ /dev/null @@ -1,152 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Ember from 'ember'; -import { test } from 'ember-qunit'; -import startApp from '../helpers/start-app'; -import api from '../helpers/api-mock'; - -var App; -var server; - -module('Integration: Saved Queries', { - setup: function() { - App = startApp(); - /* global Pretender: true */ - server = new Pretender(api); - }, - - teardown: function() { - Ember.run(App, App.destroy); - server.shutdown(); - } -}); - -test('Save Queries should list saved queries', function() { - expect(1); - - visit("/queries"); - - - andThen(function() { - equal(find('#content .table tbody tr').length, 2); - }); -}); - -test('User should be able to filter the queries', function() { - expect(8); - - visit("/queries"); - - fillIn('column-filter input[placeholder=preview]', "select count"); - keyEvent('column-filter input[placeholder=preview]', 'keyup'); - - andThen(function() { - equal(find('#content .table tbody tr:visible').length, 1, 'User is able to filter by short query form.'); - }); - - click('.clear-filters'); - andThen(function() { - equal(find('#content .table tbody tr:visible').length, 2); - }); - - fillIn('column-filter input[placeholder=title]', "saved1"); - keyEvent('column-filter input[placeholder=title]', 'keyup'); - - andThen(function() { - equal(find('#content .table tbody tr:visible').length, 1, 'User is able to filter by title'); - }); - - click('.clear-filters'); - andThen(function() { - equal(find('#content .table tbody tr:visible').length, 2); - }); - - fillIn('column-filter input[placeholder=database]', "db1"); - keyEvent('column-filter input[placeholder=database]', 'keyup'); - - andThen(function() { - equal(find('#content .table tbody tr:visible').length, 1, 'User is able to filter by database'); - }); - - click('.clear-filters'); - andThen(function() { - equal(find('#content .table tbody tr:visible').length, 2); - }); - - fillIn('column-filter input[placeholder=owner]', "owner1"); - keyEvent('column-filter input[placeholder=owner]', 'keyup'); - - andThen(function() { - equal(find('#content .table tbody tr:visible').length, 1, 'User is able to filter by owner'); - }); - - click('.clear-filters'); - andThen(function() { - equal(find('#content .table tbody tr:visible').length, 2); - }); -}); - -test('User is able to load a query from saved queries', function() { - expect(1); - - visit("/queries"); - click('#content .table tbody tr:first-child td:first-child a'); - - andThen(function() { - equal(currentURL(), "/queries/1", 'User is redirected'); - }); -}); - -test('Saved Query options menu', function() { - expect(2); - - visit("/queries"); - click('.fa-gear:first'); - - andThen(function() { - equal(find('.dropdown-menu:visible').length, 1, 'Query menu is visible'); - equal(find('.dropdown-menu:visible li').length, 2, 'Query menu has 2 options'); - }); -}); - -test('User is able to see history for a query', function (assert) { - assert.expect(2); - - visit("/queries"); - click('.fa-gear:first'); - click('.dropdown-menu:visible li:first'); - - andThen(function () { - assert.equal(currentURL(), "/history", 'User is redirected to history'); - assert.equal(find('#content .table tbody tr').length, 1, 'Queries are filtered'); - }); -}); - -test('User is able to delete a query', function (assert) { - assert.expect(1); - - visit("/queries"); - click('.fa-gear:first'); - click('.dropdown-menu:visible li:last'); - click('.modal-footer .btn-success'); - - andThen(function () { - equal(find('#content .table tbody tr').length, 1, 'Query deleted'); - }); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/tez-ui-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/tez-ui-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/tez-ui-test.js deleted file mode 100644 index f64dcb2..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/tez-ui-test.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Ember from 'ember'; -import { test } from 'ember-qunit'; -import startApp from '../helpers/start-app'; -import api from '../helpers/api-mock'; - -var App; -var server; - -module('Integration: Tez UI', { - setup: function() { - App = startApp(); - /* global Pretender: true */ - server = new Pretender(api); - }, - - teardown: function() { - Ember.run(App, App.destroy); - server.shutdown(); - } -}); - -test('An error is show when there is no dag', function() { - expect(1); - - visit("/"); - click('#tez-icon'); - - andThen(function() { - ok(find('.panel .alert .alert-danger'), 'Error is visible'); - }); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/udfs-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/udfs-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/udfs-test.js deleted file mode 100644 index 526efc0..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/integration/udfs-test.js +++ /dev/null @@ -1,109 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Ember from 'ember'; -import { test } from 'ember-qunit'; -import startApp from '../helpers/start-app'; -import api from '../helpers/api-mock'; - -var App; -var server; - -module('Integration: Udfs', { - setup: function() { - App = startApp(); - /* global Pretender: true */ - server = new Pretender(api); - }, - - teardown: function() { - Ember.run(App, App.destroy); - server.shutdown(); - } -}); - -test('Save Queries should list saved queries', function() { - expect(1); - - visit("/udfs"); - - andThen(function() { - equal(find('#content .table tbody tr').length, 2); - }); -}); - -test('User should be able to filter the udfs', function() { - expect(4); - - visit("/udfs"); - - fillIn('column-filter input[placeholder="udf name"]', "TestColumn"); - keyEvent('column-filter input[placeholder="udf name"]', 'keyup'); - - andThen(function() { - equal(find('#content .table tbody tr:visible').length, 1, 'User is able to filter by name'); - }); - - click('.clear-filters'); - - andThen(function() { - equal(find('#content .table tbody tr:visible').length, 2); - }); - - fillIn('column-filter input[placeholder="udf class name"]', "TestClassName"); - keyEvent('column-filter input[placeholder="udf class name"]', 'keyup'); - - andThen(function() { - equal(find('#content .table tbody tr:visible').length, 1, 'User is able to filter by class name'); - }); - - click('.clear-filters'); - - andThen(function() { - equal(find('#content .table tbody tr:visible').length, 2); - }); -}); - -test('User is able to add udf', function() { - expect(1); - - visit("/udfs"); - click('.add-udf'); - - andThen(function() { - equal(find('#content .table tbody tr').length, 3); - }); -}); - - -test('Can delete file resource', function (assert) { - assert.expect(1); - - visit('/udfs'); - click('.fa-gear:first'); - click('.dropdown-menu li:first'); - click('.dropdown-toggle:first'); - click('.fa-remove:first'); - - andThen(function () { - click('.modal-footer .btn-success'); - click('tr.ember-view:first .btn-success'); - }); - - assert.equal($('tr.ember-view:first td:first').text().trim().length, 0, 'File Resource Deleted'); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/test-helper.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/test-helper.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/test-helper.js deleted file mode 100644 index 96975ee..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/test-helper.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import resolver from './helpers/resolver'; -import { - setResolver -} from 'ember-qunit'; - -setResolver(resolver); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/.gitkeep ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/.gitkeep b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/.gitkeep deleted file mode 100644 index e69de29..0000000 http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/adapters/application.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/adapters/application.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/adapters/application.js deleted file mode 100644 index 6e28a40..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/adapters/application.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import { - moduleFor, - test -} from 'ember-qunit'; - -import constants from 'hive/utils/constants'; - -moduleFor('adapter:application', 'ApplicationAdapter', { - // Specify the other units that are required for this test. - // needs: ['serializer:foo'] -}); - -// Replace this with your real tests. -test('X-Requested-By header is set.', function() { - expect(1); - - var adapter = this.subject(); - - ok(adapter.get('headers.X-Requested-By'), 'X-Requested-By is set to a truthy value.'); -}); - -test('buildUrl returns an url with default values for version and instance paramters if not running within an Ambari instance.', function () { - expect(1); - - var adapter = this.subject(); - - var url = adapter.buildURL(); - - equal(url, constants.adapter.apiPrefix + constants.adapter.version + constants.adapter.instancePrefix + 'Hive'); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/adapters/file.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/adapters/file.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/adapters/file.js deleted file mode 100644 index ea70232..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/adapters/file.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import { - moduleFor, - test -} from 'ember-qunit'; - -import constants from 'hive/utils/constants'; - -moduleFor('adapter:file', 'FileAdapter', { - // Specify the other units that are required for this test. - // needs: ['serializer:foo'] -}); - -// Replace this with your real tests. -test('pathForType returns correct path.', function() { - expect(1); - - var adapter = this.subject(); - var type = 'dummy'; - - equal(adapter.pathForType(type), constants.adapter.resourcePrefix + type); -}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/alert-message-widget-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/alert-message-widget-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/alert-message-widget-test.js deleted file mode 100644 index 8f0f245..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/alert-message-widget-test.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Ember from 'ember'; -import { moduleForComponent, test } from 'ember-qunit'; - -moduleForComponent('alert-message-widget', 'AlertMessageWidgetComponent', { - needs: [] -}); - -test('isExpanded is toggled on click', function() { - expect(2); - - var message = Ember.Object.create({ isExpanded: false}); - - var component = this.subject({ - message: message - }); - - Ember.run(function() { - component.send('toggleMessage'); - }); - - equal(component.get('message.isExpanded'), true, 'isExpanded is set to true'); - - Ember.run(function() { - component.send('toggleMessage'); - }); - - equal(component.get('message.isExpanded'), false, 'isExpanded is set to false'); -}); - -test('removeLater should be called when the message is toggled', function() { - expect(1); - - var message = Ember.Object.create({ isExpanded: false}); - - var targetObject = { - removeLater: function() { - ok(true, 'External removeLater called'); - } - }; - - var component = this.subject({ - targetObject: targetObject, - removeLater: 'removeLater', - message: message - }); - - Ember.run(function() { - component.send('toggleMessage'); - }); - - Ember.run(function() { - component.send('toggleMessage'); - }); -}); - -test('remove action should call external removeMessage', function() { - expect(1); - - var targetObject = { - removeMessage: function() { - ok(true, 'External removeMessage called'); - } - }; - - var component = this.subject({ - targetObject: targetObject, - removeMessage: 'removeMessage' - }); - - Ember.run(function() { - component.send('remove', {}); - }); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/collapsible-widget-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/collapsible-widget-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/collapsible-widget-test.js deleted file mode 100644 index 96a551f..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/collapsible-widget-test.js +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ -import Ember from 'ember'; -import { moduleForComponent, test } from 'ember-qunit'; - -moduleForComponent('collapsible-widget', 'CollapsibleWidgetComponent', { - unit: true -}); - -test('Component expand/collapse toggle action', function () { - expect(1); - - var targetObject = { - expanded: function() { - ok(true, 'External expanded called'); - } - }; - - var component = this.subject({ - targetObject: targetObject, - isExpanded: 'isExpanded', - expanded: 'expanded' - }); - - var $component = this.render(); - - Ember.run(function() { - component.set('isExpanded', false); - component.send('toggle', {}); - }); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/column-filter-widget-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/column-filter-widget-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/column-filter-widget-test.js deleted file mode 100644 index be8bdc4..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/column-filter-widget-test.js +++ /dev/null @@ -1,138 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Ember from 'ember'; -import { moduleForComponent, test } from 'ember-qunit'; - -moduleForComponent('column-filter-widget', 'ColumnFilterWidgetComponent', { - needs: ['component:extended-input'] -}); - -test('if a filterValue is set when the element is inserted, an action is being sent announcing a filter change', function () { - expect(1); - - var column = Ember.Object.create({ - caption: 'missing.translation' - }); - - var component = this.subject({ column: column }); - - Ember.run(function () { - component.set('filterValue', 'initial filter value'); - }); - - var targetObject = { - externalAction: function(){ - ok(true, 'initial filterValue set. Action has been sent.'); - } - }; - - component.set('columnFiltered', 'externalAction'); - component.set('targetObject', targetObject); - - var $component = this.$(); -}); - -test('isSorted returns true if the table is sorted by this column property', function () { - expect(1); - - var component = this.subject(); - - var column = Ember.Object.create({ - property: 'some prop' - }); - - Ember.run(function () { - component.set('column', column); - component.set('sortProperties', [column.property]); - }); - - ok(component.get('isSorted')); -}); - -test('isSorted returns false if the table is sorted by some other column', function () { - expect(1); - - var component = this.subject(); - - var column = Ember.Object.create({ - property: 'some prop' - }); - - Ember.run(function () { - component.set('column', column); - component.set('sortProperties', ['other prop']); - }); - - ok(!component.get('isSorted')); -}); - -test('isSorted returns false if the table is not sorted by any column', function () { - expect(1); - - var component = this.subject(); - - var column = Ember.Object.create({ - property: 'some prop' - }); - - Ember.run(function () { - component.set('column', column); - component.set('sortProperties', []); - }); - - ok(!component.get('isSorted')); -}); - -test('when sendSort gets called, the columnSorted action gets sent.', function () { - expect(1); - - var component = this.subject(); - - var targetObject = { - externalAction: function(){ - ok(true, 'columnSorted action has been intercepted.'); - } - }; - - Ember.run(function () { - component.set('targetObject', targetObject); - component.set('columnSorted', 'externalAction'); - - component.send('sendSort'); - }); -}); - -test('when sendFilter gets called, the columnFiltered action gets sent.', function () { - expect(1); - - var component = this.subject(); - - var targetObject = { - externalAction: function(){ - ok(true, 'columnFiltered action has been intercepted.'); - } - }; - - Ember.run(function () { - component.set('targetObject', targetObject); - component.set('columnFiltered', 'externalAction'); - - component.send('sendFilter'); - }); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/date-range-widget-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/date-range-widget-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/date-range-widget-test.js deleted file mode 100644 index 766e9ee..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/date-range-widget-test.js +++ /dev/null @@ -1,132 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -/* global moment */ - -import Ember from 'ember'; -import { moduleForComponent, test } from 'ember-qunit'; - -moduleForComponent('date-range-widget', 'DateRangeWidgetComponent', { - needs: ['component:extended-input'] -}); - -test('Date fields are set correctly', function() { - expect(2); - - var component = this.subject(); - - var min = moment('04/11/2014', 'DD/MM/YYYY'); - var max = moment('04/12/2014', 'DD/MM/YYYY'); - var from = moment('04/11/2014', 'DD/MM/YYYY'); - var to = moment('04/12/2014', 'DD/MM/YYYY'); - - var dateRange = Ember.Object.create({ - from: from.toString(), - to: to.toString(), - min: min.toString(), - max: max.toString() - }); - - component.set('dateRange', Ember.Object.create()); - - var $component = this.$(); - - Ember.run(function() { - component.set('dateRange', dateRange); - }); - - equal($component.find('.fromDate').val(), moment(from).format('MM/DD/YYYY'), "From date is set correctly"); - equal($component.find('.toDate').val(), moment(to).format('MM/DD/YYYY'), "To date is set correctly"); -}); - -test('Date fields updates when the date is changed', function() { - expect(2); - - var component = this.subject(); - - var min = moment('04/11/2014', 'DD/MM/YYYY'); - var max = moment('04/12/2014', 'DD/MM/YYYY'); - var from = moment('04/11/2014', 'DD/MM/YYYY'); - var to = moment('04/12/2014', 'DD/MM/YYYY'); - - var dateRange = Ember.Object.create({ - from: from.toString(), - to: to.toString(), - min: min.toString(), - max: max.toString() - }); - - Ember.run(function() { - component.set('dateRange', dateRange); - }); - - var $component = this.$(); - $component.find('.fromDate').datepicker('setDate', '10/10/2014'); - $component.find('.toDate').datepicker('setDate', '11/11/2014'); - - equal($component.find('.fromDate').val(), '10/10/2014', "From date field is updated"); - equal($component.find('.toDate').val(), '11/11/2014', "To date field is updated"); -}); - -test('Display dates are formatted correctly', function(){ - expect(2); - - var component = this.subject(); - - var min = moment('04/11/2014', 'DD/MM/YYYY'); - var max = moment('04/12/2014', 'DD/MM/YYYY'); - var from = moment('04/11/2014', 'DD/MM/YYYY'); - var to = moment('04/12/2014', 'DD/MM/YYYY'); - - var dateRange = Ember.Object.create({ - from: from.toString(), - to: to.toString(), - min: min.toString(), - max: max.toString() - }); - - Ember.run(function () { - component.set('dateRange', dateRange); - }); - - equal(component.get('displayFromDate'), '11/04/2014', "displayFromDate is formatted correctly"); - equal(component.get('displayToDate'), '12/04/2014', "displayToDate is formatted correctly"); -}); - -test('If from/to are not passed they are set to min/max', function() { - expect(2); - - var component = this.subject(); - - var min = moment('04/11/2014', 'DD/MM/YYYY'); - var max = moment('04/12/2014', 'DD/MM/YYYY'); - - var dateRange = Ember.Object.create({ - min: min.toString(), - max: max.toString() - }); - - Ember.run(function () { - component.set('dateRange', dateRange); - }); - - var $component = this.$(); - - equal(component.get('dateRange.from'), min.toString(), "From date is to min date"); - equal(component.get('dateRange.to'), max.toString(), "To date is set to max date"); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/expander-widget-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/expander-widget-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/expander-widget-test.js deleted file mode 100644 index 8d1f07a..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/expander-widget-test.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Ember from 'ember'; -import { moduleForComponent, test } from 'ember-qunit'; - -moduleForComponent('expander-widget', 'ExpanderWidgetComponent', { - unit: true -}); - -test('should set the heading when provided.', function () { - expect(2); - - var component = this.subject(); - var $component = this.$(); - var heading = 'some header'; - - equal($component.find('.accordion-toggle').text(), ''); - - Ember.run(function () { - component.set('heading', heading); - }); - - equal($component.find('.accordion-toggle').text(), heading); -}); - -test('should correctly toggle isExpanded property.', function () { - expect(2); - - var component = this.subject(); - this.$(); - - Ember.run(function(){ - component.send('toggle'); - }); - - equal(component.get('isExpanded'), true); - - Ember.run(function(){ - component.send('toggle'); - }); - - equal(component.get('isExpanded'), false); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/extended-input-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/extended-input-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/extended-input-test.js deleted file mode 100644 index aa861aa..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/extended-input-test.js +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Ember from 'ember'; -import { moduleForComponent, test } from 'ember-qunit'; - -moduleForComponent('extended-input', 'ExtendedInputComponent', { - unit: true -}); - -test('Component has dynamicValue and dynamicContext', function () { - expect(1); - - var component = this.subject({ - dynamicValue: 'dynamicValue', - dynamicContext: Ember.Object.create({ 'dynamicValue' : 'test' }) - }); - - var $component = this.$(); - - equal(component.get('value'), 'test', 'Value is set to dynamicValue value'); -}); - - -test('Component has no dynamicValue and dynamicContext', function () { - expect(1); - - var component = this.subject(); - var $component = this.$(); - - ok(!component.get('value'), 'Value is not set as dynamicValue value'); -}); - -test("Component's dynamicValue is set", function () { - expect(1); - - var component = this.subject({ - dynamicValue: 'dynamicValue', - dynamicContext: Ember.Object.create({ 'dynamicValue' : 'test' }) - }); - - var $component = this.$(); - - Ember.run(function() { - component.sendValueChanged(); - - equal(component.get('value'), component.dynamicContext.get('dynamicValue'), "Value is set and dynamicValue is set"); - }); -}); - -test("Component's dynamicValue is not set", function () { - expect(1); - - var component = this.subject({ - dynamicValue: 'dynamicValue', - dynamicContext: Ember.Object.create({ }) - }); - - var $component = this.$(); - - Ember.run(function() { - component.sendValueChanged(); - - equal(component.get('value'), undefined, "Value is not set"); - }); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/job-tr-view-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/job-tr-view-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/job-tr-view-test.js deleted file mode 100644 index d39a85e..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/job-tr-view-test.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Ember from 'ember'; -import constants from 'hive/utils/constants'; -import { moduleForComponent, test } from 'ember-qunit'; - -moduleForComponent('job-tr-view', 'JobTrViewComponent', { - unit: true -}); - -test('Statuses are computed correctly', function (assert) { - assert.expect(5); - - var component = this.subject(); - - Ember.run(function() { - component.set('job', Ember.Object.create()); - component.set('job.status', constants.statuses.running); - }); - - assert.equal(component.get('canStop'), true, 'Status is running canStop returns true'); - - Ember.run(function() { - component.set('job.status', constants.statuses.initialized); - }); - - assert.equal(component.get('canStop'), true, 'Status is initialized canStop returns true'); - - Ember.run(function() { - component.set('job.status', constants.statuses.pending); - }); - - assert.equal(component.get('canStop'), true, 'Status is pending canStop returns true'); - - Ember.run(function() { - component.set('job.status', constants.statuses.canceled); - }); - - assert.equal(component.get('canStop'), false, 'Status is canceled canStop returns false'); - - Ember.run(function() { - component.set('job.status', constants.statuses.unknown); - }); - - assert.equal(component.get('canStop'), false, 'Status is unknown canStop returns false'); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/modal-widget-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/modal-widget-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/modal-widget-test.js deleted file mode 100644 index 3016444..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/modal-widget-test.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Ember from 'ember'; -import constants from 'hive/utils/constants'; -import { moduleForComponent, test } from 'ember-qunit'; - -moduleForComponent('modal-widget', 'ModalWidgetComponent', { - needs: ['helper:tb-helper'] -}); - -test('It send ok action on keyPress enter', function(assert) { - assert.expect(1); - - Ember.run.debounce = function(target, func) { - func.call(target); - }; - - var component = this.subject({ - ok: 'ok', - targetObject: { - ok: function() { - assert.ok(1, 'OK action sent'); - } - } - }); - - var $component = this.$(); - - component.keyPress({ which: 13 }); - Ember.$('.modal-backdrop').remove(); // remove overlay -}); - -test('It send close action on keyPress escape', function(assert) { - assert.expect(1); - - Ember.run.debounce = function(target, func) { - func.call(target); - }; - - var component = this.subject({ - close: 'close', - targetObject: { - close: function() { - assert.ok(1, 'Close action sent'); - } - } - }); - - var $component = this.$(); - - component.keyPress({ which: 27 }); - Ember.$('.modal-backdrop').remove(); // remove overlay -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/no-bubbling-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/no-bubbling-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/no-bubbling-test.js deleted file mode 100644 index 47a1a0f..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/no-bubbling-test.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Ember from 'ember'; -import { moduleForComponent, test } from 'ember-qunit'; - -moduleForComponent('no-bubbling', 'NoBubblingWidgetComponent', { - unit: true -}); - - -test('External actions', function() { - expect(2); - - var component = this.subject({ - targetObject: { - click: function(data) { - ok(true, 'External click action called'); - equal(data, 'data', 'Data is sent with the action'); - } - }, - click: 'click', - data: 'data' - }); - - var $component = this.$(); - - $component.trigger('click'); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/number-range-widget-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/number-range-widget-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/number-range-widget-test.js deleted file mode 100644 index edc65b1..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/number-range-widget-test.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -/* global moment */ - -import Ember from 'ember'; -import { moduleForComponent, test } from 'ember-qunit'; - -moduleForComponent('number-range-widget', 'NumberRangeWidgetComponent', { - needs: ['component:extended-input'] -}); - - -test('Component is initialized correctly', function() { - expect(2); - - var numberRange = Ember.Object.create({ - max: 1, - min: 0 - }); - - var component = this.subject({ numberRange: numberRange }); - var $component = this.$(); - - equal(component.get('numberRange.from'), numberRange.get('min'), 'from is set to min'); - equal(component.get('numberRange.to'), numberRange.get('max'), 'to is set to max'); - -}); - -test('external change action is called', function() { - expect(1); - - var targetObject = { - rangeChanged: function() { - ok(true, 'rangeChanged external action called'); - } - }; - - var numberRange = Ember.Object.create({ - max: 1, - min: 0 - }); - - var component = this.subject({ - numberRange: numberRange, - targetObject: targetObject, - rangeChanged: 'rangeChanged' - }); - - var $component = this.$(); - - Ember.run(function() { - $component.find('.slider').slider('value', 1); - }); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/popover-widget-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/popover-widget-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/popover-widget-test.js deleted file mode 100644 index 84bec76..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/popover-widget-test.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Ember from 'ember'; -import { moduleForComponent, test } from 'ember-qunit'; - -moduleForComponent('popover-widget', 'PopoverWidgetComponent', { - unit: true -}); - -test('Component initializes correctly', function () { - expect(2); - - var component = this.subject({ - template: Ember.Handlebars.compile("test") - }); - var $component = this.$(); - - ok($component, "Popover element is initialized"); - equal($component.attr('data-content').trim(), "test", "data-content is populated"); -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/e423a65e/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/progress-widget-test.js ---------------------------------------------------------------------- diff --git a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/progress-widget-test.js b/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/progress-widget-test.js deleted file mode 100644 index 3984f62..0000000 --- a/contrib/views/hive/src/main/resources/ui/hive-web/tests/unit/components/progress-widget-test.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * 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. - */ - -import Ember from 'ember'; -import { moduleForComponent, test } from 'ember-qunit'; - -moduleForComponent('progress-widget', 'ProgressWidgetComponent', { - unit: true -}); - -test('Percentage is updated on value change', function() { - var component = this.subject({ - value: 0 - }); - - this.$(); - - equal(component.get('percentage'), '0%', 'Progress is at 0%'); - - Ember.run(function() { - component.set('value', 50); - }); - - equal(component.get('percentage'), '50%', 'Progress is at 50%'); -});