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

package org.traccar;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.net.InetSocketAddress;
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.DefaultLocalClientChannelFactory;
import org.jboss.netty.channel.local.LocalChannel;
import org.junit.runner.RunWith;
import org.traccar.model.Position;
import org.traccar.protocol.BoxProtocol;
import org.traccar.protocol.BoxProtocolDecoder;
import org.traccar.protocol.CarscopProtocol;
import org.traccar.protocol.CarscopProtocolDecoder;
import org.traccar.protocol.GatorProtocol;
import org.traccar.protocol.GatorProtocolDecoder;
import org.traccar.protocol.GnxProtocol;
import org.traccar.protocol.GnxProtocolDecoder;
import org.traccar.protocol.Stl060Protocol;
import org.traccar.protocol.Stl060ProtocolDecoder;
import org.traccar.protocol.VisiontekProtocol;
import org.traccar.protocol.VisiontekProtocolDecoder;

@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  {
      Stl060Protocol stl060Protocol0 = new Stl060Protocol();
      Stl060ProtocolDecoder stl060ProtocolDecoder0 = new Stl060ProtocolDecoder(stl060Protocol0);
      String string0 = stl060ProtocolDecoder0.getProtocolName();
      assertEquals("stl060", string0);
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      VisiontekProtocol visiontekProtocol0 = new VisiontekProtocol();
      VisiontekProtocolDecoder visiontekProtocolDecoder0 = new VisiontekProtocolDecoder(visiontekProtocol0);
      // Undeclared exception!
      try { 
        visiontekProtocolDecoder0.getLastLocation((Position) null, (Date) null);
        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  {
      GatorProtocol gatorProtocol0 = new GatorProtocol();
      GatorProtocolDecoder gatorProtocolDecoder0 = new GatorProtocolDecoder(gatorProtocol0);
      // Undeclared exception!
      try { 
        gatorProtocolDecoder0.addUnknownDevice("org.traccar.database.ConnectionManager");
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.BaseProtocolDecoder", e);
      }
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      GnxProtocolDecoder gnxProtocolDecoder0 = new GnxProtocolDecoder((GnxProtocol) null);
      Position position0 = new Position();
      MockDate mockDate0 = new MockDate(1482, (-949), 0, (-949), 1482);
      gnxProtocolDecoder0.getLastLocation(position0, mockDate0);
      assertEquals(0.0, position0.getLongitude(), 0.01);
  }

  @Test(timeout = 4000)
  public void test4()  throws Throwable  {
      BoxProtocol boxProtocol0 = new BoxProtocol();
      BoxProtocolDecoder boxProtocolDecoder0 = new BoxProtocolDecoder(boxProtocol0);
      DefaultLocalClientChannelFactory defaultLocalClientChannelFactory0 = new DefaultLocalClientChannelFactory();
      DefaultChannelPipeline defaultChannelPipeline0 = new DefaultChannelPipeline();
      LocalChannel localChannel0 = defaultLocalClientChannelFactory0.newChannel(defaultChannelPipeline0);
      MockInetSocketAddress mockInetSocketAddress0 = new MockInetSocketAddress("c", 0);
      String[] stringArray0 = new String[8];
      // Undeclared exception!
      try { 
        boxProtocolDecoder0.getDeviceSession(localChannel0, 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  {
      CarscopProtocol carscopProtocol0 = new CarscopProtocol();
      CarscopProtocolDecoder carscopProtocolDecoder0 = new CarscopProtocolDecoder(carscopProtocol0);
      InetSocketAddress inetSocketAddress0 = MockInetSocketAddress.createUnresolved(",mU", 0);
      String[] stringArray0 = new String[4];
      // Undeclared exception!
      try { 
        carscopProtocolDecoder0.getDeviceSession((Channel) null, inetSocketAddress0, 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 test6()  throws Throwable  {
      GnxProtocolDecoder gnxProtocolDecoder0 = new GnxProtocolDecoder((GnxProtocol) null);
      // Undeclared exception!
      try { 
        gnxProtocolDecoder0.getProtocolName();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.BaseProtocolDecoder", e);
      }
  }
}
