assertContainsScriptCycle(theByteArrayOutputStream.toString());
}
@Test
public void testListen_Max_Waiting_Concurrency() throws Exception {
final UserInfo theUserInfo = new UserInfo("test_user") {
private boolean isFirstCall = true;
private boolean isSecondCall = false;
public boolean isEventsEmpty() {
if(isFirstCall) {
isFirstCall = false;
isSecondCall = true;
return true;
} else if(isSecondCall) {
isSecondCall = false;
return false;
} else {
return true;
}
}
};
long theLastActivationTime = theUserInfo.getLastActivityTime();
long theStartTime = System.currentTimeMillis();
StreamingServerConnector theStreamingServerConnector = createStreamingServerConnector(700, new ByteArrayOutputStream());
theStreamingServerConnector.listen(theUserInfo);
long theEndTime = System.currentTimeMillis();
assertTrue(theEndTime - theStartTime >= 600); //one cycle is expected...
assertEquals(theLastActivationTime, theUserInfo.getLastActivityTime()); //..., but no user activity was reported, caused by the failed double-check
}