/*
 * This file was automatically generated by EvoSuite
 * Fri Jun 08 18:22:21 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.awt.Container;
import java.awt.HeadlessException;
import javax.swing.JComponent;
import javax.swing.JFrame;
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.EntrySourceVector;
import uk.ac.sanger.artemis.components.Utilities;
import uk.ac.sanger.artemis.util.InputStreamProgressListener;

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

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      // Undeclared exception!
      try { 
        Utilities.rightJustifyFrame((JFrame) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
      }
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      // Undeclared exception!
      try { 
        Utilities.isMultiDisplay();
      } catch(HeadlessException e) {
    	  	fail("caught HeadlessException");
      }
  }

  @Test(timeout = 4000)
  public void test2()  throws Throwable  {
      // Undeclared exception!
      try { 
        Utilities.getComponentFrame((JComponent) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.Utilities", e);
      }
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      // Undeclared exception!
      try { 
        Utilities.centreOwningFrame((JComponent) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.Utilities", e);
      }
  }

  @Test(timeout = 4000)
  public void test4()  throws Throwable  {
      // Undeclared exception!
      try { 
        Utilities.centreFrame((JFrame) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
      }
  }

  @Test(timeout = 4000)
  public void test5()  throws Throwable  {
      JComponent jComponent0 = mock(JComponent.class, new ViolatedAssumptionAnswer());
      doReturn((Container) null).when(jComponent0).getTopLevelAncestor();
      JFrame jFrame0 = Utilities.getComponentFrame(jComponent0);
      assertNull(jFrame0);
  }

  @Test(timeout = 4000)
  public void test6()  throws Throwable  {
      // Undeclared exception!
      try { 
        Utilities.centreJustifyFrame((JFrame) null, (-1324));
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
      }
  }

  @Test(timeout = 4000)
  public void test7()  throws Throwable  {
      Utilities utilities0 = new Utilities();
  }

  @Test(timeout = 4000)
  public void test8()  throws Throwable  {
      EntrySourceVector entrySourceVector0 = Utilities.getEntrySources((JFrame) null, (InputStreamProgressListener) null);
      assertEquals(2, entrySourceVector0.size());
  }

  @Test(timeout = 4000)
  public void test9()  throws Throwable  {
      JComponent jComponent0 = mock(JComponent.class, new ViolatedAssumptionAnswer());
      doReturn((Container) null).when(jComponent0).getTopLevelAncestor();
      // Undeclared exception!
      try { 
        Utilities.centreOwningFrame(jComponent0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
      }
  }
}
