@Test
public void testQueueSpeakable() throws JVoiceXMLEvent, Exception {

    final SsmlDocument ssml = new SsmlDocument();
    final Speak speak = ssml.getSpeak();
    speak.addText("this is a test");
    final SpeakableText speakable1 = new SpeakableSsmlText(ssml);
    synthesizer.queueSpeakable(speakable1, sessionId, documentServer);
    synthesizer.waitQueueEmpty();
    Assert.assertFalse(synthesizer.isBusy());
    final int size = 3;
    listener.waitSize(size, TIMEOUT);
    Assert.assertEquals(size, listener.size());
    SynthesizedOutputEvent start = listener.get(0);
    Assert.assertEquals(OutputStartedEvent.EVENT_TYPE, start.getEventType());
    OutputStartedEvent startedEvent = (OutputStartedEvent) start;
    Assert.assertEquals(speakable1, startedEvent.getSpeakable());
    SynthesizedOutputEvent stop = listener.get(1);
    Assert.assertEquals(OutputEndedEvent.EVENT_TYPE, start.getEventType());
    OutputEndedEvent stoppedEvent = (OutputEndedEvent) stop;
    Assert.assertEquals(speakable1, stoppedEvent.getSpeakable());
    SynthesizedOutputEvent empty = listener.get(2);
    Assert.assertEquals(QueueEmptyEvent.EVENT_TYPE, start.getEventType());
    Assert.assertTrue(empty instanceof QueueEmptyEvent);
}