()
| 132 | } |
| 133 | |
| 134 | public void testManyMapTypeNodes() { |
| 135 | setupMapData("1,2",null,null); |
| 136 | n1.addType(1); |
| 137 | n2.addType(2); |
| 138 | |
| 139 | mbm.getInitialLocation(); |
| 140 | Path p = mbm.getPath(); |
| 141 | List<Coord> coords = p.getCoords(); |
| 142 | // should move between n1 and n2 |
| 143 | for (int i=0; i<coords.size()-1; i+= 2) { |
| 144 | assertEquals(c2, coords.get(i+1)); |
| 145 | assertEquals(c1, coords.get(i)); |
| 146 | } |
| 147 | |
| 148 | n6.addType(1); // n6 is both 1 and 2 |
| 149 | n6.addType(2); |
| 150 | |
| 151 | p = mbm.getPath(); |
| 152 | coords = p.getCoords(); |
| 153 | |
| 154 | assertEquals(c2, coords.get(0)); // starts from n2 |
| 155 | // should move route n6-n2-n1-n2... |
| 156 | for (int i=1; i<coords.size()-4; i+= 4) { |
| 157 | assertEquals(c6, coords.get(i)); |
| 158 | assertEquals(c2, coords.get(i+1)); |
| 159 | assertEquals(c1, coords.get(i+2)); |
| 160 | assertEquals(c2, coords.get(i+3)); |
| 161 | } |
| 162 | |
| 163 | } |
| 164 | |
| 165 | |
| 166 | /** |
nothing calls this directly
no test coverage detected