use of alma.acs.util.stringqueue.TimestampedStringQueue in project ACS by ACS-Community.
the class DefaultFileHandlerTest method testDefaultQueueFileHandlerImpl.
/**
* Push strings in cache to generate 2 files.
* <P>
* The checks are done by {@link MyFileHandler}
*
* @throws Exception
*/
public void testDefaultQueueFileHandlerImpl() throws Exception {
// We want the cache to generate 2 files
Vector<String> strToPush = generateStrings(MAX_FILE_SIZE + 2048);
MyFileHandler fHandler = new MyFileHandler(MAX_FILE_SIZE);
TimestampedStringQueue queue = new TimestampedStringQueue(fHandler, timestampIdentifier);
queue.start();
int t = 0;
while (queue.getActiveFilesSize() < 2) {
queue.push(strToPush.get(t++));
assertEquals("Inconsistent number of files in cache", fHandler.createdFiles, queue.getActiveFilesSize());
}
queue.close(true);
}
Aggregations