/*
 * This file was automatically generated by EvoSuite
 * Mon Dec 09 22:59:01 GMT 2019
 */

package org.traccar;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.util.Date;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.mock.java.net.MockInetSocketAddress;
import org.evosuite.runtime.mock.java.util.MockDate;
import org.jboss.netty.channel.Channel;
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.model.Position;
import org.traccar.protocol.Ardi01Protocol;
import org.traccar.protocol.Ardi01ProtocolDecoder;
import org.traccar.protocol.AutoFonProtocol;
import org.traccar.protocol.AutoFonProtocolDecoder;
import org.traccar.protocol.AutoGradeProtocol;
import org.traccar.protocol.AutoGradeProtocolDecoder;
import org.traccar.protocol.BlackKiteProtocol;
import org.traccar.protocol.BlackKiteProtocolDecoder;
import org.traccar.protocol.GotopProtocol;
import org.traccar.protocol.GotopProtocolDecoder;
import org.traccar.protocol.XexunProtocol;
import org.traccar.protocol.XexunProtocolDecoder;

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

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      XexunProtocol xexunProtocol0 = new XexunProtocol();
      XexunProtocolDecoder xexunProtocolDecoder0 = new XexunProtocolDecoder(xexunProtocol0, true);
      MockDate mockDate0 = new MockDate();
      // Undeclared exception!
      try { 
        xexunProtocolDecoder0.getLastLocation((Position) null, mockDate0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.BaseProtocolDecoder", e);
      }
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      AutoFonProtocol autoFonProtocol0 = new AutoFonProtocol();
      AutoFonProtocolDecoder autoFonProtocolDecoder0 = new AutoFonProtocolDecoder(autoFonProtocol0);
      // Undeclared exception!
      try { 
        autoFonProtocolDecoder0.addUnknownDevice("in3");
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.BaseProtocolDecoder", e);
      }
  }

  @Test(timeout = 4000)
  public void test2()  throws Throwable  {
      AutoGradeProtocol autoGradeProtocol0 = new AutoGradeProtocol();
      AutoGradeProtocolDecoder autoGradeProtocolDecoder0 = new AutoGradeProtocolDecoder(autoGradeProtocol0);
      String string0 = autoGradeProtocolDecoder0.getProtocolName();
      assertEquals("autograde", string0);
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      BlackKiteProtocolDecoder blackKiteProtocolDecoder0 = new BlackKiteProtocolDecoder((BlackKiteProtocol) null);
      Position position0 = new Position();
      blackKiteProtocolDecoder0.getLastLocation(position0, (Date) null);
      assertEquals(0L, position0.getId());
  }

  @Test(timeout = 4000)
  public void test4()  throws Throwable  {
      Ardi01Protocol ardi01Protocol0 = new Ardi01Protocol();
      String[] stringArray0 = new String[2];
      Ardi01ProtocolDecoder ardi01ProtocolDecoder0 = new Ardi01ProtocolDecoder(ardi01Protocol0);
      DefaultChannelPipeline defaultChannelPipeline0 = new DefaultChannelPipeline();
      DefaultLocalServerChannelFactory defaultLocalServerChannelFactory0 = new DefaultLocalServerChannelFactory();
      LocalServerChannel localServerChannel0 = defaultLocalServerChannelFactory0.newChannel(defaultChannelPipeline0);
      MockInetSocketAddress mockInetSocketAddress0 = new MockInetSocketAddress("", 2957);
      // Undeclared exception!
      try { 
        ardi01ProtocolDecoder0.getDeviceSession(localServerChannel0, mockInetSocketAddress0, stringArray0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.BaseProtocolDecoder", e);
      }
  }

  @Test(timeout = 4000)
  public void test5()  throws Throwable  {
      GotopProtocol gotopProtocol0 = new GotopProtocol();
      String[] stringArray0 = new String[2];
      GotopProtocolDecoder gotopProtocolDecoder0 = new GotopProtocolDecoder(gotopProtocol0);
      MockInetSocketAddress mockInetSocketAddress0 = new MockInetSocketAddress(0);
      // Undeclared exception!
      try { 
        gotopProtocolDecoder0.getDeviceSession((Channel) null, mockInetSocketAddress0, stringArray0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.BaseProtocolDecoder", e);
      }
  }
}
