use of net.sf.marineapi.test.util.VDMParser in project marine-api by ktuukkan.
the class SentenceFactoryTest method testRegisterParserWithAlternativeBeginChar.
/**
* Test method for
* {@link net.sf.marineapi.nmea.parser.SentenceFactory#registerParser(java.lang.String, java.lang.Class)}
* .
*/
@Test
public void testRegisterParserWithAlternativeBeginChar() {
try {
instance.registerParser("VDM", VDMParser.class);
assertTrue(instance.hasParser("VDM"));
} catch (Exception e) {
fail("parser registering failed");
}
Sentence s = instance.createParser("!AIVDM,1,2,3");
assertNotNull(s);
assertTrue(s instanceof Sentence);
assertTrue(s instanceof SentenceParser);
assertTrue(s instanceof VDMParser);
instance.unregisterParser(VDMParser.class);
assertFalse(instance.hasParser("VDM"));
}
Aggregations