Search in sources :

Example 1 with VDMParser

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"));
}
Also used : VDMParser(net.sf.marineapi.test.util.VDMParser) FOOSentence(net.sf.marineapi.test.util.FOOSentence) BODSentence(net.sf.marineapi.nmea.sentence.BODSentence) Sentence(net.sf.marineapi.nmea.sentence.Sentence) Test(org.junit.Test)

Aggregations

BODSentence (net.sf.marineapi.nmea.sentence.BODSentence)1 Sentence (net.sf.marineapi.nmea.sentence.Sentence)1 FOOSentence (net.sf.marineapi.test.util.FOOSentence)1 VDMParser (net.sf.marineapi.test.util.VDMParser)1 Test (org.junit.Test)1