Index: trunk/test/tmcsim/cadsimulator/managers/TrafficModelManagerTest.java
===================================================================
--- trunk/test/tmcsim/cadsimulator/managers/TrafficModelManagerTest.java	(revision 204)
+++ trunk/test/tmcsim/cadsimulator/managers/TrafficModelManagerTest.java	(revision 204)
@@ -0,0 +1,77 @@
+
+package tmcsim.cadsimulator.managers;
+
+import atmsdriver.model.TrafficEvent;
+import java.text.ParseException;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Scanner;
+import junit.framework.TestCase;
+import tmcsim.common.SimulationException;
+
+/**
+ *
+ * @author jdalbey
+ */
+public class TrafficModelManagerTest extends TestCase
+{
+    
+    public TrafficModelManagerTest(String testName)
+    {
+        super(testName);
+    }
+    
+    @Override
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+    }
+    
+    @Override
+    protected void tearDown() throws Exception
+    {
+        super.tearDown();
+    }
+
+    /**
+     * Test of readBatchFile method, of class TrafficModelManager.
+     */
+    public void testReadBatchFile() throws SimulationException, ParseException
+    {
+        System.out.println("readBatchFile");
+        String alpha = "181 00:00:01 405 N 2.2 20.1 Y";
+        String bravo = "187 00:00:37  55 S 6.88 0.2 R";
+        String dataIn = alpha + "\n" + bravo + "\n";
+        Scanner scan = new Scanner(dataIn);
+        TrafficEvent evtA = new TrafficEvent(alpha);
+        TrafficEvent evtB = new TrafficEvent(bravo);
+        
+        LinkedList<TrafficEvent> expResult = new LinkedList<TrafficEvent>();
+        expResult.add(evtA);
+        expResult.add(evtB);
+        
+        LinkedList<TrafficEvent> result = TrafficModelManager.readBatchFile(scan);
+        assertEquals(expResult, result);
+    }
+    
+    public void testCreateIncidentMap() throws ParseException
+    {
+        System.out.println("createIncidentMap");
+        String alpha = "181 00:00:01 405 N 2.2 20.1 Y";
+        String bravo = "187 00:00:37  55 S 6.88 0.2 R";
+        String dataIn = alpha + "\n" + bravo + "\n";
+        Scanner scan = new Scanner(dataIn);
+        TrafficEvent evtA = new TrafficEvent(alpha);
+        TrafficEvent evtB = new TrafficEvent(bravo);
+      
+        LinkedList<TrafficEvent> eventQueue = TrafficModelManager.readBatchFile(scan);
+        // Extract the incidents and create a map
+        Map<String, List<TrafficEvent>> incidents;
+        incidents = TrafficModelManager.createIncidentMap(eventQueue);
+        System.out.println(""+incidents.keySet());
+        assertTrue(incidents.keySet().contains("181"));
+        assertTrue(incidents.keySet().contains("187"));
+    }
+ 
+}
Index: trunk/test/atmsdriver/TrafficModelEventDriver.java
===================================================================
--- trunk/test/atmsdriver/TrafficModelEventDriver.java	(revision 194)
+++ trunk/test/atmsdriver/TrafficModelEventDriver.java	(revision 204)
@@ -6,12 +6,9 @@
 import java.io.FileNotFoundException;
 import java.rmi.RemoteException;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collections;
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Scanner;
 import java.util.logging.Level;
@@ -19,9 +16,17 @@
 import javax.swing.JOptionPane;
 import javax.swing.JWindow;
+import tmcsim.cadsimulator.managers.TrafficModelManager;
+import tmcsim.common.SimulationException;
 
 /**
- * Skeleton for ATMS Driver that reads a "batch" file of highway status update
- * commands.  A console display of the highway network is output
+ * Read and process all Traffic Events in a file and show
+ * resulting highway network. 
+ * A console display of the highway network is output
  * for each event.
+ * This application is used by Traffic Event authors to assist
+ * in verifying the correctness of their data file.
+ * Because the output is sent immediately to the console the
+ * author doesn't have to sit through simulation time to
+ * observe dots changing on ATMS client.
  * @author jdalbey
  */
@@ -51,5 +56,5 @@
      *
      */
-    public TrafficModelEventDriver() throws RemoteException
+    public TrafficModelEventDriver() throws RemoteException, SimulationException
     {
         // Initialize the highway model
@@ -57,9 +62,24 @@
         highways = new Highways(
                 "config/vds_data/highways_fullmap.txt",
-                //        "192.168.251.46", 8080);  //IP address of FEP Sim Linux VM
+                // following aren't used by this application
                 "localhost", 8080);
+        final String CONFIG_FILE_NAME = "traffic_model_config.properties";
+        String propertiesFile = "config" + System.getProperty("file.separator") 
+                 + CONFIG_FILE_NAME;
+        Properties props = TrafficModelManager.loadProperties(propertiesFile);
 
-        // READ THE BATCH FILE OF COMMANDS and put in a queue
-        readBatchFile();
+        FileInputStream fis = null;
+        try
+        {
+            fis = new FileInputStream(props.getProperty("Events_File"));
+        } catch (FileNotFoundException ex)
+        {
+            Logger.getLogger(TrafficModelManager.class.getName()).log(Level.SEVERE, null, 
+                    "Missing Traffic Events file " + props.getProperty("Events_File"));
+            System.exit(-1);
+        }
+        Scanner fileScanner = new Scanner(fis);        
+        // Read all lines from the file of events and put in a queue
+        eventQueue = TrafficModelManager.readBatchFile(fileScanner);
     }
     public void run()
@@ -78,57 +98,4 @@
             eventQueue.remove();
         }
-    }
-
-    private void readBatchFile()
-    {
-        FileInputStream fis;
-        try
-        {
-            fis = new FileInputStream("config/vds_data/atmsBatchEvents.txt");
-            eventQueue = new LinkedList<TrafficEvent>();
-            // Read all lines from the file of events
-            Scanner scan = new Scanner(fis);
-            while (scan.hasNext())
-            {
-                // Read a line and add it to the event queue
-                String line = scan.nextLine().trim();
-                if (line.charAt(0) != '#')
-                {
-                    TrafficEvent evt;
-                    try
-                    {
-                        evt = new TrafficEvent(line);
-                        eventQueue.add(evt);
-                        String incident = evt.incident;
-                        // Add the line to the list for the corresponding incident
-                        List evtList;
-                        if (incidents.containsKey(evt.incident))
-                        {
-                            evtList = incidents.get(evt.incident);
-                        }
-                        else
-                        {
-                            evtList = new ArrayList<String>();
-                        }
-                        evtList.add(evt);
-                        // and put it back in the map
-                        incidents.put(incident, evtList);
-                    }
-                    catch (ParseException ex)
-                    {
-                        Logger.getLogger(TrafficModelEventDriver.class.getName()).log(Level.SEVERE, null, ex);
-                        System.out.println("Wrong format data in batch event file: " + line + " \nskipping.");
-                        System.out.println("Skipping badly formatted event.");
-                    }
-                }
-            }
-        }
-        catch (FileNotFoundException ex)
-        {
-            Logger.getLogger(TrafficModelEventDriver.class.getName()).log(Level.SEVERE, null, ex);
-        }
-        System.out.println("Events file read, " + eventQueue.size() + " events queued.");
-        // Put the events in chronological order
-        Collections.sort(eventQueue);
     }
 
Index: trunk/src/tmcsim/cadsimulator/managers/TrafficModelManager.java
===================================================================
--- trunk/src/tmcsim/cadsimulator/managers/TrafficModelManager.java	(revision 197)
+++ trunk/src/tmcsim/cadsimulator/managers/TrafficModelManager.java	(revision 204)
@@ -47,5 +47,5 @@
      * Error Logger.
      */
-    private static Logger atmsLogger = Logger.getLogger("tmcsim.cadsimulator.managers");
+    private static Logger logger = Logger.getLogger("tmcsim.cadsimulator.managers");
 
     /**
@@ -56,15 +56,6 @@
     private static enum PROPERTIES
     {
-        /**
-         *
-         */
         HIGHWAYS_MAP_FILE("Highways_Map_File"),
-        /**
-         *
-         */
         FEPSIM_IP_ADDR("FEPSim_IP_addr"),
-        /**
-         *
-         */
         EVENTS_FILE("Events_File"),
         OUTPUT_DEST("Output_Destination");
@@ -82,5 +73,5 @@
      * Properties Object.
      */
-    private Properties atmsProperties = null;
+    private Properties props = null;
     /**
      * Highways in traffic network
@@ -113,21 +104,29 @@
             throws SimulationException 
     {
-        if (!loadProperties(propertiesFile))
-        {
-            System.exit(0);
-        }
-//        final Coordinator theCoordinator = theCoordinator;
+        props = loadProperties(propertiesFile);
         // Initialize the highway model
         incidents = new HashMap<String, List<TrafficEvent>>();
         highways = new Highways(
-                atmsProperties.getProperty(PROPERTIES.HIGHWAYS_MAP_FILE.name),
-                //"config/vds_data/highways_fullmap.txt",
-                //        "192.168.251.46", 8080);  //IP address of FEP Sim Linux VM
-                atmsProperties.getProperty(PROPERTIES.FEPSIM_IP_ADDR.name),
+                props.getProperty(PROPERTIES.HIGHWAYS_MAP_FILE.name),
+                props.getProperty(PROPERTIES.FEPSIM_IP_ADDR.name),
                 8080); 
 
-        // READ THE BATCH FILE OF COMMANDS and put in a queue
-        eventQueue = readBatchFile();
-        // Launch the display
+        // Read the text file of events and put in a queue
+        FileInputStream fis = null;
+        try
+        {
+            fis = new FileInputStream(props.getProperty(PROPERTIES.EVENTS_FILE.name));
+        } catch (FileNotFoundException ex)
+        {
+            Logger.getLogger(TrafficModelManager.class.getName()).log(Level.SEVERE, null, 
+                    "Missing Traffic Events file " + props.getProperty(PROPERTIES.EVENTS_FILE.name));
+            System.exit(-1);
+        }
+        // Read all lines from the file of events
+        Scanner fileScanner = new Scanner(fis);        
+        eventQueue = readBatchFile(fileScanner);
+        // Extract the incidents and create a map
+        incidents = createIncidentMap(eventQueue);
+        // Launch the GUI display
         theView = new TrafficModelViewer(this, new ArrayList<String>(incidents.keySet()));
         theView.setVisible(true);
@@ -147,5 +146,5 @@
                 {
                     long simtime = theCoordinator.getCurrentSimulationTime();
-                    currentClock = formatInterval(simtime);
+                    currentClock = formatTimeInSeconds(simtime);
                     // For Debugging, show the ATMS time
 //                    long ATMStime = theCoorInt.getATMStime();       
@@ -159,8 +158,7 @@
                     {
                         Logger.getLogger(TrafficModelManager.class.getName()).log(Level.SEVERE, null, ex);
-                        System.out.println("Invalid simulation clock time found in ATMSDriverClient");
+                        System.out.println("Invalid simulation clock time found");
                         System.exit(-1);
                     }
-                    //System.out.println("Current clock: " + currentClock);
                 }
                 catch (RemoteException ex)
@@ -175,5 +173,4 @@
                     TrafficEvent nextEvent = eventQueue.peek();
                     Date eventTime = nextEvent.eventDate;
-                    //System.out.println("Next event will be launched at: " + formatter.format(eventTime));
                     // Check the queue of events to see if the first
                     // item should be launched.  IF so, 
@@ -195,5 +192,5 @@
         timer.start();
 
-        if (atmsProperties.getProperty(PROPERTIES.OUTPUT_DEST.name).equals("FEP"))
+        if (props.getProperty(PROPERTIES.OUTPUT_DEST.name).equals("FEP"))
         {
             // Start the FEP thread (to update ATMS every 30 sec). (See class def below)
@@ -210,64 +207,49 @@
 
     /**
-     * This method verifies that the CAD Simulator Host and Port values are not
-     * null. Also, if a CAD Position or User ID do not exist in the properties
-     * file, the user is prompted to enter values. These values are written to
-     * the properties file. If the user cancels the process of entering these
-     * values, the verification fails.
+     * This method verifies that the needed configuration properties are not
+     * null. 
      *
      * @param propertiesFile File path (absolute or relative) to the properties
      * file containing configuration data.
-     * @return True if the properties file is valid, false if not.
+     * @return The Properties loaded
      * @throws SimulationException if there is an exception in verifying the
-     * properties file, or if the user cancels input.
-     */
-    private boolean loadProperties(String propertiesFile)
+     * properties file
+     */
+    public static Properties loadProperties(String propertiesFile)
             throws SimulationException
     {
+        Properties props;
         // Load the properties file.
         try
         {
-            atmsProperties = new Properties();
-            atmsProperties.load(new FileInputStream(propertiesFile));
+            props = new Properties();
+            props.load(new FileInputStream(propertiesFile));
 
         } catch (Exception e)
         {
-            atmsLogger.logp(Level.SEVERE, "TrafficModelManager", "Constructor",
-                    "Exception in parsing properties file.", e);
-            throw new SimulationException(SimulationException.INITIALIZE_ERROR,
-                    e);            
-        }
-
+            throw new SimulationException(SimulationException.INITIALIZE_ERROR);
+        }
 
         // Ensure that the properties file does not have null values for the
         // required information.
-        if (atmsProperties.getProperty(PROPERTIES.HIGHWAYS_MAP_FILE.name) == null
-                || atmsProperties.getProperty(PROPERTIES.FEPSIM_IP_ADDR.name) == null
-                || atmsProperties.getProperty(PROPERTIES.EVENTS_FILE.name) == null
-                || atmsProperties.getProperty(PROPERTIES.OUTPUT_DEST.name) == null)
-        {
-            atmsLogger.logp(Level.SEVERE, "TrafficModelManager",
-                    "Constructor", "Null value in properties file.");
+        if (props.getProperty(PROPERTIES.HIGHWAYS_MAP_FILE.name) == null
+                || props.getProperty(PROPERTIES.FEPSIM_IP_ADDR.name) == null
+                || props.getProperty(PROPERTIES.EVENTS_FILE.name) == null
+                || props.getProperty(PROPERTIES.OUTPUT_DEST.name) == null)
+        {
+            System.out.println("Missing property value in "+propertiesFile);
             throw new SimulationException(SimulationException.INITIALIZE_ERROR);
         }
 
-        return true;
+        return props;
     }
     /**
      * Read a file of traffic events.  
+     * @param filename the name of the events file
      * @return the chronologically ordered list of events
      */
-    // Method is package private to facilitate unit testing.
-    LinkedList<TrafficEvent> readBatchFile()
-    {
-        FileInputStream fis;
+    public static LinkedList<TrafficEvent> readBatchFile(Scanner scan)
+    {
         LinkedList<TrafficEvent> eventList = new LinkedList<TrafficEvent>();
-        try
-        {
-            fis = new FileInputStream(
-                    //"config/vds_data/atmsBatchEvents.txt");
-            atmsProperties.getProperty(PROPERTIES.EVENTS_FILE.name));
-            // Read all lines from the file of events
-            Scanner scan = new Scanner(fis);
             while (scan.hasNext())
             {
@@ -281,18 +263,4 @@
                         evt = new TrafficEvent(line);
                         eventList.add(evt);
-                        String incident = evt.incident;
-                        // Add the line to the list for the corresponding incident
-                        List evtList;
-                        if (incidents.containsKey(evt.incident))
-                        {
-                            evtList = incidents.get(evt.incident);
-                        }
-                        else
-                        {
-                            evtList = new ArrayList<String>();
-                        }
-                        evtList.add(evt);
-                        // and put it back in the map
-                        incidents.put(incident, evtList);
                     }
                     catch (ParseException ex)
@@ -304,9 +272,4 @@
                 }
             }
-        }
-        catch (FileNotFoundException ex)
-        {
-            Logger.getLogger(TrafficModelManager.class.getName()).log(Level.SEVERE, null, ex);
-        }
         System.out.println("Events file read, " + eventList.size() + " events queued.");
         // Put the events in chronological order
@@ -315,4 +278,26 @@
     }
 
+    static Map<String, List<TrafficEvent>> createIncidentMap(LinkedList<TrafficEvent> eventList)
+    {
+        Map<String, List<TrafficEvent>> incidents = new HashMap<String, List<TrafficEvent>>();
+        for (TrafficEvent evt: eventList)
+        {
+            // Add the line to the list for the corresponding incident
+            List evtList;
+            if (incidents.containsKey(evt.incident))
+            {
+                evtList = incidents.get(evt.incident);
+            }
+            else
+            {
+                evtList = new ArrayList<String>();
+            }
+            evtList.add(evt);
+            // and put it back in the map
+            incidents.put(evt.incident, evtList);
+        }        
+        return incidents;
+    }
+    
     /**
      * Clear an incident. For each event associated with an incident, turn the
@@ -349,12 +334,12 @@
      * Format a time in seconds as HH:MM:SS
      *
-     * @param l
-     * @return
-     */
-    private String formatInterval(final long l)
-    {
-        final long hr = TimeUnit.SECONDS.toHours(l);
-        final long min = TimeUnit.SECONDS.toMinutes(l - TimeUnit.HOURS.toSeconds(hr));
-        final long sec = TimeUnit.SECONDS.toSeconds(l - TimeUnit.HOURS.toSeconds(hr) - TimeUnit.MINUTES.toSeconds(min));
+     * @param seconds
+     * @return HH:MM:SS formatted string
+     */
+    public static String formatTimeInSeconds(final long seconds)
+    {
+        final long hr = TimeUnit.SECONDS.toHours(seconds);
+        final long min = TimeUnit.SECONDS.toMinutes(seconds - TimeUnit.HOURS.toSeconds(hr));
+        final long sec = TimeUnit.SECONDS.toSeconds(seconds - TimeUnit.HOURS.toSeconds(hr) - TimeUnit.MINUTES.toSeconds(min));
         return String.format("%02d:%02d:%02d", hr, min, sec);
     }
@@ -384,5 +369,5 @@
         catch (Exception e)
         {
-            atmsLogger.logp(Level.SEVERE, "SimulationManager", "Main",
+            logger.logp(Level.SEVERE, "SimulationManager", "Main",
                     "Error initializing application.");
 
@@ -409,5 +394,5 @@
                 try
                 {
-                    Thread.sleep(1000);
+                    Thread.sleep(5000);
                 }
                 catch (InterruptedException ie)
Index: trunk/src/atmsdriver/model/TrafficEvent.java
===================================================================
--- trunk/src/atmsdriver/model/TrafficEvent.java	(revision 197)
+++ trunk/src/atmsdriver/model/TrafficEvent.java	(revision 204)
@@ -6,4 +6,5 @@
 import java.util.Date;
 import java.util.Scanner;
+
 
 /**
@@ -27,4 +28,5 @@
     public final double range;
     public final String rawString;
+    
     private final static SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
 
@@ -61,3 +63,19 @@
         return rawString;
     }
+    @Override 
+    public boolean equals(Object other)
+    {
+        Boolean result = false;
+        if (other == null) return false;
+        if ( other instanceof TrafficEvent  )
+        {
+          TrafficEvent that = (TrafficEvent) other;
+          result = that.incident.equals(this.incident)
+                  && that.eventTime.equals(this.eventTime)
+                  && ((int) that.postmile) == ((int) this.postmile)
+                  && that.dir == this.dir
+                  && that.color == this.color;
+        }
+        return result;    
+    }            
 }
