diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-08-31 16:36:04 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-08-31 16:36:04 +1200 |
commit | 142734931830f117b0e86dfa5f6dddec5416d878 (patch) | |
tree | c549452fc812896789786a090c4f38983d048d10 /test | |
parent | 82872aacbbc0a1a0b7e76481055164b435422a50 (diff) | |
download | traccar-server-142734931830f117b0e86dfa5f6dddec5416d878.tar.gz traccar-server-142734931830f117b0e86dfa5f6dddec5416d878.tar.bz2 traccar-server-142734931830f117b0e86dfa5f6dddec5416d878.zip |
Implement KHD protocol commands
Diffstat (limited to 'test')
4 files changed, 28 insertions, 3 deletions
diff --git a/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java b/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java index bf8c06232..019c92523 100644 --- a/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java +++ b/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java @@ -7,7 +7,7 @@ import org.traccar.model.Command; public class Gps103ProtocolEncoderTest { @Test - public void testDecode() throws Exception { + public void testEncode() throws Exception { Gps103ProtocolEncoder encoder = new Gps103ProtocolEncoder(); diff --git a/test/org/traccar/protocol/Gt06ProtocolEncoderTest.java b/test/org/traccar/protocol/Gt06ProtocolEncoderTest.java index a24045584..0a79bfca7 100644 --- a/test/org/traccar/protocol/Gt06ProtocolEncoderTest.java +++ b/test/org/traccar/protocol/Gt06ProtocolEncoderTest.java @@ -9,7 +9,7 @@ import org.traccar.model.Command; public class Gt06ProtocolEncoderTest { @Test - public void testDecode() throws Exception { + public void testEncode() throws Exception { Gt06ProtocolEncoder encoder = new Gt06ProtocolEncoder(); diff --git a/test/org/traccar/protocol/KhdProtocolEncoderTest.java b/test/org/traccar/protocol/KhdProtocolEncoderTest.java new file mode 100644 index 000000000..ec620aa60 --- /dev/null +++ b/test/org/traccar/protocol/KhdProtocolEncoderTest.java @@ -0,0 +1,25 @@ +package org.traccar.protocol; + +import org.jboss.netty.buffer.ChannelBuffers; +import org.junit.Assert; +import org.junit.Test; +import org.traccar.helper.ChannelBufferTools; +import org.traccar.model.Command; + +public class KhdProtocolEncoderTest { + + @Test + public void testEncode() throws Exception { + + KhdProtocolEncoder encoder = new KhdProtocolEncoder(); + + Command command = new Command(); + command.setDeviceId(1); + command.setType(Command.TYPE_ENGINE_STOP); + + Assert.assertEquals(encoder.encodeCommand(command), ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( + "2929390006000000003F0D"))); + + } + +} diff --git a/test/org/traccar/protocol/TotemProtocolEncoderTest.java b/test/org/traccar/protocol/TotemProtocolEncoderTest.java index 840165070..e228ca5a5 100644 --- a/test/org/traccar/protocol/TotemProtocolEncoderTest.java +++ b/test/org/traccar/protocol/TotemProtocolEncoderTest.java @@ -21,7 +21,7 @@ import org.traccar.model.Command; public class TotemProtocolEncoderTest { @Test - public void testDecode() throws Exception { + public void testEncode() throws Exception { TotemProtocolEncoder encoder = new TotemProtocolEncoder(); |