@Test
public void detach_dirty_if_listener_throws_exception()
{
ComponentPageElement element = mockComponentPageElement();
Logger logger = mockLogger();
PageLifecycleListener listener1 = newPageLifecycle();
PageLifecycleListener listener2 = newPageLifecycle();
RuntimeException t = new RuntimeException("Listener detach exception.");
MetaDataLocator locator = newMetaDataLocator(LOGICAL_PAGE_NAME, true);
train_getLogger(element, logger);
listener1.containingPageDidDetach();
setThrowable(t);
logger.error(contains("failed during page detach"), same(t));
listener2.containingPageDidDetach();
replay();
Page page = new PageImpl(LOGICAL_PAGE_NAME, selector, null, perThreadManager, locator);
page.setRootElement(element);