Index: trunk/test/tmcsim/cadsimulator/SoundPlayerTest.java
===================================================================
--- trunk/test/tmcsim/cadsimulator/SoundPlayerTest.java	(revision 16)
+++ trunk/test/tmcsim/cadsimulator/SoundPlayerTest.java	(revision 16)
@@ -0,0 +1,88 @@
+package tmcsim.cadsimulator;
+
+import java.util.Vector;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import static junit.framework.Assert.assertEquals;
+import static junit.framework.Assert.assertFalse;
+import junit.framework.TestCase;
+import tmcsim.client.cadclientgui.data.IncidentEvent;
+
+/**
+ *
+ * @author jdalbey
+ */
+public class SoundPlayerTest extends TestCase
+{
+
+    SoundPlayer player;
+
+    public SoundPlayerTest(String testName)
+    {
+        super(testName);
+    }
+
+    @Override
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+    }
+
+    /**
+     * Test of run method, of class SoundPlayer.
+     */
+    public void testRun()
+    {
+        System.out.println("run");
+        Vector dummy = new Vector();
+        IncidentEvent evt1 = new IncidentEvent(0, null, "frog-croak.mp3", 2, dummy, dummy);
+        IncidentEvent evt2 = new IncidentEvent(0, null, "bikehorn.mp3", 1, dummy, dummy);
+        player = new SoundPlayer("test/resources/");
+        player.start();
+        player.enqueueClip(evt1);
+        player.enqueueClip(evt2);
+        try
+        {
+            Thread.sleep(5000);
+        } catch (InterruptedException ex)
+        {
+            Logger.getLogger(SoundPlayerTest.class.getName()).log(Level.SEVERE, null, ex);
+        }
+        assertEquals(".wav didn't complete playing", IncidentEvent.EVENT_STATUS.COMPLETED, evt2.eventStatus);
+    }
+
+    public void testEnqueueClip()
+    {
+        System.out.println("enqueueClip");
+        Vector dummy = new Vector();
+        IncidentEvent evt1 = new IncidentEvent(0, null, "frog-croak.mp3", 4, dummy, dummy);
+        player = new SoundPlayer("test/resources/");
+        player.setAudioEnabled(false);
+        player.start();
+        player.enqueueClip(evt1);
+        // Note: we don't wait for the clip to complete.
+        // So if audio is disabled, the clip will get marked complete without being played.
+        assertEquals(".wav played when audio disabled", IncidentEvent.EVENT_STATUS.COMPLETED, evt1.eventStatus);
+    }
+
+    public void testDeQueueAll()
+    {
+        System.out.println("deQueueAll");
+        Vector dummy = new Vector();
+        IncidentEvent evt1 = new IncidentEvent(0, null, "bikehorn.mp3", 1, dummy, dummy);
+        IncidentEvent evt2 = new IncidentEvent(0, null, "bikehorn.mp3", 2, dummy, dummy);
+        player = new SoundPlayer("test/resources/");
+        player.start();
+        player.enqueueClip(evt1);
+        player.enqueueClip(evt2);
+        player.deQueueAll();
+        try
+        {
+            Thread.sleep(2000);
+        } catch (InterruptedException ex)
+        {
+            Logger.getLogger(SoundPlayerTest.class.getName()).log(Level.SEVERE, null, ex);
+        }
+        assertFalse(".wav played after dequeue all", IncidentEvent.EVENT_STATUS.COMPLETED == evt2.eventStatus);
+    }
+}
