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

package org.traccar;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
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.ArnaviProtocol;
import org.traccar.protocol.ArnaviProtocolDecoder;
import org.traccar.protocol.Avl301Protocol;
import org.traccar.protocol.Avl301ProtocolDecoder;
import org.traccar.protocol.GoSafeProtocol;
import org.traccar.protocol.GoSafeProtocolDecoder;
import org.traccar.protocol.MeitrackProtocol;
import org.traccar.protocol.MeitrackProtocolDecoder;
import org.traccar.protocol.OrionProtocol;
import org.traccar.protocol.OrionProtocolDecoder;

@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  {
      GoSafeProtocolDecoder goSafeProtocolDecoder0 = new GoSafeProtocolDecoder((GoSafeProtocol) null);
      // Undeclared exception!
      try { 
        goSafeProtocolDecoder0.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 test1()  throws Throwable  {
      ArnaviProtocol arnaviProtocol0 = new ArnaviProtocol();
      ArnaviProtocolDecoder arnaviProtocolDecoder0 = new ArnaviProtocolDecoder(arnaviProtocol0);
      // Undeclared exception!
      try { 
        arnaviProtocolDecoder0.addUnknownDevice("arnavi");
        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  {
      OrionProtocol orionProtocol0 = new OrionProtocol();
      OrionProtocolDecoder orionProtocolDecoder0 = new OrionProtocolDecoder(orionProtocol0);
      Position position0 = new Position();
      orionProtocolDecoder0.getLastLocation(position0, (Date) null);
      assertNull(position0.getType());
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      Avl301Protocol avl301Protocol0 = new Avl301Protocol();
      Avl301ProtocolDecoder avl301ProtocolDecoder0 = new Avl301ProtocolDecoder(avl301Protocol0);
      DefaultLocalClientChannelFactory defaultLocalClientChannelFactory0 = new DefaultLocalClientChannelFactory();
      DefaultChannelPipeline defaultChannelPipeline0 = new DefaultChannelPipeline();
      LocalChannel localChannel0 = defaultLocalClientChannelFactory0.newChannel(defaultChannelPipeline0);
      MockInetSocketAddress mockInetSocketAddress0 = new MockInetSocketAddress("(d+.d+)([EW]),", 3409);
      String[] stringArray0 = new String[0];
      // Undeclared exception!
      try { 
        avl301ProtocolDecoder0.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  {
      MeitrackProtocol meitrackProtocol0 = new MeitrackProtocol();
      String[] stringArray0 = new String[9];
      MeitrackProtocolDecoder meitrackProtocolDecoder0 = new MeitrackProtocolDecoder(meitrackProtocol0);
      MockInetSocketAddress mockInetSocketAddress0 = new MockInetSocketAddress("kenji", 0);
      // Undeclared exception!
      try { 
        meitrackProtocolDecoder0.getDeviceSession((Channel) null, 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  {
      ArnaviProtocol arnaviProtocol0 = new ArnaviProtocol();
      ArnaviProtocolDecoder arnaviProtocolDecoder0 = new ArnaviProtocolDecoder(arnaviProtocol0);
      String string0 = arnaviProtocolDecoder0.getProtocolName();
      assertEquals("arnavi", string0);
  }
}
