@Test
public void testGetCatchElements() throws Exception {

    final VoiceXmlDocument document = new VoiceXmlDocument();
    final Vxml vxml = document.getVxml();
    final Form form = vxml.appendChild(Form.class);
    form.appendChild(Filled.class);
    final Noinput noinput = form.appendChild(Noinput.class);
    final Help help = form.appendChild(Help.class);
    final Catch catchNode = form.appendChild(Catch.class);
    catchNode.setEvent("test");
    final ExecutablePlainForm dialog = new ExecutablePlainForm();
    dialog.setNode(form);
    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 + "'");
        }
    }
}