Package slash.common.type

Examples of slash.common.type.CompactCalendar


        assertDoubleEquals(10.0294, position1.getLongitude());
        assertDoubleEquals(41.0, position1.getElevation());
        assertEquals("Hohenfelde (Hamburg)", position1.getDescription());
        assertEquals("Hohenfelde (Hamburg)", position1.getCity());
        assertEquals("Start : 21/07/2007 18:51:36", position1.getReason());
        CompactCalendar actual = position1.getTime();
        String cal1 = DateFormat.getDateTimeInstance().format(actual.getTime());
        CompactCalendar expected = calendar(2007, 7, 21, 18, 51, 36);
        String cal2 = DateFormat.getDateTimeInstance().format(expected.getTime());
        assertEquals(cal2, cal1);
        assertEquals(expected.getTimeInMillis(), actual.getTimeInMillis());
        assertEquals(expected.getTime(), actual.getTime());

        TomTomPosition position2 = route.getPositions().get(1);
        assertDoubleEquals(53.56963, position2.getLatitude());
        assertDoubleEquals(10.0294, position2.getLongitude());
        assertDoubleEquals(42.0, position2.getElevation());
View Full Code Here


        assertEquals("s=66 d=91", position.getReason());
        assertEquals("Eschelbach (Rhein-Neckar-Kreis, Baden-Wuerttemberg); L612", position.getCity());
        assertDoubleEquals(66.0, position.getSpeed());
        assertDoubleEquals(91.0, position.getHeading());
        assertDoubleEquals(196.9, position.getElevation());
        CompactCalendar expectedCal = calendar(2008, 6, 29, 7, 33, 0);
        assertEquals(expectedCal, position.getTime());
    }
View Full Code Here

import static slash.navigation.base.NavigationTestCase.readSampleTomTomRouteFile;

public class StartDateIT {

    private void checkPosition(NavigationPosition position, CompactCalendar expectedDate) {
        CompactCalendar actual = position.getTime();
        DateFormat format = DateFormat.getDateTimeInstance();
        format.setTimeZone(CompactCalendar.UTC);
        String cal1 = format.format(actual.getTime());
        String cal2 = format.format(expectedDate.getTime());
        assertEquals(cal2, cal1);
        assertEquals(expectedDate.getTimeInMillis(), actual.getTimeInMillis());
        assertEquals(expectedDate.getTime(), actual.getTime());
    }
View Full Code Here

    @Test
    public void testTimeZone() {
        long now = System.currentTimeMillis();
        Calendar local = localCalendar(now).getCalendar();
        CompactCalendar compactLocal = fromCalendar(local);
        Calendar utc = utcCalendar(now).getCalendar();
        CompactCalendar compactUtc = fromCalendar(utc);

        GpxPosition gpxPosition = new GpxPosition(3.0, 2.0, 1.0, null, compactLocal, "gpx");
        assertCalendarEquals(compactUtc, gpxPosition.getTime());
    }
View Full Code Here

            assertTrue(fragmentTarget2.delete());
    }

    @Test
    public void testSaveAndLoadNow() throws IOException, JAXBException {
        CompactCalendar now = now();
        persister.save(queueFile, new ArrayList<Download>(), now);

        QueuePersister.Result result = persister.load(queueFile);
        assertEquals(new ArrayList<Download>(), result.getDownloads());
        assertEquals(now, result.getLastSync());
View Full Code Here

        assertEquals(now, result.getLastSync());
    }

    @Test
    public void testSaveAndLoadDownloads() throws IOException {
        CompactCalendar now = now();
        List<Download> downloads = new ArrayList<>();
        downloads.add(new Download("description", "url", Flatten, new FileAndChecksum(fileTarget, createChecksum()),
                asList(new FileAndChecksum(fragmentTarget1, createChecksum()), new FileAndChecksum(fragmentTarget2, createChecksum())),
                "etag", Downloading, tempFile));
        persister.save(queueFile, downloads, now);
View Full Code Here

        return routes;
    }

    public static List<TomTomRoute> readSampleTomTomRouteFile(String fileName, boolean setStartDateFromFile) throws Exception {
        File source = new File(SAMPLE_PATH + fileName);
        CompactCalendar startDate = null;
        if (setStartDateFromFile) {
            Calendar calendar = Calendar.getInstance();
            calendar.setTimeInMillis(source.lastModified());
            startDate = fromCalendar(calendar);
        }
View Full Code Here

        return context.getRoutes();
    }

    public static List<NmeaRoute> readSampleNmeaFile(String fileName, boolean setStartDateFromFile) throws Exception {
        File source = new File(SAMPLE_PATH + fileName);
        CompactCalendar startDate = null;
        if (setStartDateFromFile) {
            Calendar calendar = Calendar.getInstance();
            calendar.setTimeInMillis(source.lastModified());
            startDate = fromCalendar(calendar);
        }
View Full Code Here

        return context.getRoutes();
    }

    public static List<SimpleRoute> readSampleGopalTrackFile(String fileName, boolean setStartDateFromFile) throws Exception {
        File source = new File(SAMPLE_PATH + fileName);
        CompactCalendar startDate = null;
        if (setStartDateFromFile) {
            Calendar calendar = Calendar.getInstance();
            calendar.setTimeInMillis(source.lastModified());
            startDate = fromCalendar(calendar);
        }
View Full Code Here

TOP

Related Classes of slash.common.type.CompactCalendar

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.