diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-02-18 16:28:17 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-02-18 16:28:17 +1300 |
commit | d5bd395f19ef5ed6732b32a0e8d0eb5e6a25c33e (patch) | |
tree | 8f19594583dbff0a2198d68751a05d9dee779d69 /test | |
parent | 4753e462767812712bafbc8e9985f355021c6f16 (diff) | |
download | trackermap-server-d5bd395f19ef5ed6732b32a0e8d0eb5e6a25c33e.tar.gz trackermap-server-d5bd395f19ef5ed6732b32a0e8d0eb5e6a25c33e.tar.bz2 trackermap-server-d5bd395f19ef5ed6732b32a0e8d0eb5e6a25c33e.zip |
Implement Cellocator output control
Diffstat (limited to 'test')
-rw-r--r-- | test/org/traccar/FilterHandlerTest.java | 10 | ||||
-rw-r--r-- | test/org/traccar/ProtocolTest.java | 2 | ||||
-rw-r--r-- | test/org/traccar/protocol/CellocatorProtocolEncoderTest.java | 26 |
3 files changed, 31 insertions, 7 deletions
diff --git a/test/org/traccar/FilterHandlerTest.java b/test/org/traccar/FilterHandlerTest.java index 11b4163a1..452592048 100644 --- a/test/org/traccar/FilterHandlerTest.java +++ b/test/org/traccar/FilterHandlerTest.java @@ -1,14 +1,14 @@ package org.traccar; -import java.util.Date; import org.junit.After; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertNull; import org.junit.Before; import org.junit.Test; -import org.traccar.database.IdentityManager; import org.traccar.model.Position; -import org.traccar.model.Device; + +import java.util.Date; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; public class FilterHandlerTest extends BaseTest { diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java index 955e0b788..d4543a06d 100644 --- a/test/org/traccar/ProtocolTest.java +++ b/test/org/traccar/ProtocolTest.java @@ -6,10 +6,8 @@ import org.jboss.netty.handler.codec.http.DefaultHttpRequest; import org.jboss.netty.handler.codec.http.HttpMethod; import org.jboss.netty.handler.codec.http.HttpVersion; import org.junit.Assert; -import org.traccar.database.IdentityManager; import org.traccar.model.CellTower; import org.traccar.model.Command; -import org.traccar.model.Device; import org.traccar.model.Position; import javax.xml.bind.DatatypeConverter; diff --git a/test/org/traccar/protocol/CellocatorProtocolEncoderTest.java b/test/org/traccar/protocol/CellocatorProtocolEncoderTest.java new file mode 100644 index 000000000..89850fb5f --- /dev/null +++ b/test/org/traccar/protocol/CellocatorProtocolEncoderTest.java @@ -0,0 +1,26 @@ +package org.traccar.protocol; + +import org.junit.Ignore; +import org.junit.Test; +import org.traccar.ProtocolTest; +import org.traccar.model.Command; + +public class CellocatorProtocolEncoderTest extends ProtocolTest { + + @Ignore + @Test + public void testEncode() throws Exception { + + CellocatorProtocolEncoder encoder = new CellocatorProtocolEncoder(); + + Command command = new Command(); + command.setDeviceId(1); + command.setType(Command.TYPE_OUTPUT_CONTROL); + command.set(Command.KEY_INDEX, 0); + command.set(Command.KEY_DATA, "1"); + + verifyCommand(encoder, command, binary("4D434750000000000000000000000303101000000000000026")); + + } + +} |