/*
 * This file was automatically generated by EvoSuite
 * Tue Dec 10 02:46: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.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.GpsGateProtocol;
import org.traccar.protocol.GpsGateProtocolDecoder;
import org.traccar.protocol.OwnTracksProtocol;
import org.traccar.protocol.OwnTracksProtocolDecoder;
import org.traccar.protocol.ProgressProtocol;
import org.traccar.protocol.ProgressProtocolDecoder;
import org.traccar.protocol.ThinkRaceProtocol;
import org.traccar.protocol.ThinkRaceProtocolDecoder;
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  {
      VisiontekProtocol visiontekProtocol0 = new VisiontekProtocol();
      VisiontekProtocolDecoder visiontekProtocolDecoder0 = new VisiontekProtocolDecoder(visiontekProtocol0);
      String string0 = visiontekProtocolDecoder0.getProtocolName();
      assertEquals("visiontek", string0);
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      ThinkRaceProtocol thinkRaceProtocol0 = new ThinkRaceProtocol();
      ThinkRaceProtocolDecoder thinkRaceProtocolDecoder0 = new ThinkRaceProtocolDecoder(thinkRaceProtocol0);
      // Undeclared exception!
      try { 
        thinkRaceProtocolDecoder0.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  {
      OwnTracksProtocol ownTracksProtocol0 = new OwnTracksProtocol();
      OwnTracksProtocolDecoder ownTracksProtocolDecoder0 = new OwnTracksProtocolDecoder(ownTracksProtocol0);
      // Undeclared exception!
      try { 
        ownTracksProtocolDecoder0.addUnknownDevice("online");
        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  {
      VisiontekProtocol visiontekProtocol0 = new VisiontekProtocol();
      VisiontekProtocolDecoder visiontekProtocolDecoder0 = new VisiontekProtocolDecoder(visiontekProtocol0);
      Position position0 = new Position();
      MockDate mockDate0 = new MockDate(0, 0, 0, 0, 0, (-2692));
      visiontekProtocolDecoder0.getLastLocation(position0, mockDate0);
      assertNull(position0.getAddress());
  }

  @Test(timeout = 4000)
  public void test4()  throws Throwable  {
      ProgressProtocol progressProtocol0 = new ProgressProtocol();
      ProgressProtocolDecoder progressProtocolDecoder0 = new ProgressProtocolDecoder(progressProtocol0);
      DefaultLocalServerChannelFactory defaultLocalServerChannelFactory0 = new DefaultLocalServerChannelFactory();
      DefaultChannelPipeline defaultChannelPipeline0 = new DefaultChannelPipeline();
      LocalServerChannel localServerChannel0 = defaultLocalServerChannelFactory0.newChannel(defaultChannelPipeline0);
      InetSocketAddress inetSocketAddress0 = MockInetSocketAddress.createUnresolved("database.saveEmpty", 100);
      String[] stringArray0 = new String[4];
      // Undeclared exception!
      try { 
        progressProtocolDecoder0.getDeviceSession(localServerChannel0, 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 test5()  throws Throwable  {
      GpsGateProtocolDecoder gpsGateProtocolDecoder0 = new GpsGateProtocolDecoder((GpsGateProtocol) null);
      // Undeclared exception!
      try { 
        gpsGateProtocolDecoder0.getProtocolName();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.BaseProtocolDecoder", e);
      }
  }
}
