Changeset 471 in tmcsimulator for trunk/test/tmcsim


Ignore:
Timestamp:
07/29/2019 01:36:40 PM (7 years ago)
Author:
jdalbey
Message:

Coordinator.java: Fix defect 181 in sorting CADcomments. logging_service error messages improved.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/tmcsim/cadsimulator/CoordinatorTest.java

    r465 r471  
    3030    public void testWriteToCADLog() throws RemoteException 
    3131    { 
    32         System.out.println("write to CAD log"); 
     32        System.out.println("testing write to CAD log"); 
    3333        Coordinator coord = new Coordinator(null,"",""); 
    3434        Vector<Incident> incList = new Vector<Incident>(); 
     
    5151        List<String> result = coord.getSortedComments(incList); 
    5252        assertTrue(result != null); 
    53         assert (result.get(0).startsWith("00")); 
    54         assert (result.get(1).startsWith("01")); 
    55         assert (result.get(2).startsWith("03")); 
    56         assert (result.get(3).startsWith("10")); 
     53        assertTrue (result.get(0).startsWith("00")); 
     54        assertTrue (result.get(1).startsWith("01")); 
     55        assertTrue (result.get(2).startsWith("03")); 
     56        assertTrue (result.get(3).startsWith("10")); 
     57    }     
     58    public void testBadDataWriteToCADLog() throws RemoteException 
     59    { 
     60        System.out.println("test int conversion in write to CAD log"); 
     61        Coordinator coord = new Coordinator(null,"",""); 
     62        Vector<Incident> incList = new Vector<Incident>(); 
     63        Incident inci1 = new Incident(201, "Alpha", 10L); 
     64        Incident inci2 = new Incident(209, "Bravo", 20L); 
     65        Incident inci3 = new Incident(209, "Charly", 20L); 
     66        String[] fields1 = {"date","01:01:01","JHD","?","two"}; 
     67        String[] fields2 = {"date","99999999209","JHD","?","one"}; 
     68        String[] fields3 = {"date","INVALID","JHD","?","one"}; 
     69        inci1.addToCommentsNotesTable(fields1); 
     70        inci2.addToCommentsNotesTable(fields2); 
     71        inci2.addToCommentsNotesTable(fields3); 
     72        incList.add(inci1); 
     73        incList.add(inci2); 
     74        incList.add(inci3); 
     75        List<String> result = coord.getSortedComments(incList); 
     76        assertTrue(result != null); 
     77        assertTrue (result.get(0).startsWith("INVALID")); 
     78        assertTrue (result.get(1).startsWith("01")); 
     79        assertTrue (result.get(2).startsWith("99")); 
    5780    }     
    5881} 
Note: See TracChangeset for help on using the changeset viewer.