aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java
blob: a8b21c0b120d1226f46168c724ef7596839434ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package org.traccar.protocol;

import org.jboss.netty.buffer.ChannelBuffers;
import org.junit.Test;
import org.traccar.helper.ChannelBufferTools;
import org.traccar.helper.TestDataManager;

import static org.junit.Assert.assertNull;
import static org.traccar.helper.DecoderVerifier.verify;

public class UlbotechProtocolDecoderTest {

    @Test
    public void testDecode() throws Exception {

        UlbotechProtocolDecoder decoder = new UlbotechProtocolDecoder(new TestDataManager(), null, null);
        
        //verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(
        //        new int[] {0xF8,0x01,0x01,0x08,0x63,0x07,0x00,0x18,0x98,0x72,0x98,0x72,0x96,0x19,0x02,0x27,0x01,0xCC,0x00,0x00,0x28,0x55,0x34,0xBA,0x4F,0x28,0x55,0x3A,0xB1,0x4C,0x28,0x55,0xBC,0x9C,0x57,0x28,0x55,0xBC,0x9D,0x5B,0x28,0x55,0x3A,0xB2,0x5C,0x28,0x55,0x44,0x58,0x61,0x28,0x55,0x44,0x58,0x63,0x03,0x04,0x00,0x00,0x00,0x00,0x04,0x04,0x00,0x00,0x07,0x6F,0x05,0x08,0x03,0x3A,0x18,0xCF,0x22,0x0D,0x3D,0xE6,0xA6,0x38,0xF8}))));

        verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(
                new int[] {0xF8,0x01,0x01,0x03,0x57,0x85,0x20,0x34,0x57,0x28,0x94,0x95,0xD6,0x02,0x35,0x01,0x0E,0x01,0x61,0x75,0xA5,0x06,0xC2,0xC8,0x38,0x00,0x00,0x00,0x00,0x00,0x64}))));

    }

}