}
@Test
public void exceptionsFromANodeObserverDoNotGetPropagatedAndAnErrorIsLogged() throws Exception
{
LogMessageStore logStore = new LogMessageStore(true);
TestRootNode rootNode = new TestRootNode( new File(TEST_DIR, "brjs-root-node"), new TestLoggerFactory(logStore) );
EventObserver observer = mock(EventObserver.class);
RuntimeException ex = new RuntimeException();
doThrow(ex).when(observer).onEventEmitted(any(Event.class), eq(rootNode));
rootNode.addObserver(observer);
rootNode.ready();
logStore.verifyWarnLogMessage(ObserverList.Messages.NODE_OBSERVER_EXCEPTION_MSG, observer.getClass(), ExceptionUtils.getStackTrace(ex));
}