/*
 * This file was automatically generated by EvoSuite
 * Mon Dec 09 23:02: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.MockInetSocketAddress;
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.Ardi01Protocol;
import org.traccar.protocol.Ardi01ProtocolDecoder;
import org.traccar.protocol.CellocatorProtocol;
import org.traccar.protocol.CellocatorProtocolDecoder;
import org.traccar.protocol.NavisProtocol;
import org.traccar.protocol.NavisProtocolDecoder;
import org.traccar.protocol.OsmAndProtocol;
import org.traccar.protocol.OsmAndProtocolDecoder;
import org.traccar.protocol.Tlt2hProtocol;
import org.traccar.protocol.Tlt2hProtocolDecoder;

@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);
      String string0 = osmAndProtocolDecoder0.getProtocolName();
      assertEquals("osmand", string0);
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      NavisProtocol navisProtocol0 = new NavisProtocol();
      NavisProtocolDecoder navisProtocolDecoder0 = new NavisProtocolDecoder(navisProtocol0);
      // Undeclared exception!
      try { 
        navisProtocolDecoder0.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  {
      CellocatorProtocol cellocatorProtocol0 = new CellocatorProtocol();
      CellocatorProtocolDecoder cellocatorProtocolDecoder0 = new CellocatorProtocolDecoder(cellocatorProtocol0);
      // Undeclared exception!
      try { 
        cellocatorProtocolDecoder0.addUnknownDevice("26I\"EV");
        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  {
      Ardi01ProtocolDecoder ardi01ProtocolDecoder0 = new Ardi01ProtocolDecoder((Ardi01Protocol) null);
      Position position0 = new Position();
      ardi01ProtocolDecoder0.getLastLocation(position0, (Date) null);
      assertNull(position0.getAddress());
  }

  @Test(timeout = 4000)
  public void test4()  throws Throwable  {
      OsmAndProtocol osmAndProtocol0 = new OsmAndProtocol();
      OsmAndProtocolDecoder osmAndProtocolDecoder0 = new OsmAndProtocolDecoder(osmAndProtocol0);
      DefaultLocalClientChannelFactory defaultLocalClientChannelFactory0 = new DefaultLocalClientChannelFactory();
      DefaultChannelPipeline defaultChannelPipeline0 = new DefaultChannelPipeline();
      LocalChannel localChannel0 = defaultLocalClientChannelFactory0.newChannel(defaultChannelPipeline0);
      MockInetSocketAddress mockInetSocketAddress0 = new MockInetSocketAddress((InetAddress) null, 12);
      String[] stringArray0 = new String[2];
      // Undeclared exception!
      try { 
        osmAndProtocolDecoder0.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  {
      Tlt2hProtocol tlt2hProtocol0 = new Tlt2hProtocol();
      Tlt2hProtocolDecoder tlt2hProtocolDecoder0 = new Tlt2hProtocolDecoder(tlt2hProtocol0);
      String[] stringArray0 = new String[4];
      // Undeclared exception!
      try { 
        tlt2hProtocolDecoder0.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);
      }
  }

  @Test(timeout = 4000)
  public void test6()  throws Throwable  {
      Ardi01ProtocolDecoder ardi01ProtocolDecoder0 = new Ardi01ProtocolDecoder((Ardi01Protocol) null);
      // Undeclared exception!
      try { 
        ardi01ProtocolDecoder0.getProtocolName();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.BaseProtocolDecoder", e);
      }
  }
}
