Changeset 252 in tmcsimulator for trunk


Ignore:
Timestamp:
02/09/2019 07:33:51 PM (7 years ago)
Author:
jdalbey
Message:

HighwaysTest?.java: Add test method "testApplyColor" which currently fails to reveal defect in applyColorToHighwayStretch method.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/atmsdriver/model/HighwaysTest.java

    r248 r252  
    8787        System.out.println(result); 
    8888        assertTrue(result.startsWith(expToString1)); 
     89        highways.applyColorToHighwayStretch(241, Station.DIRECTION.NORTH, 20.13, 4.0, LoopDetector.DOTCOLOR.RED); 
     90        result = highways.toString(); 
     91        assertEquals("241 N @@ @@@@@-",result.substring(0,15)); 
    8992    } 
    9093    String expToString1 =  
     
    99102                "test/atmsdriver/model/ldssample.txt", 
    100103                "localhost", 8080); 
    101         //highways.getHighwayByRouteNumber(5).stations.get(0).loops.get(0).vol = 1; 
    102104        String result = highways.toJson(); 
    103105        System.out.println(result); 
     
    105107    } 
    106108    
    107  
     109    public void testApplyColor() 
     110    { 
     111        System.out.println("apply color"); 
     112        Highways highways = new Highways( 
     113            "test/atmsdriver/model/ldssample.txt", 
     114            "localhost", 8080); 
     115        highways.applyColorToHighwayStretch(5, Station.DIRECTION.SOUTH, 0.9, 2.0, LoopDetector.DOTCOLOR.RED); 
     116        String result = highways.toString(); 
     117        assertEquals("5 S @@@", result.trim()); 
     118        highways.applyColorToHighwayStretch(241, Station.DIRECTION.NORTH, 20.13, 4.0, LoopDetector.DOTCOLOR.RED); 
     119        result = highways.toString(); 
     120        assertEquals("241 N @@ @@@@@-",result.substring(0,15)); 
     121 
     122    }             
    108123     
    109124    public void testToCondensedFormat() 
Note: See TracChangeset for help on using the changeset viewer.