From 7f62f1671b38b9ffbeff66aa4ee79e0f875b1c66 Mon Sep 17 00:00:00 2001 From: Jan-Piet Mens Date: Tue, 13 Jun 2017 12:30:49 +0200 Subject: New protocol decoder for OwnTracks - removed comments and try/catch as per request - add existence checks --- .../protocol/OwnTracksProtocolDecoderTest.java | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java (limited to 'test/org/traccar/protocol') diff --git a/test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java b/test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java new file mode 100644 index 000000000..c11670cae --- /dev/null +++ b/test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java @@ -0,0 +1,26 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class OwnTracksProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + OwnTracksProtocolDecoder decoder = new OwnTracksProtocolDecoder(new OwnTracksProtocol()); + +/* + * I don'w know how to get JSON into that ... + * + verifyNull(decoder, request( + "{ \"id\" : \"hello\" }")); + + verifyPosition(decoder, request( + "{\"cog\":271,\"lon\":2.29513,\"acc\":5,\"vel\":61,\"vac\":21,\"lat\":48.85833,\"tst\":1497349316,\"alt\":167,\"_type\":\"location\",\"tid\":\"JJ\"}")); + +*/ + + } + +} -- cgit v1.2.3