Thread.sleep(interval*4);
Date endDate = pb.getLasttime();
assertFalse("Date is not being updated in the PollBean",startDate.equals(endDate));
// Get control button and disable polling
HtmlButtonInput button = (HtmlButtonInput)client.getElement(_BUTTON_ID);
assertNotNull("Can't find polling control button ["+_BUTTON_ID+"]",button);
button.click();
// Wait for polling state to change
Thread.sleep(interval*2);
// Make sure we're no longer polling
assertFalse("Polling should be disabled in the PollBean",pb.getPollEnabled());
// Check the server-side control also (TBD: This causes IllegalStateException)
// poll = (UIPoll)server.findComponent(_POLL_ID);
// assertFalse("Polling should be disabled in the component",poll.isEnabled());
// Make sure the date is NOT updating
startDate = pb.getLasttime();
Thread.sleep(interval*4);
endDate = pb.getLasttime();
assertTrue("Date should not be updating in the PollBean",startDate.equals(endDate));
// Turn polling back on (page was updated, therefore we MUST re-get the control)
button = (HtmlButtonInput)client.getElement(_BUTTON_ID);
button.click();
// Wait for polling state to change
Thread.sleep(interval*2);
// Make sure we're polling again