/*
 * This file was automatically generated by EvoSuite
 * Tue Dec 10 01:34:58 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 java.nio.ByteOrder;
import java.nio.channels.SocketChannel;
import java.text.ParseException;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.jboss.netty.buffer.BigEndianHeapChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.DirectChannelBufferFactory;
import org.jboss.netty.buffer.HeapChannelBufferFactory;
import org.jboss.netty.buffer.ReadOnlyChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelFactory;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelSink;
import org.jboss.netty.channel.DefaultChannelPipeline;
import org.jboss.netty.channel.local.DefaultLocalClientChannelFactory;
import org.jboss.netty.channel.local.LocalChannel;
import org.jboss.netty.channel.socket.nio.NioSocketChannel;
import org.jboss.netty.channel.socket.nio.NioWorker;
import org.junit.runner.RunWith;
import org.traccar.protocol.Jt600FrameDecoder;

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

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      Jt600FrameDecoder jt600FrameDecoder0 = new Jt600FrameDecoder();
      DirectChannelBufferFactory directChannelBufferFactory0 = new DirectChannelBufferFactory(1024);
      byte[] byteArray0 = new byte[11];
      byteArray0[0] = (byte)41;
      ByteBuffer byteBuffer0 = ByteBuffer.wrap(byteArray0);
      ChannelBuffer channelBuffer0 = directChannelBufferFactory0.getBuffer(byteBuffer0);
      try { 
        jt600FrameDecoder0.decode((ChannelHandlerContext) null, (Channel) null, channelBuffer0);
        fail("Expecting exception: ParseException");
      
      } catch(ParseException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.protocol.Jt600FrameDecoder", e);
      }
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      Jt600FrameDecoder jt600FrameDecoder0 = new Jt600FrameDecoder();
      DefaultChannelPipeline defaultChannelPipeline0 = new DefaultChannelPipeline();
      ChannelSink channelSink0 = defaultChannelPipeline0.getSink();
      SocketChannel socketChannel0 = SocketChannel.open();
      NioSocketChannel nioSocketChannel0 = new NioSocketChannel((Channel) null, (ChannelFactory) null, defaultChannelPipeline0, channelSink0, socketChannel0, (NioWorker) null);
      try { 
        jt600FrameDecoder0.decode((ChannelHandlerContext) null, nioSocketChannel0, (ChannelBuffer) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.protocol.Jt600FrameDecoder", e);
      }
  }

  @Test(timeout = 4000)
  public void test2()  throws Throwable  {
      Jt600FrameDecoder jt600FrameDecoder0 = new Jt600FrameDecoder();
      DefaultLocalClientChannelFactory defaultLocalClientChannelFactory0 = new DefaultLocalClientChannelFactory();
      DefaultChannelPipeline defaultChannelPipeline0 = new DefaultChannelPipeline();
      LocalChannel localChannel0 = defaultLocalClientChannelFactory0.newChannel(defaultChannelPipeline0);
      BigEndianHeapChannelBuffer bigEndianHeapChannelBuffer0 = new BigEndianHeapChannelBuffer(1765);
      jt600FrameDecoder0.decode((ChannelHandlerContext) null, localChannel0, bigEndianHeapChannelBuffer0);
      //  // Unstable assertion: assertEquals(32, (int)localChannel0.getId());
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      Jt600FrameDecoder jt600FrameDecoder0 = new Jt600FrameDecoder();
      DefaultChannelPipeline defaultChannelPipeline0 = new DefaultChannelPipeline();
      DefaultLocalClientChannelFactory defaultLocalClientChannelFactory0 = new DefaultLocalClientChannelFactory();
      LocalChannel localChannel0 = defaultLocalClientChannelFactory0.newChannel(defaultChannelPipeline0);
      ByteOrder byteOrder0 = ByteOrder.nativeOrder();
      HeapChannelBufferFactory heapChannelBufferFactory0 = new HeapChannelBufferFactory(byteOrder0);
      ByteBuffer byteBuffer0 = ByteBuffer.allocate(1024);
      ChannelBuffer channelBuffer0 = heapChannelBufferFactory0.getBuffer(byteBuffer0);
      ReadOnlyChannelBuffer readOnlyChannelBuffer0 = new ReadOnlyChannelBuffer(channelBuffer0);
      try { 
        jt600FrameDecoder0.decode((ChannelHandlerContext) null, localChannel0, readOnlyChannelBuffer0);
        fail("Expecting exception: ParseException");
      
      } catch(ParseException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.protocol.Jt600FrameDecoder", e);
      }
  }
}
