/*
 * This file was automatically generated by EvoSuite
 * Thu Jun 07 14:59:25 GMT 2018
 */

package uk.ac.sanger.artemis.components.alignment;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import htsjdk.samtools.SAMRecord;
import java.io.File;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import java.util.Stack;
import java.util.Vector;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.mock.java.io.MockFile;
import org.junit.runner.RunWith;
import uk.ac.sanger.artemis.components.alignment.RunSamTools;

@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = false, useJEE = true) 
public class RunSamTools_ESTest extends RunSamTools_ESTest_scaffolding {

  @Test(timeout = 4000)
  public void test00()  throws Throwable  {
      String[] stringArray0 = new String[7];
      MockFile mockFile0 = new MockFile("r.un%", "r.un%");
      Stack<SAMRecord> stack0 = new Stack<SAMRecord>();
      RunSamTools runSamTools0 = new RunSamTools(stringArray0, stringArray0, mockFile0, stack0);
      // Undeclared exception!
      try { 
        runSamTools0.waitForStdout();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.alignment.RunSamTools", e);
      }
  }

  @Test(timeout = 4000)
  public void test01()  throws Throwable  {
      String[] stringArray0 = new String[4];
      ArrayList<SAMRecord> arrayList0 = new ArrayList<SAMRecord>();
      RunSamTools runSamTools0 = new RunSamTools(stringArray0, stringArray0, (File) null, arrayList0);
      // Undeclared exception!
      try { 
        runSamTools0.waitFor();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.alignment.RunSamTools", e);
      }
  }

  @Test(timeout = 4000)
  public void test02()  throws Throwable  {
      String[] stringArray0 = new String[1];
      Stack<SAMRecord> stack0 = new Stack<SAMRecord>();
      RunSamTools runSamTools0 = new RunSamTools(stringArray0, stringArray0, (File) null, stack0);
      // Undeclared exception!
      try { 
        runSamTools0.getProcessStdout();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.alignment.RunSamTools", e);
      }
  }

  @Test(timeout = 4000)
  public void test03()  throws Throwable  {
      String[] stringArray0 = new String[1];
      File file0 = MockFile.createTempFile("^%n  `t9! U<thae", "^%n  `t9! U<thae");
      RunSamTools runSamTools0 = new RunSamTools(stringArray0, stringArray0, file0, (List<SAMRecord>) null);
      // Undeclared exception!
      try { 
        runSamTools0.getProcessStderr();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.alignment.RunSamTools", e);
      }
  }

  @Test(timeout = 4000)
  public void test04()  throws Throwable  {
      MockFile mockFile0 = new MockFile("", "");
      LinkedList<SAMRecord> linkedList0 = new LinkedList<SAMRecord>();
      RunSamTools runSamTools0 = null;
      try {
        runSamTools0 = new RunSamTools((String[]) null, (String[]) null, mockFile0, linkedList0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.alignment.RunSamTools", e);
      }
  }

  @Test(timeout = 4000)
  public void test05()  throws Throwable  {
      String[] stringArray0 = new String[0];
      MockFile mockFile0 = new MockFile("", "");
      Stack<SAMRecord> stack0 = new Stack<SAMRecord>();
      RunSamTools runSamTools0 = null;
      try {
        runSamTools0 = new RunSamTools(stringArray0, stringArray0, mockFile0, stack0);
        fail("Expecting exception: ArrayIndexOutOfBoundsException");
      
      } catch(ArrayIndexOutOfBoundsException e) {
         //
         // 0
         //
         verifyException("uk.ac.sanger.artemis.components.alignment.RunSamTools", e);
      }
  }

  @Test(timeout = 4000)
  public void test06()  throws Throwable  {
      String[] stringArray0 = new String[4];
      Stack<SAMRecord> stack0 = new Stack<SAMRecord>();
      RunSamTools runSamTools0 = new RunSamTools(stringArray0, stringArray0, (File) null, stack0);
      runSamTools0.getInitialIOError();
      assertEquals("1", runSamTools0.getStatus());
  }

  @Test(timeout = 4000)
  public void test07()  throws Throwable  {
      String[] stringArray0 = new String[4];
      Stack<SAMRecord> stack0 = new Stack<SAMRecord>();
      RunSamTools runSamTools0 = new RunSamTools(stringArray0, stringArray0, (File) null, stack0);
      String string0 = runSamTools0.getStatus();
      assertEquals("1", string0);
  }

  @Test(timeout = 4000)
  public void test08()  throws Throwable  {
      String[] stringArray0 = new String[4];
      Stack<SAMRecord> stack0 = new Stack<SAMRecord>();
      RunSamTools runSamTools0 = new RunSamTools(stringArray0, stringArray0, (File) null, stack0);
      runSamTools0.getProcess();
      assertEquals("1", runSamTools0.getStatus());
  }

  @Test(timeout = 4000)
  public void test09()  throws Throwable  {
      String[] stringArray0 = new String[2];
      Vector<SAMRecord> vector0 = new Vector<SAMRecord>();
      RunSamTools runSamTools0 = new RunSamTools(stringArray0, stringArray0, (File) null, vector0);
      RunSamTools.StderrHandler runSamTools_StderrHandler0 = runSamTools0.new StderrHandler(runSamTools0);
      // Undeclared exception!
      try { 
        runSamTools_StderrHandler0.run();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.alignment.RunSamTools", e);
      }
  }

  @Test(timeout = 4000)
  public void test10()  throws Throwable  {
      MockFile mockFile0 = new MockFile("3INSERTON");
      String[] stringArray0 = new String[9];
      Vector<SAMRecord> vector0 = new Vector<SAMRecord>();
      RunSamTools runSamTools0 = new RunSamTools(stringArray0, stringArray0, mockFile0, vector0);
      RunSamTools.StdoutHandler runSamTools_StdoutHandler0 = runSamTools0.new StdoutHandler(runSamTools0);
      // Undeclared exception!
      try { 
        runSamTools_StdoutHandler0.run();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.alignment.RunSamTools", e);
      }
  }
}
