Index: trunk/test/scriptbuilder/structures/TimeSliceTest.java
===================================================================
--- trunk/test/scriptbuilder/structures/TimeSliceTest.java	(revision 56)
+++ trunk/test/scriptbuilder/structures/TimeSliceTest.java	(revision 57)
@@ -1,5 +1,12 @@
 package scriptbuilder.structures;
 
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.util.logging.Level;
+import java.util.logging.Logger;
 import junit.framework.TestCase;
+import scriptbuilder.structures.events.AudioEvent;
+import scriptbuilder.structures.events.CHPRadioEvent;
 import scriptbuilder.structures.events.I_ScriptEvent;
 
@@ -8,7 +15,9 @@
  * @author Bryan McGuffin
  */
-public class TimeSliceTest extends TestCase {
-    
-    public TimeSliceTest(String testName) {
+public class TimeSliceTest extends TestCase
+{
+
+    public TimeSliceTest(String testName)
+    {
         super(testName);
     }
@@ -20,9 +29,10 @@
     {
         System.out.println("addEvent");
-        I_ScriptEvent event = null;
-        TimeSlice instance = null;
+        I_ScriptEvent event = new CHPRadioEvent();
+        TimeSlice instance = new TimeSlice(0, null);
+
+        assertEquals(0, instance.events.size());
         instance.addEvent(event);
-        // TODO review the generated test code and remove the default call to fail.
-        fail("The test case is a prototype.");
+        assertEquals(1, instance.events.size());
     }
 
@@ -33,10 +43,8 @@
     {
         System.out.println("getX");
-        TimeSlice instance = null;
+        TimeSlice instance = new TimeSlice(0, null);
         int expResult = 0;
         int result = instance.getX();
         assertEquals(expResult, result);
-        // TODO review the generated test code and remove the default call to fail.
-        fail("The test case is a prototype.");
     }
 
@@ -47,10 +55,8 @@
     {
         System.out.println("getTime");
-        TimeSlice instance = null;
-        int expResult = 0;
+        TimeSlice instance = new TimeSlice(100, null);
+        int expResult = 100;
         int result = instance.getTime();
         assertEquals(expResult, result);
-        // TODO review the generated test code and remove the default call to fail.
-        fail("The test case is a prototype.");
     }
 
@@ -61,9 +67,9 @@
     {
         System.out.println("shift");
-        int amnt = 0;
-        TimeSlice instance = null;
+        int amnt = 25;
+        TimeSlice instance = new TimeSlice(100, null);
+        assertEquals(100, instance.getTime());
         instance.shift(amnt);
-        // TODO review the generated test code and remove the default call to fail.
-        fail("The test case is a prototype.");
+        assertEquals(125, instance.getTime());
     }
 
@@ -74,10 +80,17 @@
     {
         System.out.println("getEffectiveDuration");
-        TimeSlice instance = null;
-        int expResult = 0;
-        int result = instance.getEffectiveDuration();
-        assertEquals(expResult, result);
-        // TODO review the generated test code and remove the default call to fail.
-        fail("The test case is a prototype.");
+        TimeSlice instance = new TimeSlice(0, null);
+        assertEquals(0, instance.getEffectiveDuration());
+
+        ScriptEvent ev1 = new AudioEvent();
+        assertEquals(1, ev1.getLength());
+        instance.addEvent(ev1);
+        assertEquals(1, instance.getEffectiveDuration());
+
+        ScriptEvent ev2 = new AudioEvent();
+        ev2.length = 25;
+        assertEquals(25, ev2.getLength());
+        instance.addEvent(ev2);
+        assertEquals(25, instance.getEffectiveDuration());
     }
 
@@ -89,10 +102,36 @@
         System.out.println("getToolTipText");
         int y = 0;
-        TimeSlice instance = null;
+        TimeSlice instance = new TimeSlice(0, null);
         String expResult = "";
-        String result = instance.getToolTipText(y);
-        assertEquals(expResult, result);
-        // TODO review the generated test code and remove the default call to fail.
-        fail("The test case is a prototype.");
+        String result = instance.getToolTipText(0);
+        assertEquals(null, result);
+
+        result = instance.getToolTipText(56);
+        assertEquals(null, result);
+
+        result = instance.getToolTipText(50);
+        assertEquals(null, result);
+
+        result = instance.getToolTipText(80);
+        assertEquals(null, result);
+
+        AudioEvent ev = new AudioEvent();
+        instance.addEvent(ev);
+        expResult = "<html>" + ev.toString() + "<br/></html>";
+
+        result = instance.getToolTipText(56);
+        assertEquals(ev.toString(), result);
+
+        result = instance.getToolTipText(70);
+        assertEquals(ev.toString(), result);
+
+        result = instance.getToolTipText(85);
+        assertEquals(null, result);
+
+        result = instance.getToolTipText(50);
+        assertEquals(expResult, result);
+
+        result = instance.getToolTipText(0);
+        assertEquals(null, result);
     }
 
@@ -103,10 +142,18 @@
     {
         System.out.println("toString");
-        TimeSlice instance = null;
+        TimeSlice instance = new TimeSlice(0, null);
         String expResult = "";
         String result = instance.toString();
         assertEquals(expResult, result);
-        // TODO review the generated test code and remove the default call to fail.
-        fail("The test case is a prototype.");
+
+        AudioEvent ev1 = new AudioEvent();
+        CHPRadioEvent ev2 = new CHPRadioEvent();
+
+        instance.addEvent(ev1);
+        instance.addEvent(ev2);
+
+        expResult = ev1.toString() + "\n" + ev2.toString() + "\n";
+        result = instance.toString();
+        assertEquals(expResult, result);
     }
 
@@ -117,11 +164,21 @@
     {
         System.out.println("compareTo");
-        Object o = null;
-        TimeSlice instance = null;
-        int expResult = 0;
+        Object o = new SimulationScript();
+
+        TimeSlice other = new TimeSlice(10, null);
+
+        TimeSlice instance = new TimeSlice(0, null);
         int result = instance.compareTo(o);
-        assertEquals(expResult, result);
-        // TODO review the generated test code and remove the default call to fail.
-        fail("The test case is a prototype.");
+        assertEquals(0, result);
+
+        result = instance.compareTo(other);
+        assertEquals(-1, result);
+
+        result = other.compareTo(instance);
+        assertEquals(1, result);
+
+        result = instance.compareTo(instance);
+        assertEquals(0, result);
+
     }
 
@@ -131,11 +188,29 @@
     public void testToXML()
     {
-        System.out.println("toXML");
-        TimeSlice instance = null;
-        String expResult = "";
-        String result = instance.toXML();
-        assertEquals(expResult, result);
-        // TODO review the generated test code and remove the default call to fail.
-        fail("The test case is a prototype.");
+        try
+        {
+            System.out.println("toXML");
+            SimulationScript script = new SimulationScript();
+            script.loadScriptFromFile(new File("test/scriptbuilder/structures/single_timeslice_output_expected.xml"));
+            TimeSlice instance = script.incidents.get(0).slices.get(0);
+
+            byte[] data = Files.readAllBytes(
+                    new File("test/scriptbuilder/structures/single_timeslice_output_expected.xml").toPath());
+
+            String expResult = new String(data);
+
+            String result = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"
+                    + "<!DOCTYPE TMC_SCRIPT SYSTEM \"script.dtd\">\n"
+                    + XMLWriter.openTag(ELEMENT.TMC_SCRIPT.tag + " title=\"" + script.title + "\"")
+                    + instance.toXML()
+                    + XMLWriter.closeTag(ELEMENT.TMC_SCRIPT.tag);
+
+            assertEquals(expResult, result);
+
+        }
+        catch (IOException ex)
+        {
+            Logger.getLogger(TimeSliceTest.class.getName()).log(Level.SEVERE, null, ex);
+        }
     }
 
Index: trunk/test/scriptbuilder/structures/single_timeslice_output_expected.xml
===================================================================
--- trunk/test/scriptbuilder/structures/single_timeslice_output_expected.xml	(revision 57)
+++ trunk/test/scriptbuilder/structures/single_timeslice_output_expected.xml	(revision 57)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE TMC_SCRIPT SYSTEM "script.dtd">
+<TMC_SCRIPT title="Full Simulation"><SCRIPT_EVENT><TIME_INDEX>00:00:00</TIME_INDEX>
+<INCIDENT LogNum="187">Stalled DOT/Traffic Collision</INCIDENT>
+<CAD_DATA><MASTER_INC_NUM>145086SLO003</MASTER_INC_NUM>
+<P>1</P>
+<ADDITIONAL_INFO><TYPE_CODE>1179 Accident - Ambulance Responding</TYPE_CODE>
+<TYPE>1179</TYPE>
+</ADDITIONAL_INFO>
+<LOCATION><BEAT>14-14</BEAT>
+<ADDRESS>SB55 AT 405</ADDRESS>
+<LOC>SB55 AT 405</LOC>
+<CITY>Costa Mesa</CITY>
+<AREA>14-Santa Maria</AREA>
+<FIRE>Costa Mesa</FIRE>
+<LAW>Costa Mesa</LAW>
+<EMS>Costa Mesa</EMS>
+</LOCATION>
+<GENERAL><AGY>CHP</AGY>
+</GENERAL>
+<HEADER_INFO><Type>1179</Type>
+<Beat>14-14</Beat>
+<TruncLoc>SB55 AT 405</TruncLoc>
+<FullLoc>SB55 AT 405</FullLoc>
+</HEADER_INFO>
+<LOCATION_INFO ID="187_N_405_ML"><Route>405</Route>
+<Direction>NB</Direction>
+<Postmile>8.4</Postmile>
+<Location_type>ML</Location_type>
+</LOCATION_INFO>
+<LOCATION_INFO ID="187_N_405_HV"><Route>405</Route>
+<Direction>NB</Direction>
+<Postmile>8.4</Postmile>
+<Location_type>HV</Location_type>
+</LOCATION_INFO>
+<LOCATION_INFO ID="187_S_55_ML"><Route>55</Route>
+<Direction>SB</Direction>
+<Postmile>6.5</Postmile>
+<Location_type>ML</Location_type>
+</LOCATION_INFO>
+</CAD_DATA>
+<GENERAL_INFO><TITLE>Incident Description</TITLE>
+<TEXT>This is a stalled DOT truck on SB 55 overpass at 405. The truck is hit by a vehicle, the vehicle is vaulted over the railing, and a 6 vehicle collision occurs below in the NB 405 lanes. The #2 and 3 lanes are blocked on SB 55 and the #1, 2, and 3 lanes are blocked on NB 405. The driver of the truck is uninjured, although there are 4 fatals, 2 major injured, and 4 minor injured in the collision below. MAIT is called to the scene to investigate the collision and a Sig Alert is declared.</TEXT>
+</GENERAL_INFO>
+<TELEPHONE><STUDENT>Places a call to CHP Dispatch to notify of stalled DOT vehicle.</STUDENT>
+</TELEPHONE>
+<MAINTENANCE_RADIO>Dispatch, this is xxx. I'm on south 55 at the 405. My truck is out of service here, stuck in the lane. I need CHP assistance ASAP!"</MAINTENANCE_RADIO>
+</SCRIPT_EVENT>
+</TMC_SCRIPT>
