Package slash.navigation.common

Examples of slash.navigation.common.NavigationPosition


    private static final String UMLAUTS_ae_oe_ue_sz = "\u00e4\u00f6\u00fc\u00df";
    private static final char EURO = '\u20ac';

    static void checkUmlauts(BaseRoute<BaseNavigationPosition, BaseNavigationFormat> route) {
        NavigationPosition first = route.getPositions().get(0);
        assertEquals("abc" + UMLAUTS_ae_oe_ue_sz + EURO, first.getDescription());
    }
View Full Code Here


    private static final String SCHEESSEL = "Schee\u00dfel";
    private static final String MOELLN = "M\u00f6lln";
    private static final String LUEBECK = "L\u00fcbeck";

    static void checkPlaceNamesWithUmlauts(BaseRoute<BaseNavigationPosition, BaseNavigationFormat> route) {
        NavigationPosition first = route.getPositions().get(0);
        assertEquals(SCHEESSEL, first.getDescription());
        NavigationPosition second = route.getPositions().get(1);
        assertEquals(MOELLN, second.getDescription());
        NavigationPosition third = route.getPositions().get(2);
        assertEquals(LUEBECK, third.getDescription());
    }
View Full Code Here

        assertNotNull(routes);
        assertEquals(1, routes.size());
        BaseRoute<BaseNavigationPosition, BaseNavigationFormat> route = routes.get(0);
        assertEquals(3, route.getPositionCount());
        NavigationPosition position1 = route.getPositions().get(0);
        checkPosition(position1, calendar(year, month, day, 18, 51, 36));
        NavigationPosition position2 = route.getPositions().get(1);
        checkPosition(position2, calendar(year, month, day, 18, 51, 45));
        NavigationPosition position3 = route.getPositions().get(2);
        checkPosition(position3, calendar(year, month, day, 18, 51, 59));
    }
View Full Code Here

                                        boolean descriptionPositionNames,
                                        boolean compareByEquals,
                                        RouteCharacteristics sourceCharacteristics,
                                        RouteCharacteristics targetCharacteristics) {
        for (int i = 0; i < sourcePositions.size(); i++) {
            NavigationPosition sourcePosition = sourcePositions.get(i);
            NavigationPosition targetPosition = targetPositions.get(i);
            comparePosition(sourceFormat, targetFormat, i, sourcePosition, targetPosition, descriptionPositionNames, sourceCharacteristics, targetCharacteristics);
        }
        if (!compareByEquals)
            return;
        for (int i = 0; i < sourcePositions.size(); i++) {
            NavigationPosition sourcePosition = sourcePositions.get(i);
            // don't fail if a position has been commented by us
            if (sourcePosition.getDescription() == null)
                sourcePosition.setDescription("Position " + (i + 1));
            NavigationPosition targetPosition = targetPositions.get(i);
            assertEquals("Position " + i + " is not equal", sourcePosition, targetPosition);
            assertEquals(sourcePositions, targetPositions);
        }
    }
View Full Code Here

                                             RouteCharacteristics sourceCharacteristics,
                                             RouteCharacteristics targetCharacteristics) {
        int count = duplicateFirstPosition ? sourcePositions.size() : targetPositions.size();
        for (int i = 0; i < count; i++) {
            int index = i + positionsPerFile * fileNumber;
            NavigationPosition sourcePosition = sourcePositions.get(index);
            NavigationPosition targetPosition = targetPositions.get(i + (duplicateFirstPosition ? 1 : 0));
            comparePosition(sourceFormat, targetFormat, index, sourcePosition, targetPosition, descriptionPositionNames, sourceCharacteristics, targetCharacteristics);
        }
    }
View Full Code Here

            assertNotNull(route);
            assertEquals("Route " + i + " from " + source + " is not " + characteristics[i],
                    characteristics[i], route.getCharacteristics());
            assertTrue(route.getPositionCount() > 0);
            List<NavigationPosition> positions = route.getPositions();
            NavigationPosition previous = null;
            for (int j = 0; j < positions.size(); j++) {
                NavigationPosition position = positions.get(j);
                assertNotNull(position);
                assertNotNull(position.getLongitude());
                assertNotNull(position.getLatitude());
                if (expectElevation)
                    assertNotNull("Position " + j + " has no elevation", position.getElevation());
                if (expectTime) {
                    assertTrue("Position " + j + " has no time", position.hasTime());
                    if (previous != null)
                        assertTrue(!position.getTime().getCalendar().before(previous.getTime().getCalendar()));
                }
                previous = position;
            }
        }
    }
View Full Code Here

        assertNotNull(result.getTheRoute());
        assertNotNull(result.getAllRoutes());
        assertTrue(result.getAllRoutes().size() > 0);

        // check append
        NavigationPosition sourcePosition = result.getTheRoute().getPositions().get(0);
        NavigationPosition targetPosition = asFormat(sourcePosition, targetFormat);
        assertNotNull(targetPosition);

        convertSingleRouteRoundtrip(sourceFormat, targetFormat, source, result.getTheRoute());

        if (targetFormat.isSupportsMultipleRoutes()) {
View Full Code Here

TOP

Related Classes of slash.navigation.common.NavigationPosition

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.