You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2014/06/27 16:57:12 UTC
git commit: WICKET-5632 Use frontend-maven-plugin to run the
JavaScript tests
Repository: wicket
Updated Branches:
refs/heads/wicket-6.x dafb522f9 -> b5ba97e7e
WICKET-5632 Use frontend-maven-plugin to run the JavaScript tests
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/b5ba97e7
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/b5ba97e7
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/b5ba97e7
Branch: refs/heads/wicket-6.x
Commit: b5ba97e7effd0b6897f6243a37da975919ae449c
Parents: dafb522
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Fri Jun 27 17:55:43 2014 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Fri Jun 27 17:55:43 2014 +0300
----------------------------------------------------------------------
Gruntfile.js | 138 ------------------------------
package.json | 15 ----
pom.xml | 1 +
testing/wicket-js-tests/Gruntfile.js | 138 ++++++++++++++++++++++++++++++
testing/wicket-js-tests/package.json | 15 ++++
testing/wicket-js-tests/pom.xml | 87 +++++++++++++++++++
6 files changed, 241 insertions(+), 153 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/b5ba97e7/Gruntfile.js
----------------------------------------------------------------------
diff --git a/Gruntfile.js b/Gruntfile.js
deleted file mode 100644
index 268389a..0000000
--- a/Gruntfile.js
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Grunt.js is a tool for automated JavaScript development
- * https://github.com/cowboy/grunt
- *
- * To use it:
- * 1) install node.js - http://nodejs.org/#download. This will install 'npm' (Node Package Manager) too
- * 2) install grunt - 'npm -g install grunt-cli'
- * 3) run: npm install (This will use package.json and install all dependencies)
- * 4.1) grunt jshint - checks all JavaScript files with JSHint
- * 4.2) grunt jshint:core - checks only the files in wicket-core
- * 4.3) grunt test - starts a web server and runs all tests (Ajax, non-Ajax and AMD)
- */
-
- /*global module: true */
-
-module.exports = function(grunt) {
- "use strict";
-
- var
- coreJs = [
- 'wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-event-jquery.js',
- 'wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery-debug.js',
- 'wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js',
- "wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckSelector.js",
- "wicket-core/src/main/java/org/apache/wicket/markup/html/form/upload/MultiFileUploadField.js",
- "wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormChoiceComponentUpdatingBehavior.js",
- "wicket-core/src/main/java/org/apache/wicket/markup/html/pages/wicket-browser-info.js"
- ],
- extensionsJs = [
- "wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js",
- "wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/palette/palette.js",
- "wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tree/res/tree.js",
- "wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js",
- "wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js",
- "wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/filter/wicket-filterform.js"
- ],
- datetimeJs = [
- "wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/wicket-date.js"
- ],
- nativeWebSocketJs = [
- "wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/res/js/wicket-websocket-jquery.js"
- ],
- atmosphereJs = [
- "wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/jquery.wicketatmosphere.js"
- ],
- testsJs = [
- "./wicket-core/src/test/js/ajax.js",
- "./wicket-core/src/test/js/head.js",
- "./wicket-core/src/test/js/form.js",
- "./wicket-core/src/test/js/dom.js",
- "./wicket-core/src/test/js/channels.js",
- "./wicket-core/src/test/js/event.js",
- "./wicket-core/src/test/js/timer.js",
- "./wicket-core/src/test/js/amd.js"
- ],
- gruntJs = [
- "Gruntfile.js"
- ];
-
- // Project configuration.
- grunt.initConfig({
- pkg: grunt.file.readJSON('package.json'),
-
- jshint: {
- core: coreJs,
- extensions: extensionsJs,
- datetime: datetimeJs,
- nativeWebSocket: nativeWebSocketJs,
- atmosphere: atmosphereJs,
- testsJs: testsJs,
- grunt: gruntJs,
-
- options: {
- "boss": true,
- "browser": true,
- "curly": true,
- "eqnull": true,
- "eqeqeq": true,
- "expr": true,
- "evil": true,
- "jquery": true,
- "latedef": true,
- "noarg": true,
- "onevar": false,
- "smarttabs": true,
- "trailing": true,
- "undef": true,
- "strict": true,
- "predef": [
- "Wicket"
- ]
- }
- },
-
- qunit: {
- /*
- * Runs all tests (w/ ajax).
- * See ajax.js header for details how to setup it.
- */
- all: {
- options: {
- urls: ['http://localhost:38888/test/js/all.html']
- }
- },
-
- /**
- * Run Asynchronous module definition tests
- */
- amd: {
- options: {
- urls: ['http://localhost:38888/test/js/amd.html']
- }
- },
-
- /*
- * Runs only local tests (w/o ajax ones).
- */
- local: ['wicket-core/src/test/js/all.html']
- },
-
- connect: {
- server: {
- options: {
- port: 38888,
- base: './wicket-core/src'
- }
- }
- }
- });
-
- grunt.loadNpmTasks('grunt-contrib-qunit');
- grunt.loadNpmTasks('grunt-contrib-jshint');
-
- // This plugin provides the "connect" task - starts a web server for the Ajax tests.
- grunt.loadNpmTasks('grunt-contrib-connect');
-
- grunt.registerTask('default', ['jshint', 'connect', 'qunit']);
-};
http://git-wip-us.apache.org/repos/asf/wicket/blob/b5ba97e7/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
deleted file mode 100644
index 0d9c00d..0000000
--- a/package.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "name": "wicket-js-unit-tests",
- "version": "0.1.0",
- "devDependencies": {
- "grunt": "~0.4.5",
- "grunt-cli": "~0.1.13",
- "grunt-contrib-jshint": "~0.10.0",
- "grunt-contrib-qunit": "~0.5.1",
- "grunt-contrib-connect": "~0.8.0",
- "grunt-contrib-nodeunit": "~0.4.1"
- },
- "scripts": {
- "test": "grunt --verbose"
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/wicket/blob/b5ba97e7/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 99ed73e..ce82aa1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,6 +55,7 @@
<module>wicket-experimental</module>
<module>archetypes/quickstart</module>
<module>testing/wicket-common-tests</module>
+ <module>testing/wicket-js-tests</module>
<module>wicket-native-websocket</module>
<module>wicket-bean-validation</module>
<module>wicket-cdi-1.1</module>
http://git-wip-us.apache.org/repos/asf/wicket/blob/b5ba97e7/testing/wicket-js-tests/Gruntfile.js
----------------------------------------------------------------------
diff --git a/testing/wicket-js-tests/Gruntfile.js b/testing/wicket-js-tests/Gruntfile.js
new file mode 100644
index 0000000..b05d30a
--- /dev/null
+++ b/testing/wicket-js-tests/Gruntfile.js
@@ -0,0 +1,138 @@
+/*
+ * Grunt.js is a tool for automated JavaScript development
+ * https://github.com/cowboy/grunt
+ *
+ * To use it:
+ * 1) install node.js - http://nodejs.org/#download. This will install 'npm' (Node Package Manager) too
+ * 2) install grunt - 'npm -g install grunt-cli'
+ * 3) run: npm install (This will use package.json and install all dependencies)
+ * 4.1) grunt jshint - checks all JavaScript files with JSHint
+ * 4.2) grunt jshint:core - checks only the files in wicket-core
+ * 4.3) grunt test - starts a web server and runs all tests (Ajax, non-Ajax and AMD)
+ */
+
+ /*global module: true */
+
+module.exports = function(grunt) {
+ "use strict";
+
+ var
+ coreJs = [
+ '../../wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-event-jquery.js',
+ '../../wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery-debug.js',
+ '../../wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js',
+ "../../wicket-core/src/main/java/org/apache/wicket/markup/html/form/CheckSelector.js",
+ "../../wicket-core/src/main/java/org/apache/wicket/markup/html/form/upload/MultiFileUploadField.js",
+ "../../wicket-core/src/main/java/org/apache/wicket/ajax/form/AjaxFormChoiceComponentUpdatingBehavior.js",
+ "../../wicket-core/src/main/java/org/apache/wicket/markup/html/pages/wicket-browser-info.js"
+ ],
+ extensionsJs = [
+ "../../wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/form/upload/progressbar.js",
+ "../../wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/form/palette/palette.js",
+ "../../wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/tree/res/tree.js",
+ "../../wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/autocomplete/wicket-autocomplete.js",
+ "../../wicket-extensions/src/main/java/org/apache/wicket/extensions/ajax/markup/html/modal/res/modal.js",
+ "../../wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/filter/wicket-filterform.js"
+ ],
+ datetimeJs = [
+ "../../wicket-datetime/src/main/java/org/apache/wicket/extensions/yui/calendar/wicket-date.js"
+ ],
+ nativeWebSocketJs = [
+ "../../wicket-native-websocket/wicket-native-websocket-core/src/main/java/org/apache/wicket/protocol/ws/api/res/js/wicket-websocket-jquery.js"
+ ],
+ atmosphereJs = [
+ "../../wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/jquery.wicketatmosphere.js"
+ ],
+ testsJs = [
+ "../../wicket-core/src/test/js/ajax.js",
+ "../../wicket-core/src/test/js/head.js",
+ "../../wicket-core/src/test/js/form.js",
+ "../../wicket-core/src/test/js/dom.js",
+ "../../wicket-core/src/test/js/channels.js",
+ "../../wicket-core/src/test/js/event.js",
+ "../../wicket-core/src/test/js/timer.js",
+ "../../wicket-core/src/test/js/amd.js"
+ ],
+ gruntJs = [
+ "Gruntfile.js"
+ ];
+
+ // Project configuration.
+ grunt.initConfig({
+ pkg: grunt.file.readJSON('package.json'),
+
+ jshint: {
+ core: coreJs,
+ extensions: extensionsJs,
+ datetime: datetimeJs,
+ nativeWebSocket: nativeWebSocketJs,
+ atmosphere: atmosphereJs,
+ testsJs: testsJs,
+ grunt: gruntJs,
+
+ options: {
+ "boss": true,
+ "browser": true,
+ "curly": true,
+ "eqnull": true,
+ "eqeqeq": true,
+ "expr": true,
+ "evil": true,
+ "jquery": true,
+ "latedef": true,
+ "noarg": true,
+ "onevar": false,
+ "smarttabs": true,
+ "trailing": true,
+ "undef": true,
+ "strict": true,
+ "predef": [
+ "Wicket"
+ ]
+ }
+ },
+
+ qunit: {
+ /*
+ * Runs all tests (w/ ajax).
+ * See ajax.js header for details how to setup it.
+ */
+ all: {
+ options: {
+ urls: ['http://localhost:38888/test/js/all.html']
+ }
+ },
+
+ /**
+ * Run Asynchronous module definition tests
+ */
+ amd: {
+ options: {
+ urls: ['http://localhost:38888/test/js/amd.html']
+ }
+ },
+
+ /*
+ * Runs only local tests (w/o ajax ones).
+ */
+ local: ['../../wicket-core/src/test/js/all.html']
+ },
+
+ connect: {
+ server: {
+ options: {
+ port: 38888,
+ base: '../../wicket-core/src'
+ }
+ }
+ }
+ });
+
+ grunt.loadNpmTasks('grunt-contrib-qunit');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+
+ // This plugin provides the "connect" task - starts a web server for the Ajax tests.
+ grunt.loadNpmTasks('grunt-contrib-connect');
+
+ grunt.registerTask('default', ['jshint', 'connect', 'qunit']);
+};
http://git-wip-us.apache.org/repos/asf/wicket/blob/b5ba97e7/testing/wicket-js-tests/package.json
----------------------------------------------------------------------
diff --git a/testing/wicket-js-tests/package.json b/testing/wicket-js-tests/package.json
new file mode 100644
index 0000000..0d9c00d
--- /dev/null
+++ b/testing/wicket-js-tests/package.json
@@ -0,0 +1,15 @@
+{
+ "name": "wicket-js-unit-tests",
+ "version": "0.1.0",
+ "devDependencies": {
+ "grunt": "~0.4.5",
+ "grunt-cli": "~0.1.13",
+ "grunt-contrib-jshint": "~0.10.0",
+ "grunt-contrib-qunit": "~0.5.1",
+ "grunt-contrib-connect": "~0.8.0",
+ "grunt-contrib-nodeunit": "~0.4.1"
+ },
+ "scripts": {
+ "test": "grunt --verbose"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/wicket/blob/b5ba97e7/testing/wicket-js-tests/pom.xml
----------------------------------------------------------------------
diff --git a/testing/wicket-js-tests/pom.xml b/testing/wicket-js-tests/pom.xml
new file mode 100644
index 0000000..aad7293
--- /dev/null
+++ b/testing/wicket-js-tests/pom.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.wicket</groupId>
+ <artifactId>wicket-parent</artifactId>
+ <version>6.17.0-SNAPSHOT</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+ <artifactId>wicket-js-tests</artifactId>
+ <packaging>jar</packaging>
+ <name>Wicket JavaScript Tests</name>
+ <description>JavaScript tests for all Wicket modules</description>
+ <profiles>
+ <profile>
+ <id>js-test</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.github.eirslett</groupId>
+ <artifactId>frontend-maven-plugin</artifactId>
+ <version>0.0.15</version>
+ <executions>
+ <execution>
+ <id>install node and npm</id>
+ <goals>
+ <goal>install-node-and-npm</goal>
+ </goals>
+ <phase>generate-resources</phase>
+ <configuration>
+ <npmVersion>1.4.12</npmVersion>
+ <nodeVersion>v0.10.29</nodeVersion>
+ </configuration>
+ </execution>
+ <execution>
+ <id>npm install</id>
+ <goals>
+ <goal>npm</goal>
+ </goals>
+ <configuration>
+ <arguments>install</arguments>
+ </configuration>
+ </execution>
+ <execution>
+ <id>grunt build</id>
+ <goals>
+ <goal>grunt</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <!-- Just tests. No need to deploy -->
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>