Search in sources :

Example 6 with SentenceFactory

use of net.sf.marineapi.nmea.parser.SentenceFactory in project marine-api by ktuukkan.

the class SentenceReaderTest method testFireSentenceEventWithUnexpectedType.

@Test
public void testFireSentenceEventWithUnexpectedType() {
    assertNull(sentence);
    SentenceFactory sf = SentenceFactory.getInstance();
    Sentence s = sf.createParser(BODTest.EXAMPLE);
    reader.fireSentenceEvent(s);
    assertNull(sentence);
}
Also used : SentenceFactory(net.sf.marineapi.nmea.parser.SentenceFactory) Sentence(net.sf.marineapi.nmea.sentence.Sentence) GGATest(net.sf.marineapi.nmea.parser.GGATest) Test(org.junit.Test) BODTest(net.sf.marineapi.nmea.parser.BODTest)

Example 7 with SentenceFactory

use of net.sf.marineapi.nmea.parser.SentenceFactory 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

SentenceFactory (net.sf.marineapi.nmea.parser.SentenceFactory)7 Sentence (net.sf.marineapi.nmea.sentence.Sentence)6 GGATest (net.sf.marineapi.nmea.parser.GGATest)5 Test (org.junit.Test)5 SentenceEvent (net.sf.marineapi.nmea.event.SentenceEvent)3 GLLTest (net.sf.marineapi.nmea.parser.GLLTest)3 RMCTest (net.sf.marineapi.nmea.parser.RMCTest)3 BODTest (net.sf.marineapi.nmea.parser.BODTest)2 MWVSentence (net.sf.marineapi.nmea.sentence.MWVSentence)1