Search in sources :

Example 1 with SentenceId

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()));
    }
}
Also used : SentenceId(net.sf.marineapi.nmea.sentence.SentenceId) Test(org.junit.Test)

Example 2 with SentenceId

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);
}
Also used : SentenceId(net.sf.marineapi.nmea.sentence.SentenceId) Test(org.junit.Test)

Example 3 with SentenceId

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);
}
Also used : SentenceId(net.sf.marineapi.nmea.sentence.SentenceId) Test(org.junit.Test)

Example 4 with SentenceId

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());
    }
}
Also used : SentenceId(net.sf.marineapi.nmea.sentence.SentenceId) 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)

Example 5 with SentenceId

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);
    }
}
Also used : SentenceId(net.sf.marineapi.nmea.sentence.SentenceId) 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

SentenceId (net.sf.marineapi.nmea.sentence.SentenceId)6 Test (org.junit.Test)6 BODSentence (net.sf.marineapi.nmea.sentence.BODSentence)2 Sentence (net.sf.marineapi.nmea.sentence.Sentence)2 FOOSentence (net.sf.marineapi.test.util.FOOSentence)2