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

package org.traccar;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.net.SocketAddress;
import java.time.Instant;
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.time.MockInstant;
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.EelinkProtocol;
import org.traccar.protocol.EelinkProtocolDecoder;
import org.traccar.protocol.FreedomProtocol;
import org.traccar.protocol.FreedomProtocolDecoder;
import org.traccar.protocol.NoranProtocol;
import org.traccar.protocol.NoranProtocolDecoder;
import org.traccar.protocol.OsmAndProtocol;
import org.traccar.protocol.OsmAndProtocolDecoder;
import org.traccar.protocol.V680Protocol;
import org.traccar.protocol.V680ProtocolDecoder;

@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  {
      OsmAndProtocol osmAndProtocol0 = new OsmAndProtocol();
      OsmAndProtocolDecoder osmAndProtocolDecoder0 = new OsmAndProtocolDecoder(osmAndProtocol0);
      // Undeclared exception!
      try { 
        osmAndProtocolDecoder0.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 test1()  throws Throwable  {
      EelinkProtocolDecoder eelinkProtocolDecoder0 = new EelinkProtocolDecoder((EelinkProtocol) null);
      // Undeclared exception!
      try { 
        eelinkProtocolDecoder0.addUnknownDevice("");
        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  {
      V680Protocol v680Protocol0 = new V680Protocol();
      V680ProtocolDecoder v680ProtocolDecoder0 = new V680ProtocolDecoder(v680Protocol0);
      String string0 = v680ProtocolDecoder0.getProtocolName();
      assertEquals("v680", string0);
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      V680Protocol v680Protocol0 = new V680Protocol();
      V680ProtocolDecoder v680ProtocolDecoder0 = new V680ProtocolDecoder(v680Protocol0);
      Position position0 = new Position();
      Instant instant0 = MockInstant.now();
      Date date0 = Date.from(instant0);
      v680ProtocolDecoder0.getLastLocation(position0, date0);
      assertNull(position0.getType());
  }

  @Test(timeout = 4000)
  public void test4()  throws Throwable  {
      FreedomProtocol freedomProtocol0 = new FreedomProtocol();
      FreedomProtocolDecoder freedomProtocolDecoder0 = new FreedomProtocolDecoder(freedomProtocol0);
      DefaultLocalServerChannelFactory defaultLocalServerChannelFactory0 = new DefaultLocalServerChannelFactory();
      DefaultChannelPipeline defaultChannelPipeline0 = new DefaultChannelPipeline();
      LocalServerChannel localServerChannel0 = defaultLocalServerChannelFactory0.newChannel(defaultChannelPipeline0);
      MockInetSocketAddress mockInetSocketAddress0 = new MockInetSocketAddress("e:Rr&+:[", 679);
      // Undeclared exception!
      try { 
        freedomProtocolDecoder0.getDeviceSession(localServerChannel0, mockInetSocketAddress0, (String[]) 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 test5()  throws Throwable  {
      NoranProtocol noranProtocol0 = new NoranProtocol();
      NoranProtocolDecoder noranProtocolDecoder0 = new NoranProtocolDecoder(noranProtocol0);
      String[] stringArray0 = new String[4];
      // Undeclared exception!
      try { 
        noranProtocolDecoder0.getDeviceSession((Channel) null, (SocketAddress) null, stringArray0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.BaseProtocolDecoder", e);
      }
  }
}
