Unit tests for HeaderReader.

This commit is contained in:
akwizgran
2011-07-21 10:58:42 +01:00
parent 159b09e12a
commit b4bf662b3e
4 changed files with 173 additions and 2 deletions

View File

@@ -23,8 +23,9 @@ class HeaderReader implements ObjectReader<Header> {
public Header readObject(Reader reader) throws IOException,
GeneralSecurityException {
// Initialise and add the consumer
CountingConsumer counting = new CountingConsumer(Header.MAX_SIZE);
// Initialise and add the consumer - the initial tag has already been
// read, so subtract one from the maximum size
CountingConsumer counting = new CountingConsumer(Header.MAX_SIZE - 1);
reader.addConsumer(counting);
// Acks
reader.addObjectReader(Tags.BATCH_ID, new BatchIdReader());