@Test
public void testSetNext()
throws SAXException, IOException
{
Digester digester = new Digester();
digester.setRules( new ExtendedBaseRules() );
digester.setValidating( false );
digester.addObjectCreate( "!*/b", BetaBean.class );
digester.addObjectCreate( "!*/a", AlphaBean.class );
digester.addObjectCreate( "root", ArrayList.class );
digester.addSetProperties( "!*" );
digester.addSetNext( "!*/b/?", "setChild" );
digester.addSetNext( "!*/a/?", "setChild" );
digester.addSetNext( "!root/?", "add" );
ArrayList<?> root = digester.parse( getInputStream( "Test4.xml" ) );
assertEquals( "Wrong array size", 2, root.size() );
AlphaBean one = (AlphaBean) root.get( 0 );
assertTrue( one.getChild() instanceof BetaBean );
BetaBean two = (BetaBean) one.getChild();