use of net.sf.marineapi.nmea.sentence.SentenceId in project marine-api by ktuukkan.
the class SentenceFactoryTest method testSupportedTypesRegistered.
/**
* Test method for
* {@link net.sf.marineapi.nmea.parser.SentenceFactory#createParser(java.lang.String)}
* .
*/
@Test
public void testSupportedTypesRegistered() {
for (SentenceId id : SentenceId.values()) {
String msg = "Parser not registered: " + id;
assertTrue(msg, instance.hasParser(id.toString()));
}
}
use of net.sf.marineapi.nmea.sentence.SentenceId in project marine-api by ktuukkan.
the class SentenceParserTest method testGetSentenceId.
/**
* Test method for
* {@link net.sf.marineapi.nmea.parser.SentenceParser#getSentenceId()}.
*/
@Test
public void testGetSentenceId() {
SentenceId sid = SentenceId.valueOf(instance.getSentenceId());
assertEquals(SentenceId.RMC, sid);
}
use of net.sf.marineapi.nmea.sentence.SentenceId in project marine-api by ktuukkan.
the class GGATest method testGGAParser.
/**
*
*/
@Test
public void testGGAParser() {
GGAParser instance = new GGAParser(EXAMPLE);
SentenceId sid = SentenceId.valueOf(instance.getSentenceId());
assertEquals(SentenceId.GGA, sid);
}
use of net.sf.marineapi.nmea.sentence.SentenceId in project marine-api by ktuukkan.
the class SentenceFactoryTest method testCreateEmptyParserWithSentenceId.
/**
* Test method for
* {@link net.sf.marineapi.nmea.parser.SentenceFactory#createParser(TalkerId, SentenceId)
* .
*/
@Test
public void testCreateEmptyParserWithSentenceId() {
for (SentenceId id : SentenceId.values()) {
Sentence s = instance.createParser(TalkerId.II, id);
assertNotNull(s);
assertTrue(s instanceof Sentence);
assertTrue(s instanceof SentenceParser);
assertEquals(TalkerId.II, s.getTalkerId());
assertEquals(id.name(), s.getSentenceId());
}
}
use of net.sf.marineapi.nmea.sentence.SentenceId in project marine-api by ktuukkan.
the class SentenceFactoryTest method testCreateEmptyParserWithSentenceIdStr.
/**
* Test method for
* {@link net.sf.marineapi.nmea.parser.SentenceFactory#createParser(java.lang.String)}
* .
*/
@Test
public void testCreateEmptyParserWithSentenceIdStr() {
for (SentenceId id : SentenceId.values()) {
Sentence s = instance.createParser(TalkerId.II, id.name());
assertNotNull(s);
assertTrue(s instanceof Sentence);
assertTrue(s instanceof SentenceParser);
}
}
Aggregations