Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

build running again with all tests green

  • Loading branch information...
commit 4b99f24c2c33eb4981800a141e7b8d10126bd979 1 parent 856dc34
Tobias Bosch authored
View
2  jstd-server.sh
@@ -1,2 +1,2 @@
#!/bin/sh
-mvn exec:java -Dexec.classpathScope=test -Dexec.mainClass=com.google.jstestdriver.JsTestDriver -Dexec.args="--port 42442 --runnerMode INFO"
+mvn exec:java -Dexec.classpathScope=test -Dexec.mainClass=com.google.jstestdriver.JsTestDriver -Dexec.args="--port 9876 --runnerMode INFO"
View
8 jstd-ui.conf
@@ -1,7 +1,11 @@
-server: http://localhost:42442
+server: http://localhost:9876
load:
- - target/requirejs/jstd-ui.js
+ - src/main/webapp/lib/jquery-1.6.2.js
+ - src/test/webapp/lib/jasmine.js
+ - src/test/webapp/lib/jasmine-ui.js
+ - src/test/webapp/lib/JasmineAdapter.js
+ - target/requirejs/build/ui-tests.js
proxy:
- {matcher: "/jqmng/*", server: "http://localhost:8080/jqmng/"}
View
10 jstd-unit.conf
@@ -1,6 +1,12 @@
-server: http://localhost:42442
+server: http://localhost:9876
load:
- - target/requirejs/jstd-unit.js
+ - src/main/webapp/lib/jquery-1.6.2.js
+ - src/test/webapp/lib/jquery.mobile.noinit.js
+ - src/main/webapp/lib/angular-0.9.19.js
+ - src/main/webapp/lib/jquery.mobile-1.0b2-oc1.js
+ - src/test/webapp/lib/jasmine.js
+ - src/test/webapp/lib/JasmineAdapter.js
+ - target/requirejs/build/unit-tests.js
View
204 pom.xml
@@ -4,46 +4,84 @@
<artifactId>jquery-mobile-angular-adapter</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>JQuery Mobile Angular Adapter</name>
- <packaging>jar</packaging>
+ <packaging>war</packaging>
<description>Adapter for using jquery mobile with angular</description>
- <properties>
- <browser>/Applications/Google Chrome.app/Contents/MacOS/Google Chrome</browser>
- </properties>
+ <properties>
+ <browser>/Applications/Google Chrome.app/Contents/MacOS/Google Chrome</browser>
+ <!-- Values: uglify, closure, none -->
+ <jsOptimizer>none</jsOptimizer>
+ </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>com.google.jstestdriver</groupId>
- <artifactId>maven-jstestdriver-plugin</artifactId>
- <version>1.3.2.1</version>
+ <build>
+ <finalName>${project.artifactId}</finalName>
+ <plugins>
+ <plugin>
+ <groupId>com.voltvoodoo</groupId>
+ <artifactId>brew</artifactId>
+ <version>0.2.3-SNAPSHOT</version>
<configuration>
- <port>42442</port>
- <runnerMode>INFO</runnerMode>
- <reset>true</reset>
- <browser>${browser}</browser>
- <testOutput>${project.build.directory}/jstd-reports</testOutput>
- <tests>all</tests>
+ <optimizeBuildDir>${basedir}/target/requirejs/build</optimizeBuildDir>
+ <optimizeOutputDir>${basedir}/target/requirejs/optimized</optimizeOutputDir>
+ <optimizedFileNameSuffix></optimizedFileNameSuffix>
+ <providePlugins>false</providePlugins>
</configuration>
<executions>
<execution>
- <id>run-unit-tests</id>
- <phase>test</phase>
+ <id>optimize-main</id>
+ <phase>prepare-package</phase>
<goals>
- <goal>test</goal>
+ <goal>optimize</goal>
</goals>
<configuration>
- <config>jstd-unit.conf</config>
+ <optimizeSourceDir>${basedir}/src/main/webapp</optimizeSourceDir>
+ <jsOptimizer>${jsOptimizer}</jsOptimizer>
+ <modules>
+ <module>
+ <name>jquery-mobile-angular-adapter</name>
+ <include>
+ <entry>lib/simple-require.js</entry>
+ </include>
+ </module>
+ </modules>
+ <wrap>
+ <start>(function() {</start>
+ <end>})();</end>
+ </wrap>
</configuration>
</execution>
+
+ <!-- This second execution relies on the fact that the first execution
+ left the modules of src/main/webapp in the build directory -->
<execution>
- <id>run-integration-tests</id>
- <phase>integration-test</phase>
+ <id>optimize-test</id>
+ <phase>prepare-package</phase>
<goals>
- <goal>test</goal>
+ <goal>optimize</goal>
</goals>
<configuration>
- <config>jstd-ui.conf</config>
+ <optimizeSourceDir>${basedir}/src/test/webapp</optimizeSourceDir>
+ <!--Tests don't need optimization. Furthermore, optimization here would
+ optimize the files from src/main/webapp a second time.-->
+ <jsOptimizer>none</jsOptimizer>
+ <modules>
+ <module>
+ <name>unit-tests</name>
+ <include>
+ <entry>lib/simple-require.js</entry>
+ </include>
+ </module>
+ <module>
+ <name>ui-tests</name>
+ <include>
+ <entry>lib/simple-require.js</entry>
+ </include>
+ </module>
+ </modules>
+ <wrap>
+ <start>window.simplerequire = true;</start>
+ <end>;</end>
+ </wrap>
</configuration>
</execution>
</executions>
@@ -64,31 +102,105 @@
</resourceBases>
</webAppConfig>
</configuration>
- <executions>
- <execution>
- <id>start-jetty</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>run</goal>
- </goals>
- <configuration>
- <scanIntervalSeconds>0</scanIntervalSeconds>
- <daemon>true</daemon>
- </configuration>
- </execution>
- <execution>
- <id>stop-jetty</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- </execution>
- </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.1.1</version>
+ <configuration>
+ <warSourceExcludes>**/*.js,**/*.css
+ </warSourceExcludes>
+ <failOnMissingWebXml>false</failOnMissingWebXml>
+ <webResources>
+ <resource>
+ <directory>target/requirejs/build</directory>
+ </resource>
+ </webResources>
+ </configuration>
</plugin>
</plugins>
-
</build>
+ <profiles>
+ <profile>
+ <!-- Profile for executing the integration tests, e.g. jstestdriver, ... -->
+ <id>integration</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>com.google.jstestdriver</groupId>
+ <artifactId>maven-jstestdriver-plugin</artifactId>
+ <version>1.3.2.2</version>
+ <configuration>
+ <browser>${browser}</browser>
+ <port>9876</port>
+ <reset>true</reset>
+ <runnerMode>INFO</runnerMode>
+ <testOutput>${project.build.directory}/jstd-reports</testOutput>
+ <tests>all</tests>
+ </configuration>
+ <executions>
+ <execution>
+ <id>run-unit-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <config>jstd-unit.conf</config>
+ </configuration>
+ </execution>
+ <execution>
+ <id>run-integration-tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <config>jstd-ui.conf</config>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <configuration>
+ <webAppConfig>
+ <resourceBases>
+ <resourceBase>${basedir}/target/${project.artifactId}</resourceBase>
+ </resourceBases>
+ </webAppConfig>
+ </configuration>
+ <executions>
+ <execution>
+ <id>start-jetty</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <scanIntervalSeconds>0</scanIntervalSeconds>
+ <daemon>true</daemon>
+ </configuration>
+ </execution>
+ <execution>
+ <id>stop-jetty</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ </profile>
+ </profiles>
+
+
<dependencies>
<dependency>
<groupId>com.google.jstestdriver</groupId>
@@ -111,5 +223,5 @@
<name>JsTestDriver Maven Plugin Repository</name>
<url>http://jstd-maven-plugin.googlecode.com/svn/maven2</url>
</pluginRepository>
- </pluginRepositories>
+ </pluginRepositories>
</project>
View
8,599 r.js
0 additions, 8,599 deletions not shown
View
19 src/main/webapp/jqm-angular-global.js
@@ -1,19 +0,0 @@
-/**
- * Module that exposes the services so they can be used without
- * requirejs.
- */
-define([
- 'jqm-angular'
-], function(jqmng) {
- // create global variables
- $.mobile.globalScope = jqmng.globalScope;
-
- // export waitDialog as angular Service
- angular.service('waitdialog', function() {
- return jqmng.waitDialog;
- });
- angular.service('$activePage', function() {
- return jqmng.activePage;
- });
-
-});
View
14 src/main/webapp/jqm-angular.js → ...n/webapp/jquery-mobile-angular-adapter.js
@@ -1,5 +1,7 @@
// Wrapper module as facade for the internal modules.
define([
+ 'angular',
+ 'jquery',
'jqmng/globalScope',
'jqmng/activePage',
'jqmng/waitDialog',
@@ -13,7 +15,17 @@ define([
'jqmng/widgets/angularInput',
'jqmng/widgets/angularSelect',
'jqmng/widgets/angularUl',
-], function(globalScope, activePage, waitDialog) {
+], function(angular, $, globalScope, activePage, waitDialog) {
+ // create global variables
+ $.mobile.globalScope = globalScope.globalScope;
+
+ // export waitDialog as angular Service
+ angular.service('waitdialog', function() {
+ return waitDialog;
+ });
+ angular.service('$activePage', function() {
+ return activePage.activePage;
+ });
return {
globalScope: globalScope.globalScope,
activePage: activePage.activePage,
View
72 src/main/webapp/lib/simple-require.js
@@ -0,0 +1,72 @@
+/**
+ * The MIT License
+ *
+ * Copyright (c) 2011 Tobias Bosch (OPITZ CONSULTING GmbH, www.opitz-consulting.com)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+var require, define;
+(function (window) {
+ var defined = [];
+ define = function(name, deps, value) {
+ var dotJs = name.indexOf('.js');
+ if (dotJs!==-1) {
+ name = name.substring(0, dotJs);
+ }
+ if (arguments.length==2) {
+ // No deps...
+ value = deps;
+ deps = [];
+ }
+ if (typeof value === 'function') {
+ var args = [];
+ for (var i=0; i<deps.length; i++) {
+ var dep = deps[i];
+ args.push(defined[dep]);
+ }
+ value = value.apply(this, args);
+ }
+ defined[name] = value;
+ }
+
+ require = function(deps, callback) {
+ if (typeof callback === 'function') {
+ var args = [];
+ for (var i=0; i<deps.length; i++) {
+ var dep = deps[i];
+ args.push(defined[dep]);
+ }
+ callback.apply(this, args);
+ }
+
+ }
+ // This assignments marks an implementation of require.js
+ define.amd = {};
+
+ require.ready = $;
+
+ /**
+ * If the flag simplerequire is set in the window,
+ * make the require and define functions global.
+ */
+ if (window.simplerequire) {
+ window.require = require;
+ window.define = define;
+ }
+})(window);
View
14 src/test/webapp/UiSpecRunner.html
@@ -3,7 +3,19 @@
<head>
<title>Jasmine Test Runner</title>
<link rel="stylesheet" href="lib/jasmine.css">
- <script src="lib/require.js" data-main="UiSpecRunner.js"></script>
+ <script src="lib/jquery-1.6.2.js"></script>
+ <script src="lib/jasmine.js"></script>
+ <script src="lib/jasmine-ui.js"></script>
+ <script src="lib/jasmine-html.js"></script>
+
+ <script src="lib/require.js" data-main="ui-tests"></script>
+ <script>
+ require.s.contexts._.jQueryCheck();
+ require.ready(function() {
+ jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
+ jasmine.getEnv().execute();
+ });
+ </script>
</head>
<body>
View
12 src/test/webapp/UiSpecRunner.js
@@ -1,12 +0,0 @@
-require([
- 'lib/order!lib/jquery-1.6.2',
- 'lib/order!lib/jasmine.js',
- 'lib/order!lib/jasmine-ui.js',
- 'lib/order!lib/jasmine-html',
- 'lib/order!ui/ui-tests'
-], function() {
- require.ready(function() {
- jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
- jasmine.getEnv().execute();
- });
-});
View
17 src/test/webapp/UnitSpecRunner.html
@@ -2,7 +2,22 @@
<html>
<head>
<link rel="stylesheet" href="lib/jasmine.css">
- <script src="lib/require.js" data-main="UnitSpecRunner.js"></script>
+
+ <script src="lib/jquery-1.6.2.js"></script>
+ <script src="lib/jquery.mobile.noinit.js"></script>
+ <script src="lib/angular-0.9.19.js"></script>
+ <script src="lib/jquery.mobile-1.0b2-oc1.js"></script>
+ <script src="lib/jasmine.js"></script>
+ <script src="lib/jasmine-html.js"></script>
+
+ <script src="lib/require.js" data-main="unit-tests"></script>
+ <script>
+ require.s.contexts._.jQueryCheck();
+ require.ready(function() {
+ jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
+ jasmine.getEnv().execute();
+ });
+ </script>
</head>
<body>
View
15 src/test/webapp/UnitSpecRunner.js
@@ -1,15 +0,0 @@
-require([
- 'lib/order!lib/jquery-1.6.2',
- 'lib/order!lib/jquery.mobile.noinit',
- 'lib/order!lib/angular-0.9.19',
- 'lib/order!lib/jquery.mobile-1.0b2-oc1',
- 'lib/order!jqm-angular-global',
- 'lib/order!lib/jasmine.js',
- 'lib/order!lib/jasmine-html',
- 'lib/order!unit/unit-tests'
-], function() {
- require.ready(function() {
- jasmine.getEnv().addReporter(new jasmine.TrivialReporter());
- jasmine.getEnv().execute();
- });
-});
View
8 src/test/webapp/devSnippetPage.html
@@ -10,7 +10,13 @@
<link rel="stylesheet" href="lib/jquery.mobile-1.0b2-oc1.css"/>
- <script src="lib/require.js" data-main="test-fixture.js"></script>
+ <script src="lib/jquery-1.6.2.js"></script>
+ <script src="lib/angular-0.9.19.js"></script>
+ <script src="lib/jquery.mobile-1.0b2-oc1.js"></script>
+ <script src="lib/require.js" data-main="jquery-mobile-angular-adapter"></script>
+ <script>
+ require.s.contexts._.jQueryCheck();
+ </script>
</head>
<body>
View
7 src/test/webapp/jstd-ui.js
@@ -1,7 +0,0 @@
-require([
- 'lib/order!lib/jquery-1.6.2',
- 'lib/order!lib/jasmine.js',
- 'lib/order!lib/jasmine-ui.js',
- 'lib/order!lib/jasmineAdapter',
- 'lib/order!ui/ui-tests'
-]);
View
10 src/test/webapp/jstd-unit.js
@@ -1,10 +0,0 @@
-require([
- 'lib/order!lib/jquery-1.6.2',
- 'lib/order!lib/jquery.mobile.noinit',
- 'lib/order!lib/angular-0.9.19',
- 'lib/order!lib/jquery.mobile-1.0b2-oc1',
- 'lib/order!jqm-angular-global',
- 'lib/order!lib/jasmine.js',
- 'lib/order!lib/JasmineAdapter',
- 'lib/order!unit/unit-tests'
-]);
View
6 src/test/webapp/test-fixture.js
@@ -1,6 +0,0 @@
-require([
- 'lib/order!lib/jquery-1.6.2',
- 'lib/order!lib/angular-0.9.19',
- 'lib/order!lib/jquery.mobile-1.0b2-oc1',
- 'lib/order!jqm-angular-global'
-]);
View
0  src/test/webapp/ui/ui-tests.js → src/test/webapp/ui-tests.js
File renamed without changes
View
8 src/test/webapp/ui/test-fixture.html
@@ -5,7 +5,13 @@
<script>opener && opener.instrument && opener.instrument(window);</script>
<link rel="stylesheet" href="../lib/jquery.mobile-1.0b2-oc1.css"/>
- <script src="../lib/require.js" data-main="../test-fixture.js"></script>
+ <script src="../lib/jquery-1.6.2.js"></script>
+ <script src="../lib/angular-0.9.19.js"></script>
+ <script src="../lib/jquery.mobile-1.0b2-oc1.js"></script>
+ <script src="../lib/require.js" data-main="../jquery-mobile-angular-adapter"></script>
+ <script>
+ require.s.contexts._.jQueryCheck();
+ </script>
</head>
<body>
View
1  src/test/webapp/unit/unit-tests.js → src/test/webapp/unit-tests.js
@@ -1,4 +1,5 @@
define([
+ 'jquery-mobile-angular-adapter',
'unit/arrayPagingSpec',
'unit/iffSpec',
'unit/ifSpec'
Please sign in to comment.
Something went wrong with that request. Please try again.