Package slash.common.type

Examples of slash.common.type.CompactCalendar


        NmeaPosition position = format.parsePosition("$GPGGA,162611,3554.2367,N,10619.4966,W,1,03,06.7,02300.3,M,-022.4,M,,*7F");
        assertDoubleEquals(-106.3249433333, position.getLongitude());
        assertDoubleEquals(35.903945, position.getLatitude());
        assertDoubleEquals(2300.3, position.getElevation());
        String actual = DateFormat.getDateTimeInstance().format(position.getTime().getTime());
        CompactCalendar expectedCal = calendar(1970, 1, 1, 16, 26, 11);
        String expected = DateFormat.getDateTimeInstance().format(expectedCal.getTime());
        assertEquals(expected, actual);
        assertEquals(expectedCal, position.getTime());
        assertNull(position.getDescription());
    }
View Full Code Here


    public void testParseRMC() {
        NmeaPosition position = format.parsePosition("$GPRMC,180114,A,4837.4374,N,00903.4036,E,14.32,000.0,160607,,,A*76");
        assertDoubleEquals(9.0567266667, position.getLongitude());
        assertDoubleEquals(48.6239566667, position.getLatitude());
        String actual = DateFormat.getDateTimeInstance().format(position.getTime().getTime());
        CompactCalendar expectedCal = calendar(2007, 6, 16, 18, 1, 14);
        String expected = DateFormat.getDateTimeInstance().format(expectedCal.getTime());
        assertEquals(expected, actual);
        assertEquals(expectedCal, position.getTime());
        assertNull(position.getElevation());
        assertNull(position.getDescription());
        assertDoubleEquals(nauticMilesToKiloMeter(14.32), position.getSpeed());
View Full Code Here

    private static final String TAVELLOG_DESCRIPTION = "<description><![CDATA[<html><body>Time: 2009/02/07 21:45:55<BR>Altitude: 62.20<BR>Speed: 15.37<BR></body></html>]]></description>";

    @Test
    public void testParseTime() {
        KmlPosition position = new KmlPosition(null, null, null, null, null, null);
        CompactCalendar expectedCal = calendar(2009, 2, 7, 21, 45, 55);
        format.parseTime(position, TAVELLOG_DESCRIPTION, null);
        CompactCalendar actualCal = position.getTime();
        String expected = DateFormat.getDateTimeInstance().format(expectedCal.getTime());
        String actual = DateFormat.getDateTimeInstance().format(actualCal.getTime());
        assertEquals(expected, actual);
        assertEquals(expectedCal, actualCal);
    }
View Full Code Here

    public void testParseZDA() {
        NmeaPosition position = format.parsePosition("$GPZDA,032910.542,07,08,2004,00,00*48");
        assertNull(position.getLongitude());
        assertNull(position.getLatitude());
        String actual = DateFormat.getDateTimeInstance().format(position.getTime().getTime());
        CompactCalendar expectedCal = calendar(2004, 8, 7, 3, 29, 10, 542);
        String expected = DateFormat.getDateTimeInstance().format(expectedCal.getTime());
        assertEquals(expected, actual);
        assertEquals(expectedCal, position.getTime());
        assertNull(position.getElevation());
        assertNull(position.getDescription());
        assertNull(position.getSpeed());
View Full Code Here

        assertDoubleEquals(9.0567266667, position.getLongitude());
        assertDoubleEquals(48.6239566667, position.getLatitude());
        assertDoubleEquals(2.835, position.getSpeed());
        assertDoubleEquals(16.76, position.getElevation());
        String actual = DateFormat.getDateTimeInstance().format(position.getTime().getTime());
        CompactCalendar expectedCal = calendar(2013, 7, 29, 13, 4, 41);
        String expected = DateFormat.getDateTimeInstance().format(expectedCal.getTime());
        assertEquals(expected, actual);
        assertEquals(expectedCal, position.getTime());
        assertNull(position.getDescription());
    }
View Full Code Here

        assertDoubleEquals(9.8037979667, position.getLongitude());
        assertDoubleEquals(43.01497215, position.getLatitude());
        assertDoubleEquals(19.3175, position.getSpeed());
        assertDoubleEquals(203.0821, position.getElevation());
        String actual = DateFormat.getDateTimeInstance().format(position.getTime().getTime());
        CompactCalendar expectedCal = calendar(2013, 7, 29, 10, 4, 36);
        String expected = DateFormat.getDateTimeInstance().format(expectedCal.getTime());
        assertEquals(expected, actual);
        assertEquals(expectedCal, position.getTime());
        assertEquals("Position 3", position.getDescription());
    }
View Full Code Here

    private static final String BT747_NAME = "TIME: 10:11:56; &lt;table width=400&gt;&lt;tr&gt;&lt;td&gt;Index:&lt;/td&gt;&lt;td&gt;7643&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Zeit:&lt;/td&gt;&lt;td&gt;05-September-10 10:11:56&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Geographische Breite:&lt;/td&gt;&lt;td&gt;49.385769 N&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;Geografische L&amp;auml;nge:&lt;/td&gt;&lt;td&gt;8.572565 E&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;H&amp;ouml;he:&lt;/td&gt;&lt;td&gt;102.109 m&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;".replaceAll("&gt;", ">").replaceAll("&lt;", "<");

    @Test
    public void testParseTime() {
        KmlPosition position = new KmlPosition(null, null, null, null, null, null);
        CompactCalendar expectedCal = calendar(2010, 9, 5, 10, 11, 56);
        format.parseTime(position, BT747_NAME, null);
        CompactCalendar actualCal = position.getTime();
        String expected = DateFormat.getDateTimeInstance().format(expectedCal.getTime());
        String actual = DateFormat.getDateTimeInstance().format(actualCal.getTime());
        assertEquals(expected, actual);
        assertEquals(expectedCal, actualCal);
    }
View Full Code Here

        assertDoubleEquals(9.0567266667, position.getLongitude());
        assertDoubleEquals(48.6239566667, position.getLatitude());
        assertDoubleEquals(5.5560129, position.getSpeed());
        assertDoubleEquals(-48.7654, position.getElevation());
        String actual = DateFormat.getDateTimeInstance().format(position.getTime().getTime());
        CompactCalendar expectedCal = calendar(2007, 7, 26, 13, 40, 12);
        String expected = DateFormat.getDateTimeInstance().format(expectedCal.getTime());
        assertEquals(expected, actual);
        assertEquals(expectedCal, position.getTime());
        assertNull(position.getDescription());

        StringWriter writer = new StringWriter();
View Full Code Here

            "</description>";

    @Test
    public void testParseTime() {
        KmlPosition position = new KmlPosition(null, null, null, null, null, null);
        CompactCalendar expectedCal = calendar(2010, 12, 28, 23, 1, 39);
        format.parseTime(position, QSTARZ_DESCRIPTION, null);
        CompactCalendar actualCal = position.getTime();
        String expected = DateFormat.getDateTimeInstance().format(expectedCal.getTime());
        String actual = DateFormat.getDateTimeInstance().format(actualCal.getTime());
        assertEquals(expected, actual);
        assertEquals(expectedCal, actualCal);
    }
View Full Code Here

        assertDoubleEquals(245.512, position.getElevation());
        assertDoubleEquals(0.759, position.getSpeed());
        assertDoubleEquals(1.4, position.getHdop());
        assertEquals(new Integer(8), position.getSatellites());
        String actual = DateFormat.getDateTimeInstance().format(position.getTime().getTime());
        CompactCalendar expectedCal = calendar(2010, 12, 28, 23, 1, 43);
        String expected = DateFormat.getDateTimeInstance().format(expectedCal.getTime());
        assertEquals(expected, actual);
        assertEquals(expectedCal, position.getTime());
    }
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.