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

package org.traccar;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.net.InetAddress;
import java.net.SocketAddress;
import java.util.Date;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.mock.java.net.MockInetAddress;
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.AquilaProtocol;
import org.traccar.protocol.AquilaProtocolDecoder;
import org.traccar.protocol.CarscopProtocol;
import org.traccar.protocol.CarscopProtocolDecoder;
import org.traccar.protocol.M2mProtocol;
import org.traccar.protocol.M2mProtocolDecoder;
import org.traccar.protocol.NoranProtocol;
import org.traccar.protocol.NoranProtocolDecoder;
import org.traccar.protocol.OrionProtocol;
import org.traccar.protocol.OrionProtocolDecoder;
import org.traccar.protocol.Tk103Protocol;
import org.traccar.protocol.Tk103ProtocolDecoder;
import org.traccar.protocol.Vt200Protocol;
import org.traccar.protocol.Vt200ProtocolDecoder;

@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  {
      Tk103Protocol tk103Protocol0 = new Tk103Protocol();
      Tk103ProtocolDecoder tk103ProtocolDecoder0 = new Tk103ProtocolDecoder(tk103Protocol0);
      String string0 = tk103ProtocolDecoder0.getProtocolName();
      assertEquals("tk103", string0);
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      CarscopProtocol carscopProtocol0 = new CarscopProtocol();
      CarscopProtocolDecoder carscopProtocolDecoder0 = new CarscopProtocolDecoder(carscopProtocol0);
      MockDate mockDate0 = new MockDate(2110L);
      // Undeclared exception!
      try { 
        carscopProtocolDecoder0.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 test2()  throws Throwable  {
      M2mProtocol m2mProtocol0 = new M2mProtocol();
      M2mProtocolDecoder m2mProtocolDecoder0 = new M2mProtocolDecoder(m2mProtocol0);
      // Undeclared exception!
      try { 
        m2mProtocolDecoder0.addUnknownDevice("M%$;:>VuIF");
        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  {
      NoranProtocolDecoder noranProtocolDecoder0 = new NoranProtocolDecoder((NoranProtocol) null);
      // Undeclared exception!
      try { 
        noranProtocolDecoder0.getProtocolName();
        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  {
      AquilaProtocol aquilaProtocol0 = new AquilaProtocol();
      AquilaProtocolDecoder aquilaProtocolDecoder0 = new AquilaProtocolDecoder(aquilaProtocol0);
      Position position0 = new Position();
      aquilaProtocolDecoder0.getLastLocation(position0, (Date) null);
      assertEquals("aquila", aquilaProtocolDecoder0.getProtocolName());
  }

  @Test(timeout = 4000)
  public void test5()  throws Throwable  {
      OrionProtocol orionProtocol0 = new OrionProtocol();
      OrionProtocolDecoder orionProtocolDecoder0 = new OrionProtocolDecoder(orionProtocol0);
      DefaultLocalServerChannelFactory defaultLocalServerChannelFactory0 = new DefaultLocalServerChannelFactory();
      DefaultChannelPipeline defaultChannelPipeline0 = new DefaultChannelPipeline();
      LocalServerChannel localServerChannel0 = defaultLocalServerChannelFactory0.newChannel(defaultChannelPipeline0);
      InetAddress inetAddress0 = MockInetAddress.getByName("Unknown device -");
      MockInetSocketAddress mockInetSocketAddress0 = new MockInetSocketAddress(inetAddress0, 0);
      String[] stringArray0 = new String[0];
      // Undeclared exception!
      try { 
        orionProtocolDecoder0.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 test6()  throws Throwable  {
      String[] stringArray0 = new String[3];
      Vt200Protocol vt200Protocol0 = new Vt200Protocol();
      Vt200ProtocolDecoder vt200ProtocolDecoder0 = new Vt200ProtocolDecoder(vt200Protocol0);
      // Undeclared exception!
      try { 
        vt200ProtocolDecoder0.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);
      }
  }
}
