package org.traccar.protocol;

import java.nio.ByteOrder;
import org.jboss.netty.buffer.ChannelBuffers;
import static org.junit.Assert.assertNull;
import static org.traccar.helper.DecoderVerifier.verify;
import org.junit.Test;
import org.traccar.helper.ChannelBufferTools;

public class NoranProtocolDecoderTest extends ProtocolDecoderTest {

    @Test
    public void testDecode() throws Exception {

        NoranProtocolDecoder decoder = new NoranProtocolDecoder(null);

        assertNull(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString(
                "0f0000004e52303946303431353500"))));

        verify(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString(
                "22000800010c008a007e9daa42317bdd41a7f3e2384e523039463034313535000000"))));

        verify(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString(
                "34000800010c0000000000001c4291251143388d17c24e523039423131303930000031342d31322d32352030303a33333a303700"))));
        
        verify(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString(
                "34000800010c00000000000000006520944141bd07c24e523039423139323832000031352d30342d32352030303a30333a323200"))));

    }

}

@@ -144,65 +144,8 @@
 ll;%0A
-import static org.traccar.helper.DecoderVerifier.verify;%0A
 impo
@@ -208,16 +208,73 @@
 erTools;
+%0Aimport static org.traccar.helper.DecoderVerifier.verify;
 %0A%0Apublic
@@ -465,16 +465,568 @@
 r(null);
+%0A        %0A        verify(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString(%0A                %223400080001090000000000001D43A29BE842E62520424E523039423036363932000031322D30332D30352031313A34373A343300%22))));%0A        %0A        verify(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString(%0A                %2234000800010c000000000080a3438e20944149bd07c24e523039423139323832000031352d30342d32362030383a34333a353300%22))));
 %0A%0A      

Add new Noran test cases