assertEquals(le.getFrequency(), 15);
}
@Test public void testWritable() throws Exception
{
Factory f = new Factory();
BasicLexiconEntry le = (BasicLexiconEntry)f.newInstance();
le.setTermId(100);
le.setOffset(10, (byte)11);
byte[] b = getBytes(le);
System.err.println("le written in "+b.length+" bytes");
assertEquals(b.length, f.getSize());
BasicLexiconEntry leReader = (BasicLexiconEntry) f.newInstance();
populateEntry(leReader, b);
assertEquals(le.getTermId(), leReader.getTermId());
assertEquals(le.getFrequency(), leReader.getFrequency());
assertEquals(le.getDocumentFrequency(), leReader.getDocumentFrequency());
assertEquals(le.getOffset(), leReader.getOffset());