You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by gs...@apache.org on 2007/12/10 09:49:11 UTC
svn commit: r602812 -
/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxTimerBehaviorTest.java
Author: gseitz
Date: Mon Dec 10 00:49:01 2007
New Revision: 602812
URL: http://svn.apache.org/viewvc?rev=602812&view=rev
Log:
WICKET 745: extended unit test to check that the AbstractAjaxTimerBehavior renders it's head on every normal request
Modified:
wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxTimerBehaviorTest.java
Modified: wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxTimerBehaviorTest.java
URL: http://svn.apache.org/viewvc/wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxTimerBehaviorTest.java?rev=602812&r1=602811&r2=602812&view=diff
==============================================================================
--- wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxTimerBehaviorTest.java (original)
+++ wicket/trunk/jdk-1.4/wicket/src/test/java/org/apache/wicket/ajax/AjaxTimerBehaviorTest.java Mon Dec 10 00:49:01 2007
@@ -20,13 +20,13 @@
import java.util.regex.Pattern;
import org.apache.wicket.MockPageWithLinkAndComponent;
-import org.apache.wicket.MockPageWithOneComponent;
import org.apache.wicket.Page;
import org.apache.wicket.WicketTestCase;
import org.apache.wicket.ajax.markup.html.AjaxLink;
import org.apache.wicket.markup.html.WebComponent;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.util.tester.ITestPageSource;
import org.apache.wicket.util.time.Duration;
import org.slf4j.Logger;
@@ -105,9 +105,18 @@
{
Duration dur = Duration.seconds(20);
final MyAjaxSelfUpdatingTimerBehavior timer = new MyAjaxSelfUpdatingTimerBehavior(dur);
- final MockPageWithOneComponent page = new MockPageWithOneComponent();
- Label label = new Label(MockPageWithOneComponent.COMPONENT_ID, "Hello");
+ final MockPageWithLinkAndComponent page = new MockPageWithLinkAndComponent();
+ Label label = new Label(MockPageWithLinkAndComponent.COMPONENT_ID, "Hello");
page.add(label);
+ page.add(new Link(MockPageWithLinkAndComponent.LINK_ID)
+ {
+ private static final long serialVersionUID = 1L;
+
+ public void onClick()
+ {
+ // do nothing, link is just used to simulate a roundtrip
+ }
+ });
label.setOutputMarkupId(true);
label.add(timer);
@@ -120,6 +129,10 @@
return page;
}
});
+
+ validate(timer, true);
+
+ tester.clickLink(MockPageWithLinkAndComponent.LINK_ID);
validate(timer, true);