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 2012/01/01 15:56:24 UTC

[1/3] git commit: WICKET-3367 Rewrite all JavaScript inline event handlers to be proper attached event handlers

Updated Branches:
  refs/heads/master 5a45e8c77 -> b9c828842


WICKET-3367
Rewrite all JavaScript inline event handlers to be proper attached event handlers

Rework Ajax tests to test the new Wicket.Ajax.Call.doAjax() method.
These tests work only when run with Web Server with mock responses. See ajax.js header for Apache2 configuration


Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/b9c82884
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/b9c82884
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/b9c82884

Branch: refs/heads/master
Commit: b9c8288421c1894f20d49b9be491526e126737a9
Parents: c14684f
Author: martin-g <mg...@apache.org>
Authored: Sun Jan 1 16:55:18 2012 +0200
Committer: martin-g <mg...@apache.org>
Committed: Sun Jan 1 16:55:18 2012 +0200

----------------------------------------------------------------------
 .../wicket/ajax/res/js/wicket-ajax-jquery.js       |  137 ++++-----
 wicket-core/src/test/js/ajax.js                    |  236 ++++++++-------
 wicket-core/src/test/js/all.html                   |    9 +-
 .../src/test/js/data/ajax/complexComponentId.xml   |   29 ++
 .../test/js/data/ajax/componentDoesNotExistsId.xml |    1 +
 wicket-core/src/test/js/data/ajax/componentId.xml  |    1 +
 .../test/js/data/ajax/componentToReplaceTitle.xml  |    1 +
 wicket-core/src/test/js/data/ajax/evaluationId.xml |    1 +
 .../js/data/ajax/evaluationIdentifierAndCodeId.xml |    1 +
 .../src/test/js/data/ajax/priorityEvaluationId.xml |    1 +
 10 files changed, 232 insertions(+), 185 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/b9c82884/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
index 672b54b..c528c6f 100644
--- a/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
+++ b/wicket-core/src/main/java/org/apache/wicket/ajax/res/js/wicket-ajax-jquery.js
@@ -312,20 +312,6 @@
 
 		initialize: jQuery.noop,
 
-		// On ajax request failure
-		failure: function (message) {
-			if (message !== null) {
-				Wicket.Log.error("Wicket.Ajax.Call.failure: Error while parsing response: " + message);
-			}
-			this.failureHandler();
-			Wicket.Ajax.invokePostCallHandlers();
-			Wicket.Ajax.invokeFailureHandlers();
-		},
-
-		done: function (channel) {
-			Wicket.channelManager.done(channel);
-		},
-
 		_normalizeAttributes: function (attrs) {
 
 			// (ajax channel)
@@ -345,6 +331,27 @@
 		},
 
 		/**
+		 * A helper function that executes an array of handlers (before, success, failure)
+		 * @param {Array} handlers - the handlers to execute
+		 */
+		_executeHandlers: function (handlers) {
+			if (jQuery.isArray(handlers)) {
+
+				// cut the handlers argument
+				var args = Array.prototype.slice.call(arguments).slice(1);
+
+				for (var i = 0; i < handlers.length; i++) {
+					var handler = handlers[i];
+					if (jQuery.isFunction(handler)) {
+						handler.apply(this, args);
+					} else {
+						new Function(handler).apply(this, args);
+					}
+				}
+			}
+		},
+
+		/**
 		 * Executes or schedules for execution #doAjax()
 		 *
 		 * @param {Object} attrs - the Ajax request attributes configured at the server side
@@ -378,28 +385,6 @@
 				// keep a reference to the current context
 				self = this,
 
-				/**
-				 * A helper function that executes an array of handlers (before, success, failure)
-				 * @param {Array} handlers - the handlers to execute
-				 * @param {Object} context - the context to use while executing a handler
-				 */
-				executeHandlers = function (handlers, context) {
-					if (jQuery.isArray(handlers)) {
-
-						// cut the handlers argument
-						var args = Array.prototype.slice.call(arguments).slice(1);
-
-						for (var i = 0; i < handlers.length; i++) {
-							var handler = handlers[i];
-							if (jQuery.isFunction(handler)) {
-								handler.apply(this, args);
-							} else {
-								new Function(handler).apply(this, args);
-							}
-						}
-					}
-				},
-
 				// the precondition to use if there are no explicit ones
 				defaultPrecondition = [ function () {
 					if (attrs.c) {
@@ -482,7 +467,7 @@
 						}
 					}
 
-					executeHandlers(attrs.bh);
+					self._executeHandlers(attrs.bh);
 
 					if (attrs.i) {
 						// show the indicator
@@ -497,15 +482,13 @@
 				success: function(data, textStatus, jqXHR) {
 
 					if (attrs.wr) {
-						self.stateChangeCallback(data, textStatus, jqXHR, attrs);
+						self.processAjaxResponse(data, textStatus, jqXHR, attrs);
 					}
 
-					executeHandlers(attrs.sh, data, textStatus, jqXHR);
-
 				},
 				error: function(jqXHR, textStatus, errorThrown) {
 
-					executeHandlers(attrs.fh, jqXHR, textStatus, errorThrown);
+					self.failure(errorThrown, attrs);
 
 				},
 				complete: function (jqXHR, textStatus) {
@@ -514,7 +497,7 @@
 					}
 
 					this.done(attrs.ch);
-				}				
+				}
 			});
 
 			var allowDefault = attrs.ad || false; 
@@ -526,20 +509,13 @@
 			return allowDefault;
 		},
 
-		// Method that processes the request states
-		stateChangeCallback: function (data, textStatus, jqXHR, attrs) {
-			var status,
-				responseAsText,
-				redirectUrl,
-				urlDepth,
-				calculatedRedirect;
+		// Method that processes the <ajax-response>
+		processAjaxResponse: function (data, textStatus, jqXHR, attrs) {
 
 			if (jqXHR.readyState === 4) {
 
-				// response came without error
-				responseAsText = jqXHR.responseText;
-
 				// first try to get the redirect header
+				var redirectUrl;
 				try {
 					redirectUrl = jqXHR.getResponseHeader('Ajax-Location');
 				} catch (ignore) { // might happen in older mozilla
@@ -557,13 +533,13 @@
 						window.location = redirectUrl;
 					}
 					else {
-						urlDepth = 0;
+						var urlDepth = 0;
 						while (redirectUrl.substring(0, 3) === "../") {
 							urlDepth++;
 							redirectUrl = redirectUrl.substring(3);
 						}
 						// Make this a string.
-						calculatedRedirect = window.location.pathname;
+						var calculatedRedirect = window.location.pathname;
 						while (urlDepth > -1) {
 							urlDepth--;
 							var i = calculatedRedirect.lastIndexOf("/");
@@ -583,20 +559,12 @@
 				}
 				else {
 					// no redirect, just regular response
+					var responseAsText = jQuery(data).text();
 					Wicket.Log.info("Received ajax response (" + responseAsText.length + " characters)");
-					if (this.debugContent) {
-						Wicket.Log.info("\n" + responseAsText);
-					}
+					Wicket.Log.info("\n" + responseAsText);
 
-					var xmldoc;
-					if (typeof(window.XMLHttpRequest) !== "undefined" && typeof(DOMParser) !== "undefined") {
-						var parser = new DOMParser();
-						xmldoc = parser.parseFromString(responseAsText, "text/xml");
-					} else if (window.ActiveXObject) {
-						xmldoc = jqXHR.responseXML;
-					}
 					// invoke the loaded callback with an xml document
-					this.loadedCallback(xmldoc, attrs);
+					return this.loadedCallback(data, attrs);
 				}
 			}
 		},
@@ -738,7 +706,7 @@
 				for (var i = 0; i < root.childNodes.length; ++i) {
 					var node = root.childNodes[i];
 					if (node.tagName === "priority-evaluate") {
-						this.processEvaluation(steps, node);
+						this.processEvaluation(steps, node, attrs);
 					}
 				}
 
@@ -768,20 +736,23 @@
 				}
 
 				// add the last step, which should trigger the success call the done method on request
-				this.success(steps);
+				this.success(steps, attrs);
 
 				Wicket.Log.info("Response parsed. Now invoking steps...");
 				var executer = new FunctionsExecuter(steps);
 				executer.start();
-			} catch (e) {
-				this.failure(e.message);
+			} catch (exception) {
+				this.failure(exception, attrs);
 			}
 		},
 
 		// Adds a closure to steps that should be invoked after all other steps have been successfully executed
-		success: function (steps) {
+		success: function (steps, attrs) {
 			steps.push(jQuery.proxy(function (notify) {
 				Wicket.Log.info("Response processed successfully.");
+
+				this._executeHandlers(attrs.sh);
+
 				Wicket.Ajax.invokePostCallHandlers();
 				// retach the events to the new components (a bit blunt method...)
 				// This should be changed for IE See comments in wicket-event.js add (attachEvent/detachEvent)
@@ -798,6 +769,20 @@
 			}, this));
 		},
 
+		// On ajax request failure
+		failure: function (message, attrs) {
+			if (message !== null) {
+				Wicket.Log.error("Wicket.Ajax.Call.failure: Error while parsing response: " + message);
+			}
+			this._executeHandlers(attrs.fh);
+			Wicket.Ajax.invokePostCallHandlers();
+			Wicket.Ajax.invokeFailureHandlers();
+		},
+
+		done: function (channel) {
+			Wicket.channelManager.done(channel);
+		},
+
 		// Adds a closure that replaces a component
 		processComponent: function (steps, node) {
 			steps.push(function (notify) {
@@ -1079,9 +1064,10 @@
 				var result = {};
 				if (input && input.type && !(input.type === 'image' || input.type === 'submit')) { 
 					var $input = jQuery(input);
-					if ($input.length > 0 && $input.prop('disabled') === false) {
-						var name = $input.attr('name');
-						result[name] = $input.val();
+					var serialized = $input.serializeArray();
+					for (var i = 0; i < serialized.length; i++) {
+						var obj = serialized[i];
+						result[obj.name] = obj.value;
 					}
 				}
 				return result;
@@ -1094,7 +1080,10 @@
 			// Returns url/post-body fragment representing element (e)
 			serializeElement: function(element) {
 
-				if (typeof(element) === 'string') {
+				if (!element) {
+					return {};
+				}
+				else if (typeof(element) === 'string') {
 					element = Wicket.$(element);
 				}
 

http://git-wip-us.apache.org/repos/asf/wicket/blob/b9c82884/wicket-core/src/test/js/ajax.js
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/js/ajax.js b/wicket-core/src/test/js/ajax.js
index a878bab..df2d596 100644
--- a/wicket-core/src/test/js/ajax.js
+++ b/wicket-core/src/test/js/ajax.js
@@ -15,146 +15,176 @@
  * limitations under the License.
  */
 
-jQuery(document).ready(function() {
+/*
+	Note: these tests run only through Web Server.
+	Here is a possible setup for Apache HTTPD:
 
-	/**
-	 * Emulates an Ajax response from <script> element's body.
-	 * Using script element's body is cross browser compatible
-	 */
-	var loadData = function (id) {
-		var node = Wicket.$(id);
-		var text = "", i;
-
-		if (node.hasChildNodes()) {
-			for (i = 0; i < node.childNodes.length; i++) {
-				text = text + node.childNodes[i].nodeValue;
-			}
-		}
-		return text;
-	}
+		 Alias /ajax-tests "/path/to/wicket/wicket-core/src"
+
+		 <Directory "/path/to/wicket/wicket-core/src">
+
+		 Options Indexes
+		 AllowOverride None AuthConfig
+
+		 Order allow,deny
+		 Allow from all
+
+		 </Directory>
+
+	then run it by opening "http://localhost/ajax-tests/test/js/all.html" in the browser
 
-	execute = function (dataElementId, attributes) {
+ */
+
+jQuery(document).ready(function() {
+
+	execute = function (attributes) {
 		
 		var defaults = {
-				fh: function () {
-					start();
-					ok(false, 'Failure handler should not be called!');
-				},
+				fh: [
+					function () {
+						start();
+						ok(false, 'Failure handler should not be executed!');
+					}
+				],
 				ch: '0|s',
-				sh: function () {
-					start();
-					ok(true, 'Success handler is executed');
-				},
-				u: 'dummy/url'
+				sh: [
+					function () {
+						ok(true, 'Success handler is executed');
+					}
+				]
 		};
 		var attrs = jQuery.extend({}, defaults, attributes);
 		var call = new Wicket.Ajax.Call();
+		call.ajax(attrs);
 
-		var jqXHR = {
-			responseText: loadData(dataElementId),  // emulates Ajax response
-			responseXML: Wicket.Xml.parse(loadData(dataElementId)),  // emulates Ajax response (IE)
-			status: 200,
-			readyState: 4
-		};
-
-		call.channel = attrs.ch;
-		call.stateChangeCallback({}, "success", jqXHR, attrs);
 	};
 
-	module('Wicket.Ajax.stateChangeCallback');
-
-	asyncTest('Wicket.Ajax - processEvaluation with mock data.', function () {
-
-		expect(2);
-
-		execute('evaluationId');
-	});
+	// Ajax tests are executed only when run with Web Server
+	if ( !isLocal ) {
 
-	asyncTest('Wicket.Ajax - processEvaluation with mock data (priority-evaluate).', function () {
+		module('Wicket.Ajax.stateChangeCallback');
 
-		expect(2);
+		asyncTest('Wicket.Ajax - processEvaluation with mock data.', function () {
 
-		execute('priorityEvaluationId');
-	});
-	
-	asyncTest('Wicket.Ajax - processEvaluation with identifier|code.', function () {
+			expect(2);
 
-		expect(2);
-
-		execute('evaluationIdentifierAndCodeId');
-	});
+			var attrs = {
+				u: 'data/ajax/evaluationId.xml',
+				c: 'evaluationId'
+			}
+			execute(attrs);
+		});
 
-	asyncTest('Wicket.Ajax - processComponent, normal case.', function () {
+		asyncTest('Wicket.Ajax - processEvaluation with mock data (priority-evaluate).', function () {
 
-		expect(2);
+			expect(2);
 
-		var options = {
-			sh: function() {
-				start();
-				
-				equal(jQuery('#componentToReplace').text(), 'new body', 'The component must be replaced');
+			var attrs = {
+				u: 'data/ajax/priorityEvaluationId.xml',
+				c: 'priorityEvaluationId'
 			}
-		};
-
-		equal(jQuery('#componentToReplace').text(), 'old body', 'The component is existing and has the old innerHTML');
+			execute(attrs);
+		});
 
-		execute('componentId', options);
-	});
+		/**
+		 * Executes the second part of 'something|functionBody' by passing 'notify' function as parameter
+		 */
+		asyncTest('Wicket.Ajax - processEvaluation with identifier|code.', function () {
 
+			expect(2);
 
-	asyncTest('Wicket.Ajax - processComponent() but the old component doesn\'t exist.', function () {
+			var attrs = {
+				u: 'data/ajax/evaluationIdentifierAndCodeId.xml',
+				c: 'evaluationIdentifierAndCodeId'
+			}
+			execute(attrs);
+		});
 
-		expect(2);
+		asyncTest('Wicket.Ajax - processComponent, normal case.', function () {
 
-		var oldWicketLogError = Wicket.Log.error;
-		
-		Wicket.Log.error = function(msg) {
-			start();
-			equal(msg, 'Wicket.Ajax.Call.processComponent: Component with id [[componentToReplaceDoesNotExist]] was not found while trying to perform markup update. Make sure you called component.setOutputMarkupId(true) on the component whose markup you are trying to update.');
+			expect(2);
 
-			// restore the original method
-			Wicket.Log.error = oldWicketLogError;
-		};
+			equal(jQuery('#componentToReplace').text(), 'old body', 'The component is existing and has the old innerHTML');
 
-		var options = {
-			sh: function() {
-				equal(jQuery('#componentToReplaceDoesNotExist').length, 0, 'A component with id \'componentToReplaceDoesNotExist\' must not exist!');
+			var attrs = {
+				u: 'data/ajax/componentId.xml',
+				c: 'componentId',
+				sh: [
+					function() {
+						start();
+						equal(jQuery('#componentToReplace').text(), 'new body', 'The component must be replaced');
+					}
+				]
 			}
-		};
+			execute(attrs);
+		});
 
-		execute('componentDoesNotExistsId', options);
-	});
 
-	asyncTest('Wicket.Ajax - processComponent() replace a component with a table with scripts inside.', function () {
+		asyncTest('Wicket.Ajax - processComponent() but the old component doesn\'t exist.', function () {
 
-		expect(4);
+			expect(2);
 
-		var options = {
-			sh: function() {
+			var oldWicketLogError = Wicket.Log.error;
+
+			Wicket.Log.error = function(msg) {
 				start();
-				equal(jQuery('#componentToReplace')[0].tagName.toLowerCase(), 'table', 'A component with id \'componentToReplace\' must be a table now!');
+				equal(msg, 'Wicket.Ajax.Call.processComponent: Component with id [[componentToReplaceDoesNotExist]] was not found while trying to perform markup update. Make sure you called component.setOutputMarkupId(true) on the component whose markup you are trying to update.');
+
+				// restore the original method
+				Wicket.Log.error = oldWicketLogError;
+			};
+
+			var attrs = {
+				u: 'data/ajax/componentDoesNotExistsId.xml',
+				c: 'componentDoesNotExistsId',
+				sh: [
+					function() {
+						start();
+						equal(jQuery('#componentToReplaceDoesNotExist').length, 0, 'A component with id \'componentToReplaceDoesNotExist\' must not exist!');
+					}
+				]
 			}
-		};
+			execute(attrs);
+		});
+
+		asyncTest('Wicket.Ajax - processComponent() replace a component with a table with scripts inside.', function () {
+
+			expect(4);
+
+			var attrs = {
+				u: 'data/ajax/complexComponentId.xml',
+				c: 'complexComponentId',
+				sh: [
+					function() {
+						start();
+						equal(jQuery('#componentToReplace')[0].tagName.toLowerCase(), 'table', 'A component with id \'componentToReplace\' must be a table now!');
+					}
+				]
+			}
+			execute(attrs);
 
-		execute('complexComponentId', options);
-	});
+		});
 
-	
-	asyncTest('Wicket.Ajax - processComponent() replace title\'s text.', function () {
 
-		expect(1);
+		asyncTest('Wicket.Ajax - processComponent() replace title\'s text.', function () {
 
-		var oldTitle = jQuery('title').text();
+			expect(1);
 
-		var options = {
-			sh: function() {
-				start();
-				var $title = jQuery('title');
-				equal($title.text(), 'new title', 'The title text should be updated!');
-				$title.text(oldTitle);
-			}
-		};
+			var oldTitle = jQuery('title').text();
 
-		execute('componentToReplaceTitle', options);
-	});
+			var attrs = {
+				u: 'data/ajax/componentToReplaceTitle.xml',
+				c: 'componentToReplaceTitle',
+				sh: [
+					function() {
+						start();
+						var $title = jQuery('title');
+						equal($title.text(), 'new title', 'The title text should be updated!');
+						$title.text(oldTitle);
+					}
+				]
+			}
+			execute(attrs);
+		});
+	}
 });

http://git-wip-us.apache.org/repos/asf/wicket/blob/b9c82884/wicket-core/src/test/js/all.html
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/js/all.html b/wicket-core/src/test/js/all.html
index 8008554..68d62e9 100644
--- a/wicket-core/src/test/js/all.html
+++ b/wicket-core/src/test/js/all.html
@@ -19,6 +19,7 @@
 <html>
 <head>
     <title id="titleId">All tests</title>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
     <link rel="stylesheet" href="qunit/qunit.css" type="text/css" media="screen" />
     <script src="../../main/java/org/apache/wicket/resource/jquery/jquery.js"></script>
     <script src="../../main/java/org/apache/wicket/ajax/res/js/wicket-event-jquery.js"></script>
@@ -47,14 +48,6 @@
         <!--
             AJAX
         -->
-        <textarea id="evaluationId"><ajax-response><evaluate>ok(true, 'Evaluation must be executed!');</evaluate></ajax-response></textarea>
-
-        <textarea id="priorityEvaluationId"><ajax-response><priority-evaluate>ok(true, 'Priority Evaluation must be executed!');</priority-evaluate></ajax-response></textarea>
-
-        <!--
-            Executes the second part of 'something|functionBody' by passing 'notify' function as parameter
-        -->
-        <textarea id="evaluationIdentifierAndCodeId"><ajax-response><evaluate>ignored|start(); ok(true, 'Evaluation with identifier must be executed!'); arguments[0]();</evaluate></ajax-response></textarea>
 
         <div id="componentToReplace">old body</div>
 

http://git-wip-us.apache.org/repos/asf/wicket/blob/b9c82884/wicket-core/src/test/js/data/ajax/complexComponentId.xml
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/js/data/ajax/complexComponentId.xml b/wicket-core/src/test/js/data/ajax/complexComponentId.xml
new file mode 100644
index 0000000..8fc6212
--- /dev/null
+++ b/wicket-core/src/test/js/data/ajax/complexComponentId.xml
@@ -0,0 +1,29 @@
+<ajax-response><component id="componentToReplace"><![CDATA[
+
+    <table id="componentToReplace">
+        <thead>
+            <tr>
+                <th><div><script>start(); ok(true, 'script in thead > td has to be executed')</script></div>
+                </th>
+                <th>header 2</th>
+            </tr>
+        </thead>
+        <tbody>
+            <tr>
+                <td>data 1
+<script>start(); ok(true, 'script in tbody > td has to be executed')</script>
+                </td>
+                <td>data 2</td>
+            </tr>
+        </tbody>
+        <tfoot>
+            <tr>
+                <td>footer 1</td>
+                <td>footer 2
+                    <script>start(); ok(true, 'script in tfoot > td has to be executed')</script>
+                </td>
+            </tr>
+        </tfoot>
+    </table>
+
+]]></component></ajax-response>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/wicket/blob/b9c82884/wicket-core/src/test/js/data/ajax/componentDoesNotExistsId.xml
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/js/data/ajax/componentDoesNotExistsId.xml b/wicket-core/src/test/js/data/ajax/componentDoesNotExistsId.xml
new file mode 100644
index 0000000..18c9e35
--- /dev/null
+++ b/wicket-core/src/test/js/data/ajax/componentDoesNotExistsId.xml
@@ -0,0 +1 @@
+<ajax-response><component id="componentToReplaceDoesNotExist"><![CDATA[<span id="componentToReplaceDoesNotExist">new body</span>]]></component></ajax-response>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/wicket/blob/b9c82884/wicket-core/src/test/js/data/ajax/componentId.xml
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/js/data/ajax/componentId.xml b/wicket-core/src/test/js/data/ajax/componentId.xml
new file mode 100644
index 0000000..44d4c1e
--- /dev/null
+++ b/wicket-core/src/test/js/data/ajax/componentId.xml
@@ -0,0 +1 @@
+<ajax-response><component id="componentToReplace"><![CDATA[<span id="componentToReplace">new body</span>]]></component></ajax-response>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/wicket/blob/b9c82884/wicket-core/src/test/js/data/ajax/componentToReplaceTitle.xml
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/js/data/ajax/componentToReplaceTitle.xml b/wicket-core/src/test/js/data/ajax/componentToReplaceTitle.xml
new file mode 100644
index 0000000..8a5b97f
--- /dev/null
+++ b/wicket-core/src/test/js/data/ajax/componentToReplaceTitle.xml
@@ -0,0 +1 @@
+<ajax-response><component id="titleId"><![CDATA[<title id="titleId">new title</title>]]></component></ajax-response>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/wicket/blob/b9c82884/wicket-core/src/test/js/data/ajax/evaluationId.xml
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/js/data/ajax/evaluationId.xml b/wicket-core/src/test/js/data/ajax/evaluationId.xml
new file mode 100644
index 0000000..fd62e5b
--- /dev/null
+++ b/wicket-core/src/test/js/data/ajax/evaluationId.xml
@@ -0,0 +1 @@
+<ajax-response><evaluate>start(); ok(true, 'Evaluation must be executed!');</evaluate></ajax-response>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/wicket/blob/b9c82884/wicket-core/src/test/js/data/ajax/evaluationIdentifierAndCodeId.xml
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/js/data/ajax/evaluationIdentifierAndCodeId.xml b/wicket-core/src/test/js/data/ajax/evaluationIdentifierAndCodeId.xml
new file mode 100644
index 0000000..ed4f352
--- /dev/null
+++ b/wicket-core/src/test/js/data/ajax/evaluationIdentifierAndCodeId.xml
@@ -0,0 +1 @@
+<ajax-response><evaluate>ignored|start(); ok(true, 'Evaluation with identifier must be executed!'); arguments[0]();</evaluate></ajax-response>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/wicket/blob/b9c82884/wicket-core/src/test/js/data/ajax/priorityEvaluationId.xml
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/js/data/ajax/priorityEvaluationId.xml b/wicket-core/src/test/js/data/ajax/priorityEvaluationId.xml
new file mode 100644
index 0000000..374f0f7
--- /dev/null
+++ b/wicket-core/src/test/js/data/ajax/priorityEvaluationId.xml
@@ -0,0 +1 @@
+<ajax-response><priority-evaluate>start(); ok(true, 'Priority Evaluation must be executed!');</priority-evaluate></ajax-response>
\ No newline at end of file