You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by ad...@apache.org on 2015/07/08 16:17:28 UTC

wicket git commit: clean up of if...else statements inside BaseWicketTester.clickLink(String, boolean)

Repository: wicket
Updated Branches:
  refs/heads/master aa97182a3 -> a241db57b


clean up of if...else statements inside BaseWicketTester.clickLink(String, boolean)


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

Branch: refs/heads/master
Commit: a241db57ba3b0391f590428fe79bcb9a37020e28
Parents: aa97182
Author: Andrea Del Bene <ad...@apache.org>
Authored: Wed Jul 8 16:14:46 2015 +0200
Committer: Andrea Del Bene <ad...@apache.org>
Committed: Wed Jul 8 16:17:06 2015 +0200

----------------------------------------------------------------------
 .../wicket/util/tester/BaseWicketTester.java    | 39 ++++----------------
 1 file changed, 7 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/wicket/blob/a241db57/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java b/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
index 8947ea2..d073baa 100644
--- a/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
+++ b/wicket-core/src/main/java/org/apache/wicket/util/tester/BaseWicketTester.java
@@ -1871,18 +1871,6 @@ public class BaseWicketTester
 				executeBehavior(behavior);
 			}
 		}
-		// AjaxFallbackLinks is processed like an AjaxLink if isAjax is true
-		// If it's not handling of the linkComponent is passed through to the
-		// Link.
-		else if (linkComponent instanceof AjaxFallbackLink && isAjax)
-		{
-			List<AjaxEventBehavior> behaviors = WicketTesterHelper.findAjaxEventBehaviors(
-				linkComponent, "click");
-			for (AjaxEventBehavior behavior : behaviors)
-			{
-				executeBehavior(behavior);
-			}
-		}
 		// if the link is an AjaxSubmitLink, we need to find the form
 		// from it using reflection so we know what to submit.
 		else if (linkComponent instanceof AjaxSubmitLink)
@@ -1913,26 +1901,6 @@ public class BaseWicketTester
 			}
 		}
 		/*
-		 * If the link is an instanceof IAjaxLink, it is not one of the
-		 * special cases marked above, so we treat it as an AjaxLink.
-		 */
-		else if (linkComponent instanceof IAjaxLink) 
-		{
-			// If it's not ajax we fail
-			if (isAjax == false)
-			{
-				fail("Link " + path + "is an AjaxLink and will " +
-					"not be invoked when AJAX (javascript) is disabled.");
-			}
-
-			List<AjaxEventBehavior> behaviors = WicketTesterHelper.findAjaxEventBehaviors(
-				linkComponent, "click");
-			for (AjaxEventBehavior behavior : behaviors)
-			{
-				executeBehavior(behavior);
-			}
-		}
-		/*
 		 * If the link is a submitlink then we pretend to have clicked it
 		 */
 		else if (linkComponent instanceof SubmitLink)
@@ -2009,6 +1977,13 @@ public class BaseWicketTester
 				executeListener(link, ILinkListener.INTERFACE);
 			}
 		}
+		// The link requires AJAX
+		else if (linkComponent instanceof IAjaxLink && isAjax == false) 
+		{
+			
+			fail("Link " + path + "is an IAjaxLink and will " +
+				"not be invoked when AJAX (javascript) is disabled.");	
+		}
 		else
 		{
 			fail("Link " + path + " is not a Link, AjaxLink, AjaxFallbackLink or AjaxSubmitLink");