@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...");
}