Warning: Can't use blame annotator:
svn blame failed on trunk/test/atmsdriver/model/StationTest.java: ("Can't find a temporary directory: Internal error", 20014)

source: tmcsimulator/trunk/test/atmsdriver/model/StationTest.java @ 103

Revision 103, 2.0 KB checked in by jtorres, 9 years ago (diff)

trunk/src/atmsdriver/ConsoleDriver.java: Created console driver for ATMSDriver, completed and very nice. Still need to apply correct vol/occ values to actually change the colors. Still need to write a JUnit test for it. trunk/src/atmsdriver/ATMSDriver.java: Refactored to run the console driver. ATMSDriver runs in thread, console driver runs, and they share the highways instance. Renamed NetworkLoader?.java to FEPLineLoader.java. trunk/src/atmsdriver/model/Highways.java: refactored loadHighways() method to conform to new undirected highway abstraction. trunk/src/atmsdriver/model/Station.java: added updateByDirection(DIRECTION dir) method and supporting utility methods. trunk/test/atmsdriver/model/LoadHighwaysTest.java: Conformed LoadHighways? test to new undirected highway abstraction. trunk/test/atmsdriver/model/StationTest.java: Conformed StationTest?.java to new changes - very minor stuff. Went through all model classes and changed any final privates with a getter method to final public, for good OOP practice and simplicity. Went through ALL FILES and commented everything very well. minor application custom configuration changes. Removed all .class or .o.d files from svn repository

RevLine 
1
2package atmsdriver.model;
3
4import atmsdriver.model.Station.DIRECTION;
5import java.util.ArrayList;
6import junit.framework.TestCase;
7import org.w3c.dom.Element;
8
9/**
10 *
11 * @author jdalbey
12 */
13public class StationTest extends TestCase {
14    Station alpha;
15    public StationTest(String testName) {
16        super(testName);
17    }
18   
19    @Override
20    protected void setUp() throws Exception {
21        super.setUp();
22        alpha = new Station(1,2,3,"A",new ArrayList<LoopDetector>(), 4, DIRECTION.NORTH, 1.0);
23    }
24   
25    @Override
26    protected void tearDown() throws Exception {
27        super.tearDown();
28    }
29
30    /**
31     * Test of getHighwayNumber method, of class Station.
32     */
33    public void testGetHighwayNumber() {
34        System.out.println("getHighwayNumber");
35        assertEquals(4, alpha.routeNumber);
36    }
37
38    /**
39     * Test of getDirection method, of class Station.
40     */
41    public void testGetDirection() {
42        System.out.println("getDirection");
43        assertEquals(DIRECTION.NORTH, alpha.direction);
44    }
45
46    /**
47     * Test of getStationMeta method, of class Station.
48     */
49    public void testGetStationMeta() {
50        System.out.println("getStationMeta");
51        String expResult = "2 3 4 N 1.0 0 A\n";
52        String result = alpha.getStationMeta();
53        assertEquals(expResult, result);
54    }
55
56    /**
57     * Test of getPostmile method, of class Station.
58     */
59    public void testGetPostmile() {
60        System.out.println("getPostmile");
61        assertEquals(1.0, alpha.postmile,0.1);
62    }
63
64    /**
65     * Test of compareTo method, of class Station.
66     */
67    public void testCompareTo() {
68        System.out.println("compareTo");
69        Station beta = new Station(1,2,3,"B",new ArrayList<LoopDetector>(), 4, DIRECTION.NORTH, 2.0);
70        int expResult = 0;
71        assertEquals(-1, alpha.compareTo(beta));
72        assertEquals(1, beta.compareTo(alpha));
73        assertEquals(0, beta.compareTo(beta));
74    }
75
76    /**
77     * TODO: Test of toXML method, of class Station.
78     */
79   
80}
Note: See TracBrowser for help on using the repository browser.