Search in sources :

Example 26 with Sentence

use of net.sf.marineapi.nmea.sentence.Sentence in project marine-api by ktuukkan.

the class HeadingProviderTest method testHDTSentenceRead.

/**
	 * Test method for
	 * {@link net.sf.marineapi.provider.AbstractProvider#sentenceRead(net.sf.marineapi.nmea.event.SentenceEvent)}
	 * .
	 */
@Test
public void testHDTSentenceRead() {
    Sentence s = factory.createParser(HDTTest.EXAMPLE);
    assertNull(event);
    instance.sentenceRead(new SentenceEvent(this, s));
    assertNotNull(event);
    assertEquals(90.1, event.getHeading(), 0.1);
    assertTrue(event.isTrue());
}
Also used : SentenceEvent(net.sf.marineapi.nmea.event.SentenceEvent) Sentence(net.sf.marineapi.nmea.sentence.Sentence) HDMTest(net.sf.marineapi.nmea.parser.HDMTest) Test(org.junit.Test) HDTTest(net.sf.marineapi.nmea.parser.HDTTest) HDGTest(net.sf.marineapi.nmea.parser.HDGTest)

Example 27 with Sentence

use of net.sf.marineapi.nmea.sentence.Sentence in project marine-api by ktuukkan.

the class PositionProviderTest method testSentenceReadWithGGA.

/**
	 * Test method for
	 * {@link net.sf.marineapi.provider.AbstractProvider#sentenceRead(net.sf.marineapi.nmea.event.SentenceEvent)}
	 * .
	 */
@Test
public void testSentenceReadWithGGA() {
    SentenceFactory sf = SentenceFactory.getInstance();
    Sentence gga = sf.createParser(GGATest.EXAMPLE);
    assertNull(event);
    instance.sentenceRead(new SentenceEvent(this, gga));
    assertNull(event);
    Sentence rmc = sf.createParser(RMCTest.EXAMPLE);
    assertNull(event);
    instance.sentenceRead(new SentenceEvent(this, rmc));
    assertNotNull(event);
}
Also used : SentenceEvent(net.sf.marineapi.nmea.event.SentenceEvent) SentenceFactory(net.sf.marineapi.nmea.parser.SentenceFactory) Sentence(net.sf.marineapi.nmea.sentence.Sentence) GGATest(net.sf.marineapi.nmea.parser.GGATest) GLLTest(net.sf.marineapi.nmea.parser.GLLTest) Test(org.junit.Test) RMCTest(net.sf.marineapi.nmea.parser.RMCTest)

Aggregations

Sentence (net.sf.marineapi.nmea.sentence.Sentence)27 Test (org.junit.Test)20 FOOSentence (net.sf.marineapi.test.util.FOOSentence)10 BODSentence (net.sf.marineapi.nmea.sentence.BODSentence)8 GGATest (net.sf.marineapi.nmea.parser.GGATest)7 SentenceEvent (net.sf.marineapi.nmea.event.SentenceEvent)6 SentenceFactory (net.sf.marineapi.nmea.parser.SentenceFactory)6 BODTest (net.sf.marineapi.nmea.parser.BODTest)4 GLLTest (net.sf.marineapi.nmea.parser.GLLTest)3 HDGTest (net.sf.marineapi.nmea.parser.HDGTest)3 HDMTest (net.sf.marineapi.nmea.parser.HDMTest)3 HDTTest (net.sf.marineapi.nmea.parser.HDTTest)3 RMCTest (net.sf.marineapi.nmea.parser.RMCTest)3 FOOParser (net.sf.marineapi.test.util.FOOParser)3 GGASentence (net.sf.marineapi.nmea.sentence.GGASentence)2 GLLSentence (net.sf.marineapi.nmea.sentence.GLLSentence)2 GSASentence (net.sf.marineapi.nmea.sentence.GSASentence)2 GSVSentence (net.sf.marineapi.nmea.sentence.GSVSentence)2 RMCSentence (net.sf.marineapi.nmea.sentence.RMCSentence)2 SentenceId (net.sf.marineapi.nmea.sentence.SentenceId)2