/*
 * This file was automatically generated by EvoSuite
 * Tue Dec 10 02:39:20 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.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.BceProtocol;
import org.traccar.protocol.BceProtocolDecoder;
import org.traccar.protocol.BlackKiteProtocol;
import org.traccar.protocol.BlackKiteProtocolDecoder;
import org.traccar.protocol.KenjiProtocol;
import org.traccar.protocol.KenjiProtocolDecoder;
import org.traccar.protocol.MtxProtocol;
import org.traccar.protocol.MtxProtocolDecoder;
import org.traccar.protocol.WatchProtocol;
import org.traccar.protocol.WatchProtocolDecoder;
import org.traccar.protocol.WondexProtocol;
import org.traccar.protocol.WondexProtocolDecoder;

@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  {
      MtxProtocol mtxProtocol0 = new MtxProtocol();
      MtxProtocolDecoder mtxProtocolDecoder0 = new MtxProtocolDecoder(mtxProtocol0);
      String string0 = mtxProtocolDecoder0.getProtocolName();
      assertEquals("mtx", string0);
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      BceProtocol bceProtocol0 = new BceProtocol();
      BceProtocolDecoder bceProtocolDecoder0 = new BceProtocolDecoder(bceProtocol0);
      // Undeclared exception!
      try { 
        bceProtocolDecoder0.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  {
      BlackKiteProtocol blackKiteProtocol0 = new BlackKiteProtocol();
      BlackKiteProtocolDecoder blackKiteProtocolDecoder0 = new BlackKiteProtocolDecoder(blackKiteProtocol0);
      // Undeclared exception!
      try { 
        blackKiteProtocolDecoder0.addUnknownDevice("");
        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  {
      WondexProtocol wondexProtocol0 = new WondexProtocol();
      WondexProtocolDecoder wondexProtocolDecoder0 = new WondexProtocolDecoder(wondexProtocol0);
      Position position0 = new Position();
      wondexProtocolDecoder0.getLastLocation(position0, (Date) null);
      assertEquals(0.0, position0.getLongitude(), 0.01);
  }

  @Test(timeout = 4000)
  public void test4()  throws Throwable  {
      WondexProtocol wondexProtocol0 = new WondexProtocol();
      WondexProtocolDecoder wondexProtocolDecoder0 = new WondexProtocolDecoder(wondexProtocol0);
      DefaultLocalServerChannelFactory defaultLocalServerChannelFactory0 = new DefaultLocalServerChannelFactory();
      DefaultChannelPipeline defaultChannelPipeline0 = new DefaultChannelPipeline();
      LocalServerChannel localServerChannel0 = defaultLocalServerChannelFactory0.newChannel(defaultChannelPipeline0);
      InetSocketAddress inetSocketAddress0 = MockInetSocketAddress.createUnresolved("decoder.ignoreSessionCache", 2949);
      String[] stringArray0 = new String[4];
      // Undeclared exception!
      try { 
        wondexProtocolDecoder0.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  {
      WatchProtocol watchProtocol0 = new WatchProtocol();
      WatchProtocolDecoder watchProtocolDecoder0 = new WatchProtocolDecoder(watchProtocol0);
      MockInetSocketAddress mockInetSocketAddress0 = new MockInetSocketAddress("Kp", 0);
      String[] stringArray0 = new String[2];
      // Undeclared exception!
      try { 
        watchProtocolDecoder0.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 test6()  throws Throwable  {
      KenjiProtocolDecoder kenjiProtocolDecoder0 = new KenjiProtocolDecoder((KenjiProtocol) null);
      // Undeclared exception!
      try { 
        kenjiProtocolDecoder0.getProtocolName();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("org.traccar.BaseProtocolDecoder", e);
      }
  }
}
