@Test
public void testRoundtrip() throws IOException {
readWriteRoundtrip(TEST_PATH + "from-iblue747.csv", new ReadWriteTestCallback() {
public void test(ParserResult source, ParserResult target) {
SimpleRoute sourceRoute = (SimpleRoute) source.getAllRoutes().get(0);
SimpleRoute targetRoute = (SimpleRoute) target.getAllRoutes().get(0);
for (int i = 0; i < sourceRoute.getPositionCount(); i++) {
Wgs84Position sourcePosition = (Wgs84Position) sourceRoute.getPosition(i);
Wgs84Position targetPosition = (Wgs84Position) targetRoute.getPosition(i);
assertNearBy(roundFraction(targetPosition.getElevation(), 1), roundFraction(sourcePosition.getElevation(), 1), 1.0);
assertNearBy(roundFraction(targetPosition.getSpeed(), 1), roundFraction(sourcePosition.getSpeed(), 1), 1.0);
assertNearBy(roundFraction(targetPosition.getHeading(), 1), roundFraction(sourcePosition.getHeading(), 1));
}
}