/*
 * This file was automatically generated by EvoSuite
 * Tue Dec 10 03:56:45 GMT 2019
 */

package org.traccar.protocol;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.nio.ByteBuffer;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.jboss.netty.buffer.ByteBufferBackedChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.LittleEndianHeapChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.DefaultChannelPipeline;
import org.jboss.netty.channel.local.DefaultLocalServerChannelFactory;
import org.jboss.netty.channel.local.LocalServerChannel;
import org.junit.runner.RunWith;
import org.traccar.protocol.TmgFrameDecoder;

@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true, useJEE = true) 
public class TmgFrameDecoder_ESTest extends TmgFrameDecoder_ESTest_scaffolding {

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      TmgFrameDecoder tmgFrameDecoder0 = new TmgFrameDecoder();
      byte[] byteArray0 = new byte[3];
      byteArray0[0] = (byte)122;
      LittleEndianHeapChannelBuffer littleEndianHeapChannelBuffer0 = new LittleEndianHeapChannelBuffer(byteArray0);
      Object object0 = tmgFrameDecoder0.decode((ChannelHandlerContext) null, (Channel) null, littleEndianHeapChannelBuffer0);
      assertNull(object0);
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      TmgFrameDecoder tmgFrameDecoder0 = new TmgFrameDecoder();
      DefaultChannelPipeline defaultChannelPipeline0 = new DefaultChannelPipeline();
      DefaultLocalServerChannelFactory defaultLocalServerChannelFactory0 = new DefaultLocalServerChannelFactory();
      LocalServerChannel localServerChannel0 = defaultLocalServerChannelFactory0.newChannel(defaultChannelPipeline0);
      try { 
        tmgFrameDecoder0.decode((ChannelHandlerContext) null, localServerChannel0, (ChannelBuffer) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.protocol.TmgFrameDecoder", e);
      }
  }

  @Test(timeout = 4000)
  public void test2()  throws Throwable  {
      TmgFrameDecoder tmgFrameDecoder0 = new TmgFrameDecoder();
      byte[] byteArray0 = new byte[3];
      byteArray0[1] = (byte)36;
      LittleEndianHeapChannelBuffer littleEndianHeapChannelBuffer0 = new LittleEndianHeapChannelBuffer(byteArray0);
      Object object0 = tmgFrameDecoder0.decode((ChannelHandlerContext) null, (Channel) null, littleEndianHeapChannelBuffer0);
      assertNull(object0);
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      TmgFrameDecoder tmgFrameDecoder0 = new TmgFrameDecoder();
      DefaultChannelPipeline defaultChannelPipeline0 = new DefaultChannelPipeline();
      DefaultLocalServerChannelFactory defaultLocalServerChannelFactory0 = new DefaultLocalServerChannelFactory();
      LocalServerChannel localServerChannel0 = defaultLocalServerChannelFactory0.newChannel(defaultChannelPipeline0);
      ByteBuffer byteBuffer0 = ByteBuffer.allocateDirect(8388608);
      ByteBufferBackedChannelBuffer byteBufferBackedChannelBuffer0 = new ByteBufferBackedChannelBuffer(byteBuffer0);
      tmgFrameDecoder0.decode((ChannelHandlerContext) null, localServerChannel0, byteBufferBackedChannelBuffer0);
  }
}
