VoiceXmlInterpreter { void setDocument(final VoiceXmlDocument doc, final String startDialog, final Configuration configuration) throws ConfigurationException { if (doc == null) { document = null; return; } document = doc; final Vxml vxml = document.getVxml(); if (vxml == null) { LOGGER.warn("no vxml tag found in '" + doc + "'"); return; } final DialogFactory factory = configuration .loadObject(DialogFactory.class); dialogs = factory.getDialogs(vxml); if (startDialog == null) { final Iterator<Dialog> iterator = dialogs.iterator(); if (iterator.hasNext()) { nextDialog = iterator.next(); } } else { nextDialog = getDialog(startDialog); } if (nextDialog == null) { if (startDialog == null) { LOGGER.info("the document does not contain any dialogs"); } else { LOGGER.warn("start dialog '" + startDialog + "' not found in document!"); } } else { LOGGER.info("interpreter starts with dialog '" + nextDialog.getId() + "'"); } } VoiceXmlInterpreter(final VoiceXmlInterpreterContext ctx); FormInterpretationAlgorithm getFormInterpretationAlgorithm(); InterpreterState getState(); void setState(final InterpreterState newState); Dialog getNextDialog(); Dialog getDialog(final String id); void process(final Dialog dialog,
            final Map<String, Object> parameters); void enterFinalProcessingState(); boolean isInFinalProcessingState(); Locale getLanguage();  }
@Test public void testSetDocument() throws Exception { final VoiceXmlDocument document = new VoiceXmlDocument(); final Vxml vxml = document.getVxml(); final Form form = vxml.appendChild(Form.class); final String id = "hurz"; form.setId(id); interpreter.setDocument(document, null, configuration); final Dialog dialog = interpreter.getNextDialog(); Assert.assertEquals(id, dialog.getId()); }