source: liacs/se/RouteGUI/test/routegui/GPRMCTest.java@ 80

Last change on this file since 80 was 2, checked in by Rick van der Zwet, 15 years ago

Initial import of data of old repository ('data') worth keeping (e.g. tracking
means of URL access statistics)

File size: 1.3 KB
RevLine 
[2]1/*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
5
6package routegui;
7
8import java.io.IOException;
9import org.junit.Test;
10import static org.junit.Assert.*;
11import static java.util.Calendar.*;
12/**
13 *
14 * @author rick
15 */
16public class GPRMCTest {
17
18 @Test
19 public void GPRMCTest() {
20 /* Data entry check HHMMSS.XXX*/
21 GPRMC entry = new GPRMC("$GPRMC,080756.00,A,5159.38233,N,00422.72435,E,0.011,,120308,,,A*76");
22 assertEquals(2008, entry.calendar.get(YEAR));
23 assertEquals(03, entry.calendar.get(MONTH));
24 assertEquals(12, entry.calendar.get(DAY_OF_MONTH));
25 assertEquals(8, entry.calendar.get(HOUR));
26 assertEquals(7, entry.calendar.get(MINUTE));
27 assertEquals(56, entry.calendar.get(SECOND));
28 assertEquals(00, entry.calendar.get(MILLISECOND));
29 assertEquals(51.9897055, entry.position.getLatitude());
30 assertEquals(4.378739166666667, entry.position.getLongitude());
31 assertEquals(true, entry.sateliteFixStatus);
32 assertEquals(0.011, entry.speed);
33
34
35 /* Checksum check, should fail */
36 boolean result = entry.process("$GPRMC,080756.00,A,5159.38233,N,00422.72435,E,0.011,,120308,,,A*75");
37 assertEquals(false, result);
38 }
39}
Note: See TracBrowser for help on using the repository browser.