}
@Test
public void testListen_Error_2() throws Exception {
final Domain theDomain = DomainFactory.getDomain("test_domain");
final UserInfo theUserInfo = new UserInfo("test_user");
StreamingServerConnector theStreamingServerConnector = createStreamingServerConnector(0, new DummyServletOutputStreamNotFlushable());
TestLoggingHandler theTestLoggingHandler = new TestLoggingHandler();
Logger theLogger = Logger.getLogger(StreamingServerConnector.class.getName());
final Level theOldLevel = theLogger.getLevel();
try {
theLogger.setLevel(Level.FINEST);
theLogger.addHandler(theTestLoggingHandler);
ListenRunnable theListenRunnable = new ListenRunnable(theStreamingServerConnector, theUserInfo);
Thread theListenThread = new Thread(theListenRunnable);
theListenThread.start();
theUserInfo.addEvent(theDomain, new DummyEvent());
theListenThread.join();
assertNotNull(theTestLoggingHandler.getLastMessage());
assertTrue(theTestLoggingHandler.getLastMessage().contains("Flush") || theTestLoggingHandler.getLastMessage().contains("flush"));