Changeset 160 in tmcsimulator
- Timestamp:
- 10/22/2017 12:55:32 PM (9 years ago)
- File:
-
- 1 copied
-
trunk/test/atmsdriver/model/LoadSadDotsTest.java (copied) (copied from trunk/test/atmsdriver/model/LoadHighwaysTest.java) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/atmsdriver/model/LoadSadDotsTest.java
r103 r160 13 13 * @author jdalbey 14 14 */ 15 public class Load HighwaysTest extends TestCase {15 public class LoadSadDotsTest extends TestCase { 16 16 17 public Load HighwaysTest(String testName) {17 public LoadSadDotsTest(String testName) { 18 18 super(testName); 19 19 } … … 27 27 28 28 writer.println("lds_id line drop sch lineinfo system_key sch_seq glo_seq count freeway Dir ca_pm lds_name"); 29 writer.println("1203081 6 17 2 2 1123005691 26491 1357639 19 55 N 4.58 BRISTOL"); 30 writer.println("1210163 6 20 2 2 1123005691 26491 1357639 19 55 N 5.51 PAULARINO 1"); 31 writer.println("1203244 50 4 13 13 1123005873 24148 1357650 19 55 N 10 MCFADDEN"); 32 writer.println("1203211 50 5 13 13 1123005873 24148 1357650 19 55 N 9.41 EDINGER 2"); 33 34 writer.println("1203261 23 14 23 21 1123005995 26479 1357626 18 55 S 10.4 S OF 5"); 35 writer.println("1203083 6 18 2 2 1123005691 26491 1357639 19 55 S 4.7 BAKER 1"); 36 writer.println("1210174 6 19 2 2 1123005691 26491 1357639 19 55 S 5.06 BAKER 2"); 37 writer.println("1203270 23 15 23 21 1123005995 26479 1357626 18 55 S 10.5 N OF 5"); 38 39 writer.println("1205238 22 16 4 4 1123005726 26490 1357624 19 5 S 32.25 17TH 1"); 40 writer.println("1205208 22 17 4 4 1123005726 26490 1357624 19 5 S 31.6 GRAND 1"); 41 writer.println("1205270 5 19 1 1 1123005673 26492 1357648 20 5 S 33 MAIN 1 "); 42 43 29 writer.println("1205146 50 3 13 13 1123005873 24148 1357650 19 5 N 29.79 NEWPORT"); 30 writer.println("1201190 46 6 36 36 1123006209 26472 1357644 20 405 S 4.03 JEFFREY 2"); 44 31 writer.close(); 45 32 } catch (Exception e) { … … 70 57 assertEquals(2, result.size()); 71 58 72 // Test 5 5N was loaded59 // Test 5 N was loaded 73 60 Highway fiftyfiveN = result.get(0); 74 assertEquals(new Integer(5 5), fiftyfiveN.routeNumber);61 assertEquals(new Integer(5), fiftyfiveN.routeNumber); 75 62 76 // Test 55 N stations are sorted by postmile77 63 ArrayList<Station> stations = fiftyfiveN.stations; 78 ArrayList<Double> stationsPostmiles = new ArrayList<>(); 79 for(Station station : stations) 80 { 81 stationsPostmiles.add(station.postmile); 82 } 83 84 // Create expected station postmile list (sorted) 85 ArrayList<Double> expectedStationsPostmiles = new ArrayList<>(); 86 expectedStationsPostmiles.add(new Double(4.58)); 87 expectedStationsPostmiles.add(new Double(4.7)); 88 expectedStationsPostmiles.add(new Double(5.06)); 89 expectedStationsPostmiles.add(new Double(5.51)); 90 expectedStationsPostmiles.add(new Double(9.41)); 91 expectedStationsPostmiles.add(new Double(10)); 92 expectedStationsPostmiles.add(new Double(10.4)); 93 expectedStationsPostmiles.add(new Double(10.5)); 94 for(int i = 0; i < 8; i++) 95 { 96 assertEquals(expectedStationsPostmiles.get(i), 97 stationsPostmiles.get(i)); 98 } 99 100 // Test 55 S was loaded 101 Highway fiftyfiveS = result.get(1); 102 assertEquals(new Integer(5), fiftyfiveS.routeNumber); 103 104 // Test 55 S stations are sorted by postmile 105 stations = fiftyfiveS.stations; 106 stationsPostmiles.clear(); 107 for(Station station : stations) 108 { 109 stationsPostmiles.add(station.postmile); 110 } 111 expectedStationsPostmiles.clear(); 112 expectedStationsPostmiles.add(new Double(31.6)); 113 expectedStationsPostmiles.add(new Double(32.25)); 114 expectedStationsPostmiles.add(new Double(33)); 115 for(int i = 0; i < 3; i++) 116 { 117 assertEquals(expectedStationsPostmiles.get(i), 118 stationsPostmiles.get(i)); 119 } 64 Station sad = stations.get(0); 65 System.out.println(""+sad.getStationMeta()); 66 assertEquals(22, sad.loops.size()); 67 68 // Test 405 S was loaded 69 Highway fourohfiveS = result.get(1); 70 assertEquals(new Integer(405), fourohfiveS.routeNumber); 71 stations = fourohfiveS.stations; 72 Station happy = stations.get(0); 73 System.out.println(""+happy.getStationMeta()); 74 assertEquals(9, happy.loops.size()); 120 75 } 121 76 }
Note: See TracChangeset
for help on using the changeset viewer.
