public void testStructureAndDescriptions() throws Exception {
assertEquals("Number of benchmarks", 2, benchmarks.size());
final Iterator<? extends Benchmark> bit = benchmarks.iterator();
{
final Benchmark b = bit.next();
assertEquals("Bob Marley was born in Kingston, Jamaica.", b.getInputText());
assertEquals("First benchmark group count", 2, b.size());
final Iterator<TripleMatcherGroup> git = b.iterator();
assertEquals("Kingston must be found", git.next().getDescription());
assertEquals("Bob Marley must be found as a musical artist", git.next().getDescription());
assertFalse(git.hasNext());
}
{
final Benchmark b = bit.next();
assertEquals("Paris Hilton might live in Paris, but she prefers New York.", b.getInputText());
assertEquals("Second benchmark group count", 5, b.size());
final Iterator<TripleMatcherGroup> git = b.iterator();
for(int i=1; i <= 5; i++) {
assertEquals("Second benchmark group " + i, git.next().getDescription());
}
assertFalse(git.hasNext());
}