aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/helper
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-11 13:50:13 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-11 13:50:13 +1300
commitaa289b8600d9a55fdd053e003705de116ab25f2e (patch)
tree4d778f5b001f7eedc10dfae46603c92611fa8fe5 /test/org/traccar/helper
parent16f2679a18d00270bd733292a11c67b38458bf7b (diff)
downloadtrackermap-server-aa289b8600d9a55fdd053e003705de116ab25f2e.tar.gz
trackermap-server-aa289b8600d9a55fdd053e003705de116ab25f2e.tar.bz2
trackermap-server-aa289b8600d9a55fdd053e003705de116ab25f2e.zip
Make changes to model hierarchy
Diffstat (limited to 'test/org/traccar/helper')
-rw-r--r--test/org/traccar/helper/DecoderVerifier.java25
1 files changed, 21 insertions, 4 deletions
diff --git a/test/org/traccar/helper/DecoderVerifier.java b/test/org/traccar/helper/DecoderVerifier.java
index 17b4f9633..28220b711 100644
--- a/test/org/traccar/helper/DecoderVerifier.java
+++ b/test/org/traccar/helper/DecoderVerifier.java
@@ -2,7 +2,10 @@ package org.traccar.helper;
import java.util.Date;
import java.util.List;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import org.traccar.model.Data;
import org.traccar.model.Position;
public class DecoderVerifier {
@@ -40,6 +43,14 @@ public class DecoderVerifier {
assertNotNull(position.getAttributes());
}
+
+ private static void verifyData(Data data) {
+
+ assertNotNull(data.getDeviceId());
+
+ assertNotNull(data.getAttributes());
+
+ }
public static void verify(Object object) {
@@ -47,13 +58,19 @@ public class DecoderVerifier {
if (object instanceof Position) {
verifyPosition((Position) object);
+ } else if (object instanceof Data) {
+ verifyData((Data) object);
} else if (object instanceof List) {
- List<Position> positions = (List<Position>) object;
+ List positions = (List) object;
assertFalse(positions.isEmpty());
- for (Position position : positions) {
- verifyPosition(position);
+ for (Object item : positions) {
+ if (item instanceof Position) {
+ verifyPosition((Position) item);
+ } else if (item instanceof Data) {
+ verifyData((Data) item);
+ }
}
}