Changeset 228 in tmcsimulator for trunk


Ignore:
Timestamp:
11/06/2017 03:27:20 PM (8 years ago)
Author:
jdalbey
Message:

System Tests updated to work with new integrated Traffic Mgr. All system tests now passing.

Location:
trunk
Files:
1 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/atmsdriver/model/Highways.java

    r212 r228  
    350350            // close the socket 
    351351            sock.close(); 
     352        } catch (java.net.ConnectException ex) 
     353        { 
     354            //Logger.getLogger(Highways.class.getName()).log(Level.SEVERE, null, ex); 
     355            System.out.println("writeToFEP() can't connect, no data sent to FEP."); 
     356            throw new SimulationException(SimulationException.BINDING); 
    352357        } catch (IOException ex) 
    353358        { 
    354             Logger.getLogger(Highways.class.getName()).log(Level.SEVERE, null, ex); 
     359            //Logger.getLogger(Highways.class.getName()).log(Level.SEVERE, null, ex); 
    355360            System.out.println("Highway Model failed writing to FEPSim."); 
    356361            throw new SimulationException(SimulationException.BINDING); 
  • trunk/src/tmcsim/application.properties

    r227 r228  
    1 #Sun, 05 Nov 2017 09:02:37 -0700 
     1#Mon, 06 Nov 2017 15:57:48 -0800 
    22 
    3 Application.revision=226 
     3Application.revision=227 
    44 
    5 Application.buildnumber=78 
     5Application.buildnumber=82 
  • trunk/src/tmcsim/cadsimulator/managers/TrafficModelManager.java

    r220 r228  
    8585     * Highways in traffic network 
    8686     */ 
    87     final private Highways highways; 
     87    private Highways highways; 
    8888 
    8989    /** 
     
    100100     */ 
    101101    private String currentClock = ""; 
    102      
    103     
     102       
    104103    /** 
    105104     * Constructor. Loads the Properties file and initializes the 
     
    113112            throws SimulationException  
    114113    { 
    115         props = loadProperties(propertiesFile); 
    116         // Initialize the highway model 
    117         incidents = new HashMap<String, List<TrafficEvent>>(); 
    118         highways = new Highways( 
    119                 props.getProperty(PROPERTIES.HIGHWAYS_MAP_FILE.name), 
    120                 props.getProperty(PROPERTIES.FEPSIM_IP_ADDR.name), 
    121                 8080);  
    122         this.theCoordinator = theCoordinator; 
     114        try  
     115        { 
     116            props = loadProperties(propertiesFile); 
     117            // Initialize the highway model 
     118            incidents = new HashMap<String, List<TrafficEvent>>(); 
     119            highways = new Highways( 
     120                    props.getProperty(PROPERTIES.HIGHWAYS_MAP_FILE.name), 
     121                    props.getProperty(PROPERTIES.FEPSIM_IP_ADDR.name), 
     122                    8080);  
     123            this.theCoordinator = theCoordinator; 
     124        } 
     125        catch (Exception e)  
     126        { 
     127            logger.logp(Level.SEVERE, "Traffic Manager", "Constructor", 
     128                    "Exception in parsing properties file.", e); 
     129        } 
    123130    } 
    124131    /** 
     
    129136    { 
    130137        loadEvents(); 
    131          
     138 
    132139        // Create a timer that fetches the simulation time every second. 
    133140        Timer timer = new Timer(ONE_SECOND, new ActionListener() 
     
    201208            wtConsole.start(); 
    202209        } 
    203          
    204210    } 
    205211    /** Accessor to event queue 
     
    421427            System.out.println("WriteToFEP Thread starting."); 
    422428            // Run indefinitely 
    423             while (true) 
     429            boolean running = true; 
     430            while (running) 
    424431            { 
    425432                try 
     
    431438                { 
    432439                    // Ask user if they want to proceed without FEP Sim connection 
    433                     int reply = JOptionPane.showConfirmDialog(null, "Failed to connect to FEP Sim, proceed anyway?", "Network Failure", JOptionPane.YES_NO_OPTION); 
    434                     if (reply == JOptionPane.NO_OPTION) 
    435                     { 
    436                         System.exit(0); 
    437                     } 
     440//                    int reply = JOptionPane.showConfirmDialog(null, "Failed to connect to FEP Sim, proceed anyway?", "Network Failure", JOptionPane.YES_NO_OPTION); 
     441//                    if (reply == JOptionPane.NO_OPTION) 
     442//                    { 
     443//                        System.exit(0); 
     444//                    } 
    438445                    System.out.println("Skipping writeToFEP..."); 
     446                    running = false; 
    439447                } 
    440448 
  • trunk/test/atmsdriver/model/HighwaysTest.java

    r213 r228  
    8686        String result = highways.toString(); 
    8787        System.out.println(result); 
    88         assertEquals(expToString, result); 
    89     } 
    90     String expToString =  
    91         "241 ------------------------------------------------------------\n" 
    92        +"  5 @-------------------------------------------------------------------------------------------------------------------------------------------\n" 
    93        +"405 --------------------------------------------------------------------------------\n" 
    94        +"133 ----------------\n" 
    95        +"261 -----------------\n" 
    96        +" 22 ----------------------------------\n" 
    97        +" 55 ------------------------------------------\n" 
    98        +" 73 -----------------------------------------------------\n" 
    99        +" 57 ------------------------------------------\n" 
    100        +" 91 --------------------------------------------------------------\n" 
    101        +"605 ---\n"; 
     88        assertTrue(result.startsWith(expToString1)); 
     89    } 
     90    String expToString1 =  
     91    "241 N -- ------ -- ------- -------------------------------------  \n" + 
     92"241 S   - --- --  --------- ------------------------------------  \n" + 
     93"  5 N  - - ------ ---  --- -- --- ----  - -- - -  -- - - -    -- -- - ---- -- -- --- - - -- -  ----- ----- --- -  - -- --  - - ---- - - - ------- \n" + 
     94"  5 S @--"; 
     95 
     96    
    10297 
    10398     
  • trunk/test/tmcsim/cadsimulator/CADSimulatorConsoleTest.java

    r123 r228  
    271271            + "ParamicsProperties     = pconfig.txt\n" 
    272272            + "ATMSProperties         = empty.txt\n" 
     273            + "TrafficMgrProperties   = tconfig.txt\n" 
    273274            + "MediaProperties        = empty.txt\n"; 
     275    static final String trafficMgrData = "Highways_Map_File = config/vds_data/highways_fullmap.txt\n" 
     276            +"Events_File = config/vds_data/atmsBatchEvents.txt\n" 
     277            +"FEPSim_IP_addr = localhost\n" 
     278            +"Output_Destination = Console\n"; 
    274279    static final String paramicsData = "ParamicsCommHost = 127.0.0.1\n" 
    275280            + "ParamicsCommPort       = 4450\n" 
     
    295300        // Redirect the standard output 
    296301//        System.setOut(ps); 
     302        File cf = new File ("config.txt"); 
     303        cf.delete(); 
    297304        writedata("config.txt", configData); 
     305        writedata("tconfig.txt", trafficMgrData); 
    298306        writedata("pconfig.txt", paramicsData); 
    299307        writedata("empty.txt", ""); 
  • trunk/test/tmcsim/cadsimulator/CADSimulatorGUITest.java

    r123 r228  
    9494        // Create a UISpec window from the CADSimulator's Viewer (gui) 
    9595//        cadwindow = new Window((CADSimulatorViewer) app.theViewer); 
    96         assertTrue("Title bar incorrect", cadwindow.getTitle().startsWith("CAD Simulator revision:")); 
     96        assertTrue("Title bar incorrect", cadwindow.getTitle().startsWith("CAD Server revision:")); 
    9797        Panel mainPanel = cadwindow.getPanel("contentPane"); 
    9898        TextBox txtStatus = mainPanel.getTextBox("simulationStatus"); 
  • trunk/test/tmcsim/cadsimulator/viewer/CADSimulatorViewModelTest.java

    r124 r228  
    4040    { 
    4141        String actual; 
    42         assertTrue("Title bar incorrect", cadwindow.getTitle().trim().startsWith("CAD Simulator")); 
     42        assertTrue("Title bar incorrect", cadwindow.getTitle().trim().startsWith("CAD Server")); 
    4343        TextBox txtStatus = mainPanel.getTextBox("simulationStatus"); 
    4444        actual = txtStatus.getText().trim(); 
  • trunk/test/tmcsim/simulationmanager/SimulationManagerSmokeTest.java

    r123 r228  
    6767 
    6868        // Check CAD Simulator appears with no script and nothing connected 
    69         assertTrue("Window title incorrect", cadwindow.getTitle().startsWith("CAD Simulator")); 
     69        assertTrue("Window title incorrect", cadwindow.getTitle().startsWith("CAD Server")); 
    7070        Panel mainPanel = cadwindow.getPanel("contentPane"); 
    7171        TextBox txtStatus = mainPanel.getTextBox("simulationStatus"); 
Note: See TracChangeset for help on using the changeset viewer.