Changeset 657 in tmcsimulator for trunk/test/tmcsim/highwaymodel
- Timestamp:
- 09/12/2022 01:30:08 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/tmcsim/highwaymodel/LoadHighwaysTest.java
r653 r657 18 18 */ 19 19 public class LoadHighwaysTest extends TestCase { 20 // Setup a path for temp files 21 static String tmpPath = "/tmp/";// default path is for linux 22 static 23 { 24 String myOs = System.getProperty("os.name").toLowerCase(); 25 if (myOs.indexOf("win") >= 0) 26 { 27 tmpPath = "C:/TEMP/"; // alt path for Windows 28 } 29 } 20 30 21 31 public LoadHighwaysTest(String testName) { … … 28 38 PrintWriter writer = null; 29 39 try { 30 writer = new PrintWriter(new FileWriter( "/tmp/postmiles1.txt"));40 writer = new PrintWriter(new FileWriter(tmpPath + "postmiles1.txt")); 31 41 writer.println("5 S 0.9,33.408425,-117.599923,CALAFIA,0,0"); 32 42 writer.println("5 N 1.24,33.413051,-117.601964,MAGDALENA,0,0"); 33 43 writer.println("5 S 1.49,33.416348,-117.603827,EL CAMINO REAL,0,0"); 34 44 writer.close(); 35 writer = new PrintWriter(new FileWriter( "/tmp/postmiles3.txt"));45 writer = new PrintWriter(new FileWriter(tmpPath + "postmiles3.txt")); 36 46 writer.println("73 N 23.9,33.643656,-117.859875,BISON 2,0.976131,0.217185"); 37 47 writer.println("55 S 6.88,33.697495,-117.862677,MACARTHU1,-0.710326,0.703873"); … … 49 59 protected void tearDown() throws Exception { 50 60 super.tearDown(); 51 Path path = FileSystems.getDefault().getPath( "/tmp", "postmiles1.txt");61 Path path = FileSystems.getDefault().getPath(tmpPath, "postmiles1.txt"); 52 62 Files.delete(path); 53 path = FileSystems.getDefault().getPath( "/tmp", "postmiles3.txt");63 path = FileSystems.getDefault().getPath(tmpPath, "postmiles3.txt"); 54 64 Files.delete(path); 55 65 } … … 61 71 System.out.println("testLoadHighways"); 62 72 Highways highways = new Highways( 63 "/tmp/postmiles1.txt");73 tmpPath + "postmiles1.txt"); 64 74 65 75 // Test for correct number of highways … … 97 107 System.out.println("testLoadHighways2"); 98 108 Highways highways = new Highways( 99 "/tmp/postmiles3.txt");109 tmpPath + "postmiles3.txt"); 100 110 101 111 // Test for correct number of highways
Note: See TracChangeset
for help on using the changeset viewer.
