/*
 * This file was automatically generated by EvoSuite
 * Thu Jan 21 19:15:37 GMT 2021
 */

package org.apache.commons.io;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.io.PipedOutputStream;
import org.apache.commons.io.HexDump;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;

@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
public class HexDump_ESTest extends HexDump_ESTest_scaffolding {

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      byte[] byteArray0 = new byte[17];
      byteArray0[9] = (byte)127;
      OutputStream outputStream0 = OutputStream.nullOutputStream();
      HexDump.dump(byteArray0, (byte)127, outputStream0, (byte)4);
      assertEquals(17, byteArray0.length);
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      byte[] byteArray0 = new byte[17];
      byteArray0[3] = (byte)54;
      ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream((byte)14);
      BufferedOutputStream bufferedOutputStream0 = new BufferedOutputStream(byteArrayOutputStream0, (byte)14);
      HexDump.dump(byteArray0, (byte)0, bufferedOutputStream0, (byte)0);
      assertEquals(135, byteArrayOutputStream0.size());
      assertEquals("00000000 00 00 00 36 00 00 00 00 00 00 00 00 00 00 00 00 ...6............\r\n00000010 00                                              .\r\n", byteArrayOutputStream0.toString());
  }

  @Test(timeout = 4000)
  public void test2()  throws Throwable  {
      byte[] byteArray0 = new byte[10];
      try { 
        HexDump.dump(byteArray0, (byte)1, (OutputStream) null, (byte)1);
        fail("Expecting exception: IllegalArgumentException");
      
      } catch(IllegalArgumentException e) {
         //
         // cannot write to nullstream
         //
         verifyException("org.apache.commons.io.HexDump", e);
      }
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      byte[] byteArray0 = new byte[17];
      OutputStream outputStream0 = OutputStream.nullOutputStream();
      try { 
        HexDump.dump(byteArray0, (byte)4, outputStream0, 689);
        fail("Expecting exception: ArrayIndexOutOfBoundsException");
      
      } catch(ArrayIndexOutOfBoundsException e) {
         //
         // illegal index: 689 into array of length 17
         //
         verifyException("org.apache.commons.io.HexDump", e);
      }
  }

  @Test(timeout = 4000)
  public void test4()  throws Throwable  {
      byte[] byteArray0 = new byte[11];
      PipedOutputStream pipedOutputStream0 = new PipedOutputStream();
      try { 
        HexDump.dump(byteArray0, (byte) (-13), pipedOutputStream0, (byte) (-13));
        fail("Expecting exception: ArrayIndexOutOfBoundsException");
      
      } catch(ArrayIndexOutOfBoundsException e) {
         //
         // illegal index: -13 into array of length 11
         //
         verifyException("org.apache.commons.io.HexDump", e);
      }
  }

  @Test(timeout = 4000)
  public void test5()  throws Throwable  {
      HexDump hexDump0 = new HexDump();
  }
}
