diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2012-08-19 22:20:31 +0400 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2012-08-19 22:20:31 +0400 |
commit | 22a8d46522824151f71c53f3fcab5e3b0d72f608 (patch) | |
tree | 3bb059be22e928839ff2dd4171eb9c4205d8ac51 /test | |
parent | b0b93983f5411ceffc649d44d55093b04ddf802a (diff) | |
parent | e7660ab714ee237ce080eaf14f5ab7f1997bea3f (diff) | |
download | traccar-server-22a8d46522824151f71c53f3fcab5e3b0d72f608.tar.gz traccar-server-22a8d46522824151f71c53f3fcab5e3b0d72f608.tar.bz2 traccar-server-22a8d46522824151f71c53f3fcab5e3b0d72f608.zip |
Merge branch 'williamchitto-master'
Diffstat (limited to 'test')
-rw-r--r-- | test/org/traccar/protocol/ST210ProtocolDecoderTest.java | 60 |
1 files changed, 9 insertions, 51 deletions
diff --git a/test/org/traccar/protocol/ST210ProtocolDecoderTest.java b/test/org/traccar/protocol/ST210ProtocolDecoderTest.java index 63234efd0..403b5621a 100644 --- a/test/org/traccar/protocol/ST210ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/ST210ProtocolDecoderTest.java @@ -1,58 +1,12 @@ package org.traccar.protocol; -import static org.junit.Assert.*; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; -import java.io.IOException; -import java.sql.SQLException; - -import org.junit.Before; -import org.junit.BeforeClass; import org.junit.Test; -import org.traccar.Server; -import org.traccar.helper.Log; -//import org.traccar.server.SocketCliente; public class ST210ProtocolDecoderTest { - /* - @BeforeClass - public static void UpServer() { - final Server service = new Server(); - String[] args = new String[1]; - args[0] = "setup\\windows\\windows.cfg"; - try { - service.init(args); - - Log.info("starting server..."); - service.start(); - - // Shutdown server properly - Runtime.getRuntime().addShutdownHook(new Thread() { - @Override - public void run() { - Log.info("shutting down server..."); - service.stop(); - } - }); - - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - - @Test - public void testClienteMsg() throws Exception { - - SocketCliente cliente = new SocketCliente(); - cliente.SendMSG( - "localhost", - 5010, - "SA200STT;317652;042;20120718;15:37:12;16d41;-15.618755;-056.083241;000.024;000.00;8;1;41548;12.17;100000;2;1979"); - } - -*/ - @Test public void testDecode() throws Exception { @@ -70,19 +24,23 @@ public class ST210ProtocolDecoderTest { assertNotNull(decoder .decode(null, null, - "SA200STT;317652;042;20120722;00:24:23;16d41;-15.618767;-056.083214;000.011;000.00;11;1;41557;12.21;000000;1;3205")); + "SA200STT;317652;042;20120722;00:24:23;4f310;-15.618767;-056.083214;000.011;000.00;11;1;41557;12.21;000000;1;3205")); assertNotNull(decoder .decode(null, null, - "SA200STT;315198;042;20120808;20:37:34;42948;-15.618731;-056.083216;000.007;000.00;12;1;48;0.00;000000;1;0127")); + "SA200STT;315198;042;20120808;20:37:34;3fac25;-15.618731;-056.083216;000.007;000.00;12;1;48;0.00;000000;1;0127")); assertNotNull(decoder .decode(null, null, - "SA200STT;315198;042;20120809;13:43:34;16d41;-15.618709;-056.083223;000.025;000.00;8;1;49;12.10;100000;2;0231")); + "SA200STT;315198;042;20120809;13:43:34;4f310;-15.618709;-056.083223;000.025;000.00;8;1;49;12.10;100000;2;0231")); assertNotNull(decoder .decode(null, null, "SA200EMG;317652;042;20120718;15:35:41;16d41;-15.618740;-056.083252;000.034;000.00;8;1;41548;12.17;110000;1")); + assertNull(decoder + .decode(null, + null, + "SA200ALV;317652")); } } |