/*
 * This file was automatically generated by EvoSuite
 * Tue Dec 10 02:50:58 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.CguardProtocol;
import org.traccar.protocol.CguardProtocolDecoder;
import org.traccar.protocol.CityeasyProtocol;
import org.traccar.protocol.CityeasyProtocolDecoder;
import org.traccar.protocol.GalileoProtocol;
import org.traccar.protocol.GalileoProtocolDecoder;
import org.traccar.protocol.PricolProtocol;
import org.traccar.protocol.PricolProtocolDecoder;

@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  {
      PricolProtocol pricolProtocol0 = new PricolProtocol();
      PricolProtocolDecoder pricolProtocolDecoder0 = new PricolProtocolDecoder(pricolProtocol0);
      // Undeclared exception!
      try { 
        pricolProtocolDecoder0.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  {
      GalileoProtocol galileoProtocol0 = new GalileoProtocol();
      GalileoProtocolDecoder galileoProtocolDecoder0 = new GalileoProtocolDecoder(galileoProtocol0);
      // Undeclared exception!
      try { 
        galileoProtocolDecoder0.addUnknownDevice((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 test2()  throws Throwable  {
      CityeasyProtocolDecoder cityeasyProtocolDecoder0 = new CityeasyProtocolDecoder((CityeasyProtocol) null);
      Position position0 = new Position();
      MockDate mockDate0 = new MockDate(0, 0, (-3573));
      cityeasyProtocolDecoder0.getLastLocation(position0, mockDate0);
      assertNull(position0.getProtocol());
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      CguardProtocol cguardProtocol0 = new CguardProtocol();
      CguardProtocolDecoder cguardProtocolDecoder0 = new CguardProtocolDecoder(cguardProtocol0);
      DefaultLocalClientChannelFactory defaultLocalClientChannelFactory0 = new DefaultLocalClientChannelFactory();
      DefaultChannelPipeline defaultChannelPipeline0 = new DefaultChannelPipeline();
      LocalChannel localChannel0 = defaultLocalClientChannelFactory0.newChannel(defaultChannelPipeline0);
      MockInetSocketAddress mockInetSocketAddress0 = new MockInetSocketAddress("", 993);
      String[] stringArray0 = new String[4];
      // Undeclared exception!
      try { 
        cguardProtocolDecoder0.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 test4()  throws Throwable  {
      CityeasyProtocolDecoder cityeasyProtocolDecoder0 = new CityeasyProtocolDecoder((CityeasyProtocol) null);
      InetSocketAddress inetSocketAddress0 = MockInetSocketAddress.createUnresolved(")", 279);
      String[] stringArray0 = new String[3];
      // Undeclared exception!
      try { 
        cityeasyProtocolDecoder0.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 test5()  throws Throwable  {
      GalileoProtocol galileoProtocol0 = new GalileoProtocol();
      GalileoProtocolDecoder galileoProtocolDecoder0 = new GalileoProtocolDecoder(galileoProtocol0);
      String string0 = galileoProtocolDecoder0.getProtocolName();
      assertEquals("galileo", string0);
  }
}
