public void testLists()
throws Exception
{
String text = "<itemizedlist><listitem><para>item</para></listitem></itemizedlist>";
final SinkEventTestingSink sink = new SinkEventTestingSink();
parser.parse( text, sink );
Iterator<SinkEventElement> it = sink.getEventList().iterator();
assertEquals( "list", ( it.next() ).getName() );
assertEquals( "listItem", ( it.next() ).getName() );
assertEquals( "text", ( it.next() ).getName() );
assertEquals( "listItem_", ( it.next() ).getName() );
assertEquals( "list_", ( it.next() ).getName() );
assertFalse( it.hasNext() );
text = "<orderedlist numeration=\"upperalpha\"><listitem><para>item</para></listitem></orderedlist>";
sink.reset();
parser.parse( text, sink );
it = sink.getEventList().iterator();
SinkEventElement event = it.next();
assertEquals( "numberedList", event.getName() );
assertEquals( Sink.NUMBERING_UPPER_ALPHA, ( (Integer) event.getArgs()[0] ).intValue() );
assertEquals( "numberedListItem", ( it.next() ).getName() );
assertEquals( "text", ( it.next() ).getName() );
assertEquals( "numberedListItem_", ( it.next() ).getName() );
assertEquals( "numberedList_", ( it.next() ).getName() );
assertFalse( it.hasNext() );
text = "<variablelist><varlistentry><term>term</term><listitem><para>definition</para>"
+ "</listitem></varlistentry></variablelist>";
sink.reset();
parser.parse( text, sink );
it = sink.getEventList().iterator();
assertEquals( "definitionList", ( it.next() ).getName() );
assertEquals( "definitionListItem", ( it.next() ).getName() );
assertEquals( "definedTerm", ( it.next() ).getName() );
assertEquals( "text", ( it.next() ).getName() );