/*
 * This file was automatically generated by EvoSuite
 * Wed Sep 19 22:03:15 GMT 2018
 */

package uk.ac.sanger.artemis.components;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.io.InputStream;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.junit.runner.RunWith;
import uk.ac.sanger.artemis.components.ProcessWatcher;
import uk.ac.sanger.artemis.components.ProcessWatcherListener;
import java.awt.HeadlessException;

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

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      Process process0 = mock(Process.class, new ViolatedAssumptionAnswer());
      doReturn((InputStream) null).when(process0).getErrorStream();
      ProcessWatcher processWatcher0 = new ProcessWatcher(process0, "", false);
      // Undeclared exception!
      try { 
        processWatcher0.run();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("java.io.Reader", e);
      }
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      Process process0 = mock(Process.class, new ViolatedAssumptionAnswer());
      ProcessWatcher processWatcher0 = new ProcessWatcher(process0, "ofkwFA");
      processWatcher0.addProcessWatcherListener((ProcessWatcherListener) null);
  }

  @Test(timeout = 4000)
  public void test2()  throws Throwable  {
      InputStream inputStream0 = mock(InputStream.class, new ViolatedAssumptionAnswer());
      Process process0 = mock(Process.class, new ViolatedAssumptionAnswer());
      doReturn(inputStream0).when(process0).getErrorStream();
      ProcessWatcher processWatcher0 = new ProcessWatcher(process0, "ofkwFA");
      // Undeclared exception!
      try { 
        processWatcher0.run();
        fail("Expecting exception: HeadlessException");
      
      } catch(HeadlessException e) {
        
      }
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      Process process0 = mock(Process.class, new ViolatedAssumptionAnswer());
      ProcessWatcher processWatcher0 = new ProcessWatcher(process0, "ofkwFA");
      processWatcher0.removeProcessWatcherListener((ProcessWatcherListener) null);
  }
}
