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/07/24 16:58:57 UTC

git commit: WICKET-4641 AjaxFallbackLink and log a warning when there are several ajax event behaviors on the same event

Updated Branches:
  refs/heads/master d44f50417 -> e25e1e66d


WICKET-4641 AjaxFallbackLink and log a warning when there are several ajax event behaviors on the same event


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

Branch: refs/heads/master
Commit: e25e1e66ddc468b190a2ec020a8c15b181ee7001
Parents: d44f504
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Tue Jul 24 17:58:32 2012 +0300
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Tue Jul 24 17:58:32 2012 +0300

----------------------------------------------------------------------
 .../ajax/markup/html/AjaxFallbackLinkTest.java     |   17 ++++++++-------
 1 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/e25e1e66/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/AjaxFallbackLinkTest.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/AjaxFallbackLinkTest.java b/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/AjaxFallbackLinkTest.java
index 0c0e5c9..37d8397 100644
--- a/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/AjaxFallbackLinkTest.java
+++ b/wicket-core/src/test/java/org/apache/wicket/ajax/markup/html/AjaxFallbackLinkTest.java
@@ -20,6 +20,7 @@ import org.apache.wicket.MarkupContainer;
 import org.apache.wicket.WicketTestCase;
 import org.apache.wicket.ajax.AjaxRequestTarget;
 import org.apache.wicket.markup.IMarkupResourceStreamProvider;
+import org.apache.wicket.markup.MarkupException;
 import org.apache.wicket.markup.html.WebPage;
 import org.apache.wicket.util.resource.IResourceStream;
 import org.apache.wicket.util.resource.StringResourceStream;
@@ -31,20 +32,19 @@ import org.junit.Test;
 public class AjaxFallbackLinkTest extends WicketTestCase
 {
 	/**
-	 * Tests that AjaxFallbackLink doesn't produce onclick inline attribute for non-anchor markup elements
+	 * https://issues.apache.org/jira/browse/WICKET-4641
 	 *
-	 * https://issues.apache.org/jira/browse/WICKET-4644
+	 * AjaxFallbackLink can be used only with <a>, <area> or <link> markup elements
 	 */
-	@Test
-	public void noInlineOnClickAttribute()
+	@Test(expected = MarkupException.class)
+	public void onlyAnchorAreaAndLink()
 	{
-		tester.startPage(new AjaxFallbackLinkPage());
-		tester.assertContainsNot("onclick=");
+		tester.startPage(new OnlyAnchorAreaAndLinkPage());
 	}
 
-	private static class AjaxFallbackLinkPage extends WebPage implements IMarkupResourceStreamProvider
+	private static class OnlyAnchorAreaAndLinkPage extends WebPage implements IMarkupResourceStreamProvider
 	{
-		private AjaxFallbackLinkPage()
+		private OnlyAnchorAreaAndLinkPage()
 		{
 			add(new AjaxFallbackLink("l") {
 
@@ -61,4 +61,5 @@ public class AjaxFallbackLinkTest extends WicketTestCase
 			return new StringResourceStream("<html><body><bla wicket:id='l'>Ajax fallback link</bla></body></html>");
 		}
 	}
+
 }