@Test
public void testSetCustomProperties()
throws SAXException, IOException
{
Digester digester = new Digester();
digester.setValidating( false );
digester.addObjectCreate( "toplevel", ArrayList.class );
digester.addObjectCreate( "toplevel/one", Address.class );
digester.addSetNext( "toplevel/one", "add" );
digester.addObjectCreate( "toplevel/two", Address.class );
digester.addSetNext( "toplevel/two", "add" );
digester.addObjectCreate( "toplevel/three", Address.class );
digester.addSetNext( "toplevel/three", "add" );
digester.addObjectCreate( "toplevel/four", Address.class );
digester.addSetNext( "toplevel/four", "add" );
digester.addSetProperties( "toplevel/one" );
digester.addSetProperties( "toplevel/two", new String[] { "alt-street", "alt-city", "alt-state" },
new String[] { "street", "city", "state" } );
digester.addSetProperties( "toplevel/three", new String[] { "aCity", "state" }, new String[] { "city" } );
digester.addSetProperties( "toplevel/four", "alt-city", "city" );
ArrayList<?> root = digester.parse( getInputStream( "Test7.xml" ) );
assertEquals( "Wrong array size", 4, root.size() );
// note that the array is in popped order (rather than pushed)