*/
public void testAddToAjaxUpdate()
{
Duration dur = Duration.seconds(20);
final MyAjaxSelfUpdatingTimerBehavior timer = new MyAjaxSelfUpdatingTimerBehavior(dur);
final MockPageWithLinkAndComponent page = new MockPageWithLinkAndComponent();
page.add(new WebComponent(MockPageWithLinkAndComponent.COMPONENT_ID)
.setOutputMarkupId(true));
page.add(new AjaxLink(MockPageWithLinkAndComponent.LINK_ID)
{
private static final long serialVersionUID = 1L;
public void onClick(AjaxRequestTarget target)
{
WebMarkupContainer wmc = new WebMarkupContainer(
MockPageWithLinkAndComponent.COMPONENT_ID);
wmc.setOutputMarkupId(true);
wmc.add(timer);
page.replace(wmc);
target.addComponent(wmc);
}
});
tester.startPage(new ITestPageSource()