aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol
diff options
context:
space:
mode:
authorwilliamchitto <williamchitto@gmail.com>2012-07-31 08:08:53 -0300
committerwilliamchitto <williamchitto@gmail.com>2012-07-31 08:08:53 -0300
commitf5e305c4ea89210a2e4daffa4e947acdc440fbe7 (patch)
treeebc542944483e95c9b7374217690fc7bba38ff33 /test/org/traccar/protocol
parentd9c99fafa2e4d581f473029144aec495cb94bb62 (diff)
downloadtrackermap-server-f5e305c4ea89210a2e4daffa4e947acdc440fbe7.tar.gz
trackermap-server-f5e305c4ea89210a2e4daffa4e947acdc440fbe7.tar.bz2
trackermap-server-f5e305c4ea89210a2e4daffa4e947acdc440fbe7.zip
adicionando classes de testes
Diffstat (limited to 'test/org/traccar/protocol')
-rw-r--r--test/org/traccar/protocol/ST210ProtocolDecoderTest.java47
1 files changed, 46 insertions, 1 deletions
diff --git a/test/org/traccar/protocol/ST210ProtocolDecoderTest.java b/test/org/traccar/protocol/ST210ProtocolDecoderTest.java
index ba36cb360..a2ffe5bac 100644
--- a/test/org/traccar/protocol/ST210ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/ST210ProtocolDecoderTest.java
@@ -2,11 +2,56 @@ package org.traccar.protocol;
import static org.junit.Assert.*;
+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 {
ST210ProtocolDecoder decoder = new ST210ProtocolDecoder(
@@ -24,5 +69,5 @@ public class ST210ProtocolDecoderTest {
.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"));
- }
+ }*/
}