@Test
public void testGetCatchElements() throws Exception {

    final VoiceXmlDocument document = new VoiceXmlDocument();
    final Vxml vxml = document.getVxml();
    final Menu menu = vxml.appendChild(Menu.class);
    final Noinput noinput = menu.appendChild(Noinput.class);
    final Help help = menu.appendChild(Help.class);
    final Catch catchNode = menu.appendChild(Catch.class);
    catchNode.setEvent("test");
    final ExecutableMenuForm dialog = new ExecutableMenuForm();
    dialog.setNode(menu);
    dialog.setChoiceConverter(new SrgsXmlChoiceConverter());
    final Collection<AbstractCatchElement> elements =
        dialog.getCatchElements();
    Assert.assertEquals(3, elements.size());
    for (AbstractCatchElement element : elements) {
        String tag = element.getTagName();
        if (tag.equals(Noinput.TAG_NAME)) {
            Assert.assertTrue("expected to find noinput element",
                    element.isEqualNode(noinput));
        } else if (tag.equals(Help.TAG_NAME)) {
            Assert.assertTrue("expected to find help element",
                    element.isEqualNode(help));
        } else if (tag.equals(Catch.TAG_NAME)) {
            Assert.assertTrue("expected to find catch element",
                    element.isEqualNode(catchNode));
        } else {
            Assert.fail("unknown tag: '" + tag + "'");
        }
    }
}