diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-01-16 15:07:20 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-01-16 15:07:20 +1300 |
commit | 2ad4b64a0db0b93334bf37e0c9a4152034094637 (patch) | |
tree | 5bcfbed4c2a42f3588aab2aa988d3f89bf82340d /test/org/traccar/DetectorHandlerTest.java | |
parent | e1608e2ffcb65afdadf5ef76a08cff1bfab47b49 (diff) | |
download | trackermap-server-2ad4b64a0db0b93334bf37e0c9a4152034094637.tar.gz trackermap-server-2ad4b64a0db0b93334bf37e0c9a4152034094637.tar.bz2 trackermap-server-2ad4b64a0db0b93334bf37e0c9a4152034094637.zip |
Implement protocol detector
Diffstat (limited to 'test/org/traccar/DetectorHandlerTest.java')
-rw-r--r-- | test/org/traccar/DetectorHandlerTest.java | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/test/org/traccar/DetectorHandlerTest.java b/test/org/traccar/DetectorHandlerTest.java new file mode 100644 index 000000000..f506856af --- /dev/null +++ b/test/org/traccar/DetectorHandlerTest.java @@ -0,0 +1,39 @@ +package org.traccar; + +import org.jboss.netty.buffer.ChannelBuffer; +import org.jboss.netty.buffer.ChannelBuffers; +import org.jboss.netty.channel.ChannelPipeline; +import org.jboss.netty.channel.Channels; +import org.jboss.netty.handler.codec.string.StringDecoder; +import org.jboss.netty.handler.codec.string.StringEncoder; +import org.jboss.netty.handler.timeout.IdleStateHandler; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.traccar.helper.TestDataManager; +import org.traccar.model.Position; +import org.traccar.protocol.Gps103ProtocolDecoder; + +import java.nio.charset.Charset; +import java.util.Date; +import java.util.List; + +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; + +public class DetectorHandlerTest { + + @Test + public void testCheckPipeline() throws Exception { + + /*ChannelPipeline pipeline = Channels.pipeline(); + pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "\r\n", "\n", ";")); + pipeline.addLast("stringDecoder", new StringDecoder()); + pipeline.addLast("stringEncoder", new StringEncoder()); + pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(new TestDataManager(), null, null)); + + DetectorHandler.checkPipeline("gps103", pipeline, ChannelBuffers.copiedBuffer( + "imei:869039001186913,tracker,1308282156,0,F,215630.000,A,5602.11015,N,9246.30767,E,1.4,,175.9,;", Charset.defaultCharset()));*/ + } + +} |