diff options
Diffstat (limited to 'test/org/traccar/protocol')
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(); |