diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-25 21:00:19 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-25 21:00:19 +1300 |
commit | db08f36b51f7f51e901cc778a79ba8949c1d6d08 (patch) | |
tree | b39e8d0a51cd266d498271b344b2ff99f0404967 /test | |
parent | 78f7e386fe4fb46fc0c9295853a2467408330dfd (diff) | |
download | traccar-server-db08f36b51f7f51e901cc778a79ba8949c1d6d08.tar.gz traccar-server-db08f36b51f7f51e901cc778a79ba8949c1d6d08.tar.bz2 traccar-server-db08f36b51f7f51e901cc778a79ba8949c1d6d08.zip |
Refactor Meiligao protocol decoder
Diffstat (limited to 'test')
-rw-r--r-- | test/org/traccar/helper/PatternBuilderTest.java | 1 | ||||
-rw-r--r-- | test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/test/org/traccar/helper/PatternBuilderTest.java b/test/org/traccar/helper/PatternBuilderTest.java index 10621693e..36054bcea 100644 --- a/test/org/traccar/helper/PatternBuilderTest.java +++ b/test/org/traccar/helper/PatternBuilderTest.java @@ -13,6 +13,7 @@ public class PatternBuilderTest { Assert.assertEquals("a|b", new PatternBuilder().expression("a|b").toString()); Assert.assertEquals("ab\\|", new PatternBuilder().expression("ab|").toString()); Assert.assertEquals("|", new PatternBuilder().or().toString()); + Assert.assertEquals("\\|\\d|\\d\\|", new PatternBuilder().number("|d|d|").toString()); } } diff --git a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java index 523679201..6d0ba50d5 100644 --- a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java @@ -13,10 +13,12 @@ public class MeiligaoProtocolDecoderTest extends ProtocolDecoderTest { MeiligaoProtocolDecoder decoder = new MeiligaoProtocolDecoder(new MeiligaoProtocol()); verifyPosition(decoder, binary( - "242400706796502079108999553131333131382e3030302c412c313033372e393637382c4e2c30363132312e353637392c572c302e35342c322e34322c3330303931352c2c2c412a37307c302e37377c392e397c303030307c303030302c303161327c3030313138373132374cae0d0a")); + "242400706796502079108999553131333131382e3030302c412c313033372e393637382c4e2c30363132312e353637392c572c302e35342c322e34322c3330303931352c2c2c412a37307c302e37377c392e397c303030307c303030302c303161327c3030313138373132374cae0d0a"), + position("2015-09-30 11:31:18.000", true, 10.63280, -61.35947)); verifyPosition(decoder, binary( - "24240074630700194707719966009E1F7F00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007C3132303334302C3238303630362C323430302E303030302C4E2C31323130302E303030302C458F7E0D0A")); + "24240074630700194707719966009E1F7F00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007C3132303334302C3238303630362C323430302E303030302C4E2C31323130302E303030302C458F7E0D0A"), + position("2006-06-28 12:03:40.000", true, 24.00000, 121.00000)); verifyPosition(decoder, binary( "24240076220720151fffff99660012b3ab00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007c3135303634382c3233303731352c313931352e37323835362c4e2c30373235322e35333034342c456dd00d0a")); |