/*
 * This file was automatically generated by EvoSuite
 * Thu Sep 20 13:41:25 GMT 2018
 */

package uk.ac.sanger.artemis;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import static org.evosuite.runtime.EvoAssertions.*;
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.ExternalProgramEvent;
import uk.ac.sanger.artemis.ExternalProgramListener;
import uk.ac.sanger.artemis.Logger;
import uk.ac.sanger.artemis.SimpleExternalProgramMonitor;

@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, useJEE = true) 
public class SimpleExternalProgramMonitor_ESTest extends SimpleExternalProgramMonitor_ESTest_scaffolding {

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      Logger logger0 = mock(Logger.class, new ViolatedAssumptionAnswer());
      SimpleExternalProgramMonitor simpleExternalProgramMonitor0 = new SimpleExternalProgramMonitor((String) null, logger0);
      String string0 = simpleExternalProgramMonitor0.getProgramName();
      assertNull(string0);
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      Logger logger0 = mock(Logger.class, new ViolatedAssumptionAnswer());
      SimpleExternalProgramMonitor simpleExternalProgramMonitor0 = new SimpleExternalProgramMonitor("_>ETvRE&cA2N", logger0);
      String string0 = simpleExternalProgramMonitor0.getProgramName();
      assertEquals("_>ETvRE&cA2N", string0);
  }

  @Test(timeout = 4000)
  public void test2()  throws Throwable  {
      SimpleExternalProgramMonitor simpleExternalProgramMonitor0 = new SimpleExternalProgramMonitor("", (Logger) null);
      Logger logger0 = simpleExternalProgramMonitor0.getLogger();
      assertNull(logger0);
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      Logger logger0 = mock(Logger.class, new ViolatedAssumptionAnswer());
      SimpleExternalProgramMonitor simpleExternalProgramMonitor0 = new SimpleExternalProgramMonitor("", logger0);
      simpleExternalProgramMonitor0.addExternalProgramListener((ExternalProgramListener) null);
      ExternalProgramEvent externalProgramEvent0 = mock(ExternalProgramEvent.class, new ViolatedAssumptionAnswer());
      // Undeclared exception!
      try { 
        simpleExternalProgramMonitor0.sendEvent(externalProgramEvent0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.SimpleExternalProgramMonitor", e);
      }
  }

  @Test(timeout = 4000)
  public void test4()  throws Throwable  {
      Logger logger0 = mock(Logger.class, new ViolatedAssumptionAnswer());
      SimpleExternalProgramMonitor simpleExternalProgramMonitor0 = new SimpleExternalProgramMonitor((String) null, logger0);
      ExternalProgramListener externalProgramListener0 = mock(ExternalProgramListener.class, new ViolatedAssumptionAnswer());
      simpleExternalProgramMonitor0.addExternalProgramListener(externalProgramListener0);
      ExternalProgramEvent externalProgramEvent0 = mock(ExternalProgramEvent.class, new ViolatedAssumptionAnswer());
      simpleExternalProgramMonitor0.sendEvent(externalProgramEvent0);
      assertNull(simpleExternalProgramMonitor0.getProgramName());
  }

  @Test(timeout = 4000)
  public void test5()  throws Throwable  {
      Logger logger0 = mock(Logger.class, new ViolatedAssumptionAnswer());
      doReturn((String) null).when(logger0).toString();
      SimpleExternalProgramMonitor simpleExternalProgramMonitor0 = new SimpleExternalProgramMonitor((String) null, logger0);
      Logger logger1 = simpleExternalProgramMonitor0.getLogger();
      assertSame(logger1, logger0);
  }

  @Test(timeout = 4000)
  public void test6()  throws Throwable  {
      Logger logger0 = mock(Logger.class, new ViolatedAssumptionAnswer());
      SimpleExternalProgramMonitor simpleExternalProgramMonitor0 = new SimpleExternalProgramMonitor("", logger0);
      String string0 = simpleExternalProgramMonitor0.getProgramName();
      assertEquals("", string0);
  }
}
