diff options
author | Christoph Krey <krey.christoph@gmail.com> | 2017-06-23 19:46:58 +0200 |
---|---|---|
committer | Christoph Krey <krey.christoph@gmail.com> | 2017-06-23 19:46:58 +0200 |
commit | a0f389cf98e42a1794355be2a44167f61ad43557 (patch) | |
tree | c1633d3ab862c7319b3681fa4b750060f894e978 /test/org/traccar | |
parent | a24f48627b914b6a8fe60bc3b5f76abc4f6fc574 (diff) | |
download | trackermap-server-a0f389cf98e42a1794355be2a44167f61ad43557.tar.gz trackermap-server-a0f389cf98e42a1794355be2a44167f61ad43557.tar.bz2 trackermap-server-a0f389cf98e42a1794355be2a44167f61ad43557.zip |
add Command.TYPE_POSITION_SINGLE to Tk103 protocol
Diffstat (limited to 'test/org/traccar')
-rw-r--r-- | test/org/traccar/protocol/Tk103ProtocolEncoderTest.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java b/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java index e934de04b..b198612b0 100644 --- a/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java +++ b/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java @@ -1,3 +1,20 @@ +/* + * Copyright 2017 Christoph Krey (c@ckrey.de) + * Copyright 2017 Anton Tananaev (anton@traccar.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + package org.traccar.protocol; import org.junit.Assert; @@ -20,4 +37,17 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { } + @Test + public void testEncodePositionSingle() throws Exception { + + Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(); + + Command command = new Command(); + command.setDeviceId(1); + command.setType(Command.TYPE_POSITION_SINGLE); + + Assert.assertEquals("(123456789012345AP00)", encoder.encodeCommand(command)); + + } + } |