public void testSetComment() { BcrPosition position = format.parsePosition("TOWN,210845415855", "2115508,9081108", null); assertEquals(210845415855L, position.getAltitude()); assertEquals(2115508, position.getX()); assertEquals(9081108, position.getY()); assertNull(position.getZipCode()); assertNull(position.getCity()); assertNull(position.getStreet()); assertNull(position.getType()); assertNull(position.getComment()); assertTrue(position.isUnstructured()); position.setComment(null); assertNull(position.getComment()); }
public void testReadComment() throws IOException { StringWriter writer = new StringWriter(); format.write(route, new PrintWriter(writer), 0, 2); List<BcrRoute> routes = format.read( new BufferedReader(new StringReader(writer.toString())), null, BcrFormat.DEFAULT_ENCODING); assertEquals(1, routes.size()); BcrRoute route = routes.get(0); List<BcrPosition> positions = route.getPositions(); assertEquals(2, positions.size()); BcrPosition position1 = positions.get(0); assertEquals("Start", position1.getComment()); BcrPosition position2 = positions.get(1); assertEquals("End", position2.getComment()); }