Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8D0F4200B40 for ; Fri, 1 Jul 2016 09:17:55 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8BC0A160A61; Fri, 1 Jul 2016 07:17:55 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5ED49160A7A for ; Fri, 1 Jul 2016 09:17:52 +0200 (CEST) Received: (qmail 38988 invoked by uid 500); 1 Jul 2016 07:17:51 -0000 Mailing-List: contact commits-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list commits@ignite.apache.org Received: (qmail 37092 invoked by uid 99); 1 Jul 2016 07:17:49 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jul 2016 07:17:49 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B3F62E947E; Fri, 1 Jul 2016 07:17:49 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: anovikov@apache.org To: commits@ignite.apache.org Date: Fri, 01 Jul 2016 07:18:37 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [50/51] [abbrv] ignite git commit: IGNITE-3262 Review. archived-at: Fri, 01 Jul 2016 07:17:55 -0000 IGNITE-3262 Review. Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/63c8c8d0 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/63c8c8d0 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/63c8c8d0 Branch: refs/heads/ignite-3262 Commit: 63c8c8d00a6cf8b3ecfa3ae8b9068753673512e8 Parents: a48f8f2 Author: Andrey Novikov Authored: Fri Jul 1 12:50:24 2016 +0700 Committer: Andrey Novikov Committed: Fri Jul 1 12:50:24 2016 +0700 ---------------------------------------------------------------------- .../src/main/js/app/data/java-classes.json | 1 + modules/web-console/src/main/js/karma.conf.js | 172 ++++++++++--------- .../web-console/src/main/js/test/e2e/test.js | 15 -- .../src/main/js/test/frontend/e2e/d.test.js | 40 +++++ .../js/test/frontend/unit/JavaTypes.test.js | 69 ++++++++ .../main/js/test/frontend/unit/UserAuth.test.js | 35 ++++ .../src/main/js/test/unit/JavaTypes.test.js | 66 ------- .../src/main/js/test/unit/UserAuth.test.js | 27 --- 8 files changed, 234 insertions(+), 191 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/63c8c8d0/modules/web-console/src/main/js/app/data/java-classes.json ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/app/data/java-classes.json b/modules/web-console/src/main/js/app/data/java-classes.json index e2cdff9..6bda104 100644 --- a/modules/web-console/src/main/js/app/data/java-classes.json +++ b/modules/web-console/src/main/js/app/data/java-classes.json @@ -4,6 +4,7 @@ {"short": "Byte", "full": "java.lang.Byte"}, {"short": "Character", "full": "java.lang.Character"}, {"short": "Date", "full": "java.sql.Date"}, + {"short": "Date", "full": "java.util.Date"}, {"short": "Double", "full": "java.lang.Double"}, {"short": "Float", "full": "java.lang.Float"}, {"short": "Integer", "full": "java.lang.Integer"}, http://git-wip-us.apache.org/repos/asf/ignite/blob/63c8c8d0/modules/web-console/src/main/js/karma.conf.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/karma.conf.js b/modules/web-console/src/main/js/karma.conf.js index 4a48e98..f58e38b 100644 --- a/modules/web-console/src/main/js/karma.conf.js +++ b/modules/web-console/src/main/js/karma.conf.js @@ -15,93 +15,99 @@ * limitations under the License. */ -var path = require('path'); -var webpack = require('webpack'); +const path = require('path'); +const webpack = require('webpack'); -var basePath = path.resolve('./'); +const basePath = path.resolve('./'); module.exports = function(config) { - config.set({ - // Base path that will be used to resolve all patterns (eg. files, exclude). - basePath: basePath, - - // Frameworks to use available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ['mocha'], - - // List of files / patterns to load in the browser. - files: [ - 'test/**/*.test.js' - ], - - plugins: [ - require('karma-phantomjs-launcher'), - require('karma-teamcity-reporter'), - require('karma-webpack'), - require('karma-mocha') - ], - - // Preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor. - preprocessors: { - 'test/**/*.js': ['webpack'] - }, - - webpack: { - module: { - loaders: [ - { - test: /\.json$/, - loader: 'json' - }, - { - test: /\.js$/, - loader: 'babel', - exclude: /node_modules/ - } + config.set({ + // Base path that will be used to resolve all patterns (eg. files, exclude). + basePath: basePath, + + // Frameworks to use available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ['mocha'], + + // List of files / patterns to load in the browser. + files: [ + 'test/frontend/**/*.test.js' + ], + + plugins: [ + require('karma-phantomjs-launcher'), + require('karma-teamcity-reporter'), + require('karma-webpack'), + require('karma-mocha') + ], + + // Preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor. + preprocessors: { + 'test/frontend/**/*.js': ['webpack'] + }, + + webpack: { + module: { + loaders: [ + { + test: /\.json$/, + loader: 'json' + }, + { + test: /\.js$/, + loader: 'babel', + exclude: /node_modules/ + } + ] + }, + resolve: { + extensions: ["", ".js"] + }, + plugins: [ + new webpack.ProvidePlugin({ + _: 'lodash' + }) ] }, - resolve: { - extensions: ["", ".js"] + + webpackMiddleware: { + noInfo: true }, - plugins: [ - new webpack.ProvidePlugin({ - _: 'lodash' - }) - ] - }, - - webpackMiddleware: { - noInfo: true - }, - - // Test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter. - reporters: ['teamcity'], - - // web server port - port: 9876, - - // enable / disable colors in the output (reporters and logs) - colors: true, - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: true, - - // start these browsers - // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher - browsers: ['PhantomJS'], - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: true, - - // Concurrency level - // how many browser should be started simultaneous - concurrency: Infinity - }); + + // Test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter. + reporters: ['teamcity'], + + // web server port + port: 9876, + + // enable / disable colors in the output (reporters and logs) + colors: true, + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: true, + + // start these browsers + // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher + browsers: ['PhantomJS'], + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: true, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: Infinity, + + client: { + mocha: { + ui: 'tdd' + } + } + }); }; http://git-wip-us.apache.org/repos/asf/ignite/blob/63c8c8d0/modules/web-console/src/main/js/test/e2e/test.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/test/e2e/test.js b/modules/web-console/src/main/js/test/e2e/test.js deleted file mode 100644 index 4626df7..0000000 --- a/modules/web-console/src/main/js/test/e2e/test.js +++ /dev/null @@ -1,15 +0,0 @@ -describe('test', function () { - beforeEach(function() { - browser.get('http://localhost:9000/'); - }); - - it('initially has a greeting', function () { - // element(by.model('ui.email')).sendKeys('jhon@doe.com'); - }); - it('initially has a greeting', function () { - // element(by.model('ui.email')).sendKeys('jhon@doe.com'); - }); - it('initially has a greeting', function () { - // element(by.model('ui.email')).sendKeys('jhon@doe.com'); - }); -}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/63c8c8d0/modules/web-console/src/main/js/test/frontend/e2e/d.test.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/test/frontend/e2e/d.test.js b/modules/web-console/src/main/js/test/frontend/e2e/d.test.js new file mode 100644 index 0000000..8088b16 --- /dev/null +++ b/modules/web-console/src/main/js/test/frontend/e2e/d.test.js @@ -0,0 +1,40 @@ +/* + * 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. + */ + +suite('test', () => { + setup(() => { + // browser.get('http://localhost:9000/'); + }); + + test('initially has a greeting', (done) => { + done(); + + // element(by.model('ui.email')).sendKeys('jhon@doe.com'); + }); + + test('initially has a greeting', (done) => { + done(); + + // element(by.model('ui.email')).sendKeys('jhon@doe.com'); + }); + + test('initially has a greeting', (done) => { + done(); + + // element(by.model('ui.email')).sendKeys('jhon@doe.com'); + }); +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ignite/blob/63c8c8d0/modules/web-console/src/main/js/test/frontend/unit/JavaTypes.test.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/test/frontend/unit/JavaTypes.test.js b/modules/web-console/src/main/js/test/frontend/unit/JavaTypes.test.js new file mode 100644 index 0000000..b82550f --- /dev/null +++ b/modules/web-console/src/main/js/test/frontend/unit/JavaTypes.test.js @@ -0,0 +1,69 @@ +/* + * 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 JavaTypes from '../../../app/services/JavaTypes.service.js'; + +import { assert } from 'chai'; + +const { nonBuiltInClass, fullClassName, validIdentifier, validPackage, packageSpecified, isKeywords, isJavaPrimitive} = JavaTypes[1](); + +suite('JavaTypesTestsSuite', () => { + test('nonBuiltInClass', () => { + assert.equal(nonBuiltInClass('BigDecimal'), false); + assert.equal(nonBuiltInClass('java.math.BigDecimal'), false); + + assert.equal(nonBuiltInClass('String'), false); + assert.equal(nonBuiltInClass('java.lang.String'), false); + + assert.equal(nonBuiltInClass('Timestamp'), false); + assert.equal(nonBuiltInClass('java.sql.Timestamp'), false); + + assert.equal(nonBuiltInClass('Date'), false); + assert.equal(nonBuiltInClass('java.sql.Date'), false); + + assert.equal(nonBuiltInClass('Date'), false); + assert.equal(nonBuiltInClass('java.util.Date'), false); + + assert.equal(nonBuiltInClass('CustomClass'), true); + assert.equal(nonBuiltInClass('java.util.CustomClass'), true); + assert.equal(nonBuiltInClass('my.package.CustomClass'), true); + }); + + test('fullClassName', () => { + assert.equal(fullClassName('BigDecimal'), 'java.math.BigDecimal'); + }); + + test('validIdentifier', () => { + assert.equal(validIdentifier('java.math.BigDecimal'), true); + }); + + test('validPackage', () => { + assert.equal(validPackage('java.math.BigDecimal'), true); + }); + + test('packageSpecified', () => { + assert.equal(packageSpecified('java.math.BigDecimal'), true); + }); + + test('isKeywords', () => { + assert.equal(isKeywords('abstract'), true); + }); + + test('isJavaPrimitive', () => { + assert.equal(isJavaPrimitive('boolean'), true); + }); +}); http://git-wip-us.apache.org/repos/asf/ignite/blob/63c8c8d0/modules/web-console/src/main/js/test/frontend/unit/UserAuth.test.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/test/frontend/unit/UserAuth.test.js b/modules/web-console/src/main/js/test/frontend/unit/UserAuth.test.js new file mode 100644 index 0000000..12f1248 --- /dev/null +++ b/modules/web-console/src/main/js/test/frontend/unit/UserAuth.test.js @@ -0,0 +1,35 @@ +/* + * 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 AuthService from '../../../app/modules/user/Auth.service'; + +suite('AuthServiceTestsSuite', () => { + test('SignIn', (done) => { + // TODO IGNITE-3262 Add test. + done(); + }); + + test('SignUp', (done) => { + // TODO IGNITE-3262 Add test. + done(); + }); + + test('Logout', (done) => { + // TODO IGNITE-3262 Add test. + done(); + }); +}); http://git-wip-us.apache.org/repos/asf/ignite/blob/63c8c8d0/modules/web-console/src/main/js/test/unit/JavaTypes.test.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/test/unit/JavaTypes.test.js b/modules/web-console/src/main/js/test/unit/JavaTypes.test.js deleted file mode 100644 index ebb0560..0000000 --- a/modules/web-console/src/main/js/test/unit/JavaTypes.test.js +++ /dev/null @@ -1,66 +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 JavaTypes from '../../app/services/JavaTypes.service.js'; - -import { assert } from 'chai'; - -const { nonBuiltInClass, fullClassName, validIdentifier, validPackage, packageSpecified, isKeywords, isJavaPrimitive} = JavaTypes[1](); - -describe('JavaTypesTestsSuite', () => { - describe('nonBuiltInClass', () => { - it('BigDecimal', () => { - assert.equal(nonBuiltInClass('BigDecimal'), false); - }); - }); - - describe('fullClassName', () => { - it('java.math.BigDecimal', () => { - assert.equal(fullClassName('BigDecimal'), 'java.math.BigDecimal'); - }); - }); - - describe('validIdentifier', () => { - it('java.math.BigDecimal', () => { - assert.equal(validIdentifier('java.math.BigDecimal'), true); - }); - }); - - describe('validPackage', () => { - it('java.math.BigDecimal.', () => { - assert.equal(validPackage('java.math.BigDecimal'), true); - }); - }); - - describe('packageSpecified', () => { - it('java.math.BigDecimal.', () => { - assert.equal(packageSpecified('java.math.BigDecimal'), true); - }); - }); - - describe('isKeywords', () => { - it('java.math.BigDecimal.', () => { - assert.equal(isKeywords('abstract'), true); - }); - }); - - describe('isJavaPrimitive', () => { - it('boolean', () => { - assert.equal(isJavaPrimitive('boolean'), true); - }); - }); -}); http://git-wip-us.apache.org/repos/asf/ignite/blob/63c8c8d0/modules/web-console/src/main/js/test/unit/UserAuth.test.js ---------------------------------------------------------------------- diff --git a/modules/web-console/src/main/js/test/unit/UserAuth.test.js b/modules/web-console/src/main/js/test/unit/UserAuth.test.js deleted file mode 100644 index 88d564e..0000000 --- a/modules/web-console/src/main/js/test/unit/UserAuth.test.js +++ /dev/null @@ -1,27 +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 AuthService from '../../app/modules/user/Auth.service' - -describe('Auth Service Test', () => { - describe('Test authorization', () => { - it('User Auth', () => { - throw new Error('User Auth error') - }) - }); - -});