MarySynthesizedOutput implements SynthesizedOutput, SynthesizedOutputListener { @Override public void waitQueueEmpty() { isBusy(); } MarySynthesizedOutput(); @Override void queueSpeakable(final SpeakableText speakable,
            final String sessionId, final DocumentServer server); @Override void waitNonBargeInPlayed(); @Override void waitQueueEmpty(); @Override void activate(); @Override void close(); @Override String getType(); @Override void open(); @Override void passivate(); @Override void connect(final ConnectionInformation info); @Override void disconnect(final ConnectionInformation info); @Override void cancelOutput(final BargeInType bargeInType); boolean supportsBargeIn(); @Override void addListener(final SynthesizedOutputListener outputListener); @Override void removeListener(final SynthesizedOutputListener outputListener); void setType(final String resourceType); void outputStatusChanged(final SynthesizedOutputEvent event); @Override boolean isBusy(); void cancelAudioOutput(); void setAudioType(final String value); void setVoiceName(final String name); void setLang(final String lang); @Override void outputError(final ErrorEvent error);  }
@Test(timeout = 20000) public void testWaitQueueEmpty() throws Exception, JVoiceXMLEvent { final SsmlDocument doc1 = new SsmlDocument(); final Speak speak1 = doc1.getSpeak(); speak1.setXmlLang(Locale.US); speak1.addText("Test 1 from SSML"); final SpeakableSsmlText ssml1 = new SpeakableSsmlText(doc1, true, BargeInType.SPEECH); final SsmlDocument doc2 = new SsmlDocument(); final Speak speak2 = doc2.getSpeak(); speak2.setXmlLang(Locale.US); speak2.addText("Test 2 from SSML"); final SpeakableSsmlText ssml2 = new SpeakableSsmlText(doc2, true, BargeInType.SPEECH); SpeakableSsmlText plainText = new SpeakableSsmlText("Test 3", Locale.US); SpeakableSsmlText plainText2 = new SpeakableSsmlText("Test 4", Locale.US); final SsmlDocument doc3 = new SsmlDocument(); final Speak speak3 = doc3.getSpeak(); speak3.setXmlLang(Locale.US); speak3.addText("Test 5 from SSML"); final SpeakableSsmlText ssml3 = new SpeakableSsmlText(doc3, true, BargeInType.SPEECH); output.queueSpeakable(ssml1, sessionId, documentServer); output.queueSpeakable(ssml2, sessionId, documentServer); output.queueSpeakable(plainText, sessionId, documentServer); output.queueSpeakable(plainText2, sessionId, documentServer); output.queueSpeakable(ssml3, sessionId, documentServer); LOGGER.info("Speakables offered to the synthesisQueue"); output.waitQueueEmpty(); LOGGER.info("Return resources..."); }