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

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

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.Dimension;
import java.awt.Graphics;
import java.awt.HeadlessException;
import java.awt.print.PageFormat;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import javax.swing.DebugGraphics;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.plaf.synth.SynthSeparatorUI;
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.variant.PrintVCFview;
import uk.ac.sanger.artemis.components.variant.VCFview;

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

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      JList<Object> jList0 = new JList<Object>();
      assertNotNull(jList0);
      assertTrue(jList0.getFocusTraversalKeysEnabled());
      assertFalse(jList0.isFocusTraversalPolicySet());
      assertFalse(jList0.getIgnoreRepaint());
      assertFalse(jList0.isFocusCycleRoot());
      assertFalse(jList0.isFocusTraversalPolicyProvider());
      
      Dimension dimension0 = jList0.getPreferredScrollableViewportSize();
      assertNotNull(dimension0);
      assertTrue(jList0.getFocusTraversalKeysEnabled());
      assertFalse(jList0.isFocusTraversalPolicySet());
      assertFalse(jList0.getIgnoreRepaint());
      assertFalse(jList0.isFocusCycleRoot());
      assertFalse(jList0.isFocusTraversalPolicyProvider());
      assertEquals(256.0, dimension0.getWidth(), 0.01);
      assertEquals(128.0, dimension0.getHeight(), 0.01);
      assertEquals(128, dimension0.height);
      assertEquals(256, dimension0.width);
      
      VCFview vCFview0 = mock(VCFview.class, new ViolatedAssumptionAnswer());
      doReturn(dimension0).when(vCFview0).getPreferredSize();
      PrintVCFview printVCFview0 = new PrintVCFview(vCFview0);
      assertNotNull(printVCFview0);
      assertTrue(jList0.getFocusTraversalKeysEnabled());
      assertFalse(jList0.isFocusTraversalPolicySet());
      assertFalse(jList0.getIgnoreRepaint());
      assertFalse(jList0.isFocusCycleRoot());
      assertFalse(jList0.isFocusTraversalPolicyProvider());
      assertEquals(256.0, dimension0.getWidth(), 0.01);
      assertEquals(128.0, dimension0.getHeight(), 0.01);
      assertTrue(printVCFview0.getFocusTraversalKeysEnabled());
      assertFalse(printVCFview0.getScrollableTracksViewportWidth());
      assertFalse(printVCFview0.isFocusCycleRoot());
      assertFalse(printVCFview0.isFocusTraversalPolicySet());
      assertFalse(printVCFview0.isFocusTraversalPolicyProvider());
      assertFalse(printVCFview0.getIgnoreRepaint());
      assertFalse(printVCFview0.getScrollableTracksViewportHeight());
      assertEquals(128, dimension0.height);
      assertEquals(256, dimension0.width);
      
      PageFormat pageFormat0 = mock(PageFormat.class, new ViolatedAssumptionAnswer());
      doReturn(251.64044046889).when(pageFormat0).getImageableHeight();
      doReturn((double)256).when(pageFormat0).getImageableWidth();
      int int0 = printVCFview0.print((Graphics) null, pageFormat0, 1);
      assertEquals(1, int0);
      assertTrue(jList0.getFocusTraversalKeysEnabled());
      assertFalse(jList0.isFocusTraversalPolicySet());
      assertFalse(jList0.getIgnoreRepaint());
      assertFalse(jList0.isFocusCycleRoot());
      assertFalse(jList0.isFocusTraversalPolicyProvider());
      assertEquals(256.0, dimension0.getWidth(), 0.01);
      assertEquals(128.0, dimension0.getHeight(), 0.01);
      assertTrue(printVCFview0.getFocusTraversalKeysEnabled());
      assertFalse(printVCFview0.getScrollableTracksViewportWidth());
      assertFalse(printVCFview0.isFocusCycleRoot());
      assertFalse(printVCFview0.isFocusTraversalPolicySet());
      assertFalse(printVCFview0.isFocusTraversalPolicyProvider());
      assertFalse(printVCFview0.getIgnoreRepaint());
      assertFalse(printVCFview0.getScrollableTracksViewportHeight());
      assertEquals(128, dimension0.height);
      assertEquals(256, dimension0.width);
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      JList<Object> jList0 = new JList<Object>();
      assertNotNull(jList0);
      assertFalse(jList0.isFocusCycleRoot());
      assertFalse(jList0.isFocusTraversalPolicySet());
      assertFalse(jList0.isFocusTraversalPolicyProvider());
      assertFalse(jList0.getIgnoreRepaint());
      assertTrue(jList0.getFocusTraversalKeysEnabled());
      
      Dimension dimension0 = jList0.getPreferredScrollableViewportSize();
      assertNotNull(dimension0);
      assertFalse(jList0.isFocusCycleRoot());
      assertFalse(jList0.isFocusTraversalPolicySet());
      assertFalse(jList0.isFocusTraversalPolicyProvider());
      assertFalse(jList0.getIgnoreRepaint());
      assertTrue(jList0.getFocusTraversalKeysEnabled());
      assertEquals(256.0, dimension0.getWidth(), 0.01);
      assertEquals(128.0, dimension0.getHeight(), 0.01);
      assertEquals(128, dimension0.height);
      assertEquals(256, dimension0.width);
      
      VCFview vCFview0 = mock(VCFview.class, new ViolatedAssumptionAnswer());
      doReturn(dimension0).when(vCFview0).getPreferredSize();
      PrintVCFview printVCFview0 = new PrintVCFview(vCFview0);
      assertNotNull(printVCFview0);
      assertFalse(jList0.isFocusCycleRoot());
      assertFalse(jList0.isFocusTraversalPolicySet());
      assertFalse(jList0.isFocusTraversalPolicyProvider());
      assertFalse(jList0.getIgnoreRepaint());
      assertTrue(jList0.getFocusTraversalKeysEnabled());
      assertEquals(256.0, dimension0.getWidth(), 0.01);
      assertEquals(128.0, dimension0.getHeight(), 0.01);
      assertFalse(printVCFview0.isFocusTraversalPolicyProvider());
      assertFalse(printVCFview0.getScrollableTracksViewportHeight());
      assertTrue(printVCFview0.getFocusTraversalKeysEnabled());
      assertFalse(printVCFview0.isFocusTraversalPolicySet());
      assertFalse(printVCFview0.isFocusCycleRoot());
      assertFalse(printVCFview0.getIgnoreRepaint());
      assertFalse(printVCFview0.getScrollableTracksViewportWidth());
      assertEquals(128, dimension0.height);
      assertEquals(256, dimension0.width);
      
      PageFormat pageFormat0 = mock(PageFormat.class, new ViolatedAssumptionAnswer());
      doReturn((double)256).when(pageFormat0).getImageableHeight();
      doReturn(4.0).when(pageFormat0).getImageableWidth();
      int int0 = printVCFview0.print((Graphics) null, pageFormat0, 2);
      assertEquals(1, int0);
      assertFalse(jList0.isFocusCycleRoot());
      assertFalse(jList0.isFocusTraversalPolicySet());
      assertFalse(jList0.isFocusTraversalPolicyProvider());
      assertFalse(jList0.getIgnoreRepaint());
      assertTrue(jList0.getFocusTraversalKeysEnabled());
      assertEquals(256.0, dimension0.getWidth(), 0.01);
      assertEquals(128.0, dimension0.getHeight(), 0.01);
      assertFalse(printVCFview0.isFocusTraversalPolicyProvider());
      assertFalse(printVCFview0.getScrollableTracksViewportHeight());
      assertTrue(printVCFview0.getFocusTraversalKeysEnabled());
      assertFalse(printVCFview0.isFocusTraversalPolicySet());
      assertFalse(printVCFview0.isFocusCycleRoot());
      assertFalse(printVCFview0.getIgnoreRepaint());
      assertFalse(printVCFview0.getScrollableTracksViewportWidth());
      assertEquals(128, dimension0.height);
      assertEquals(256, dimension0.width);
  }

  @Test(timeout = 4000)
  public void test2()  throws Throwable  {
      SynthSeparatorUI synthSeparatorUI0 = new SynthSeparatorUI();
      assertNotNull(synthSeparatorUI0);
      
      JPanel jPanel0 = new JPanel(true);
      assertNotNull(jPanel0);
      assertFalse(jPanel0.getIgnoreRepaint());
      assertTrue(jPanel0.getFocusTraversalKeysEnabled());
      assertFalse(jPanel0.isFocusTraversalPolicySet());
      assertFalse(jPanel0.isFocusTraversalPolicyProvider());
      assertFalse(jPanel0.isFocusCycleRoot());
      
      Dimension dimension0 = synthSeparatorUI0.getMaximumSize(jPanel0);
      assertNotNull(dimension0);
      assertFalse(jPanel0.getIgnoreRepaint());
      assertTrue(jPanel0.getFocusTraversalKeysEnabled());
      assertFalse(jPanel0.isFocusTraversalPolicySet());
      assertFalse(jPanel0.isFocusTraversalPolicyProvider());
      assertFalse(jPanel0.isFocusCycleRoot());
      assertEquals(32767.0, dimension0.getWidth(), 0.01);
      assertEquals(32767.0, dimension0.getHeight(), 0.01);
      assertEquals(32767, dimension0.height);
      assertEquals(32767, dimension0.width);
      
      VCFview vCFview0 = mock(VCFview.class, new ViolatedAssumptionAnswer());
      doReturn(dimension0).when(vCFview0).getPreferredSize();
      PrintVCFview printVCFview0 = new PrintVCFview(vCFview0);
      assertNotNull(printVCFview0);
      assertFalse(jPanel0.getIgnoreRepaint());
      assertTrue(jPanel0.getFocusTraversalKeysEnabled());
      assertFalse(jPanel0.isFocusTraversalPolicySet());
      assertFalse(jPanel0.isFocusTraversalPolicyProvider());
      assertFalse(jPanel0.isFocusCycleRoot());
      assertEquals(32767.0, dimension0.getWidth(), 0.01);
      assertEquals(32767.0, dimension0.getHeight(), 0.01);
      assertFalse(printVCFview0.getIgnoreRepaint());
      assertFalse(printVCFview0.isFocusTraversalPolicyProvider());
      assertFalse(printVCFview0.isFocusCycleRoot());
      assertFalse(printVCFview0.getScrollableTracksViewportWidth());
      assertFalse(printVCFview0.isFocusTraversalPolicySet());
      assertTrue(printVCFview0.getFocusTraversalKeysEnabled());
      assertFalse(printVCFview0.getScrollableTracksViewportHeight());
      assertEquals(32767, dimension0.height);
      assertEquals(32767, dimension0.width);
      
      printVCFview0.setBounds(2201, 2201, 2201, 1790);
      assertFalse(jPanel0.getIgnoreRepaint());
      assertTrue(jPanel0.getFocusTraversalKeysEnabled());
      assertFalse(jPanel0.isFocusTraversalPolicySet());
      assertFalse(jPanel0.isFocusTraversalPolicyProvider());
      assertFalse(jPanel0.isFocusCycleRoot());
      assertEquals(32767.0, dimension0.getWidth(), 0.01);
      assertEquals(32767.0, dimension0.getHeight(), 0.01);
      assertFalse(printVCFview0.getIgnoreRepaint());
      assertFalse(printVCFview0.isFocusTraversalPolicyProvider());
      assertFalse(printVCFview0.isFocusCycleRoot());
      assertFalse(printVCFview0.getScrollableTracksViewportWidth());
      assertFalse(printVCFview0.isFocusTraversalPolicySet());
      assertTrue(printVCFview0.getFocusTraversalKeysEnabled());
      assertFalse(printVCFview0.getScrollableTracksViewportHeight());
      assertEquals(32767, dimension0.height);
      assertEquals(32767, dimension0.width);
      
      PageFormat pageFormat0 = mock(PageFormat.class, new ViolatedAssumptionAnswer());
      doReturn(0.0).when(pageFormat0).getImageableHeight();
      doReturn(1.0).when(pageFormat0).getImageableWidth();
      doReturn(0.0).when(pageFormat0).getImageableX();
      doReturn(0.0).when(pageFormat0).getImageableY();
      // Undeclared exception!
      try { 
        printVCFview0.print((Graphics) null, pageFormat0, 1509);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.variant.PrintVCFview", e);
      }
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      VCFview vCFview0 = mock(VCFview.class, new ViolatedAssumptionAnswer());
      doReturn((Dimension) null).when(vCFview0).getPreferredSize();
      PrintVCFview printVCFview0 = new PrintVCFview(vCFview0);
      assertNotNull(printVCFview0);
      assertFalse(printVCFview0.getScrollableTracksViewportWidth());
      assertFalse(printVCFview0.isFocusTraversalPolicyProvider());
      assertFalse(printVCFview0.isFocusCycleRoot());
      assertFalse(printVCFview0.isFocusTraversalPolicySet());
      assertFalse(printVCFview0.getIgnoreRepaint());
      assertTrue(printVCFview0.getFocusTraversalKeysEnabled());
      assertFalse(printVCFview0.getScrollableTracksViewportHeight());
      
      DebugGraphics debugGraphics0 = new DebugGraphics();
      assertNotNull(debugGraphics0);
      
      PageFormat pageFormat0 = mock(PageFormat.class, new ViolatedAssumptionAnswer());
      // Undeclared exception!
      try { 
        printVCFview0.print((Graphics) debugGraphics0, pageFormat0, 2);
        fail("Expecting exception: ClassCastException");
      
      } catch(ClassCastException e) {
         //
         // javax.swing.DebugGraphics cannot be cast to java.awt.Graphics2D
         //
         verifyException("uk.ac.sanger.artemis.components.variant.PrintVCFview", e);
      }
  }

  @Test(timeout = 4000)
  public void test4()  throws Throwable  {
      PrintVCFview printVCFview0 = new PrintVCFview((VCFview) null);
      assertNotNull(printVCFview0);
      assertFalse(printVCFview0.isFocusTraversalPolicySet());
      assertFalse(printVCFview0.isFocusCycleRoot());
      assertTrue(printVCFview0.getFocusTraversalKeysEnabled());
      assertFalse(printVCFview0.getIgnoreRepaint());
      assertFalse(printVCFview0.getScrollableTracksViewportHeight());
      assertFalse(printVCFview0.isFocusTraversalPolicyProvider());
      assertFalse(printVCFview0.getScrollableTracksViewportWidth());
      
      // Undeclared exception!
      try { 
        printVCFview0.print();
        fail("Expected HeadlessException");
      } catch(HeadlessException e) {
    	  	
      }
  }

  @Test(timeout = 4000)
  public void test5()  throws Throwable  {
      VCFview vCFview0 = mock(VCFview.class, new ViolatedAssumptionAnswer());
      doReturn((Dimension) null).when(vCFview0).getPreferredSize();
      PrintVCFview printVCFview0 = new PrintVCFview(vCFview0);
      assertNotNull(printVCFview0);
      assertFalse(printVCFview0.isFocusTraversalPolicyProvider());
      assertFalse(printVCFview0.getIgnoreRepaint());
      assertFalse(printVCFview0.getScrollableTracksViewportHeight());
      assertTrue(printVCFview0.getFocusTraversalKeysEnabled());
      assertFalse(printVCFview0.isFocusCycleRoot());
      assertFalse(printVCFview0.isFocusTraversalPolicySet());
      assertFalse(printVCFview0.getScrollableTracksViewportWidth());
      
      printVCFview0.setBounds((-2186), (-2186), (-2186), 1790);
      assertFalse(printVCFview0.isFocusTraversalPolicyProvider());
      assertFalse(printVCFview0.getIgnoreRepaint());
      assertFalse(printVCFview0.getScrollableTracksViewportHeight());
      assertTrue(printVCFview0.getFocusTraversalKeysEnabled());
      assertFalse(printVCFview0.isFocusCycleRoot());
      assertFalse(printVCFview0.isFocusTraversalPolicySet());
      assertFalse(printVCFview0.getScrollableTracksViewportWidth());
      
      PageFormat pageFormat0 = mock(PageFormat.class, new ViolatedAssumptionAnswer());
      doReturn(0.0).when(pageFormat0).getImageableHeight();
      doReturn(0.0).when(pageFormat0).getImageableWidth();
      int int0 = printVCFview0.print((Graphics) null, pageFormat0, 1509);
      assertEquals(1, int0);
      assertFalse(printVCFview0.isFocusTraversalPolicyProvider());
      assertFalse(printVCFview0.getIgnoreRepaint());
      assertFalse(printVCFview0.getScrollableTracksViewportHeight());
      assertTrue(printVCFview0.getFocusTraversalKeysEnabled());
      assertFalse(printVCFview0.isFocusCycleRoot());
      assertFalse(printVCFview0.isFocusTraversalPolicySet());
      assertFalse(printVCFview0.getScrollableTracksViewportWidth());
  }

  @Test(timeout = 4000)
  public void test6()  throws Throwable  {
      VCFview vCFview0 = mock(VCFview.class, new ViolatedAssumptionAnswer());
      PrintVCFview printVCFview0 = new PrintVCFview(vCFview0);
      assertNotNull(printVCFview0);
      assertTrue(printVCFview0.getFocusTraversalKeysEnabled());
      assertFalse(printVCFview0.getScrollableTracksViewportHeight());
      assertFalse(printVCFview0.isFocusTraversalPolicyProvider());
      assertFalse(printVCFview0.isFocusCycleRoot());
      assertFalse(printVCFview0.getIgnoreRepaint());
      assertFalse(printVCFview0.isFocusTraversalPolicySet());
      assertFalse(printVCFview0.getScrollableTracksViewportWidth());
      
      // Undeclared exception!
      try { 
        printVCFview0.paintComponent((Graphics) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("javax.swing.JComponent", e);
      }
  }

  @Test(timeout = 4000)
  public void test7()  throws Throwable  {
      PrintVCFview printVCFview0 = new PrintVCFview((VCFview) null);
      assertNotNull(printVCFview0);
      assertFalse(printVCFview0.isFocusTraversalPolicyProvider());
      assertFalse(printVCFview0.getScrollableTracksViewportWidth());
      assertFalse(printVCFview0.isFocusCycleRoot());
      assertFalse(printVCFview0.getIgnoreRepaint());
      assertFalse(printVCFview0.isFocusTraversalPolicySet());
      assertTrue(printVCFview0.getFocusTraversalKeysEnabled());
      assertFalse(printVCFview0.getScrollableTracksViewportHeight());
      
      // Undeclared exception!
      try { 
        printVCFview0.printPreview();
        fail("Expecting exception: HeadlessException");
      
      } catch(HeadlessException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("java.awt.GraphicsEnvironment", e);
      }
  }

  @Test(timeout = 4000)
  public void test8()  throws Throwable  {
    Future<?> future = executor.submit(new Runnable(){ 
            @Override public void run() { 
          VCFview vCFview0 = mock(VCFview.class, new ViolatedAssumptionAnswer());
          PrintVCFview printVCFview0 = new PrintVCFview(vCFview0);
          // Undeclared exception!
          try { 
            printVCFview0.doPrintActions();
            fail("Expecting exception: SecurityException");
          
          } catch(SecurityException e) {
             //
             // Security manager blocks (\"java.lang.RuntimePermission\" \"queuePrintJob\")
             // java.lang.Thread.getStackTrace(Thread.java:1559)
             // org.evosuite.runtime.sandbox.MSecurityManager.checkPermission(MSecurityManager.java:434)
             // java.lang.SecurityManager.checkPrintJobAccess(SecurityManager.java:1378)
             // java.awt.print.PrinterJob.getPrinterJob(PrinterJob.java:75)
             // uk.ac.sanger.artemis.components.variant.PrintVCFview.doPrintActions(PrintVCFview.java:210)
             // sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             // sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
             // sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
             // java.lang.reflect.Method.invoke(Method.java:498)
             // org.evosuite.testcase.statements.MethodStatement$1.execute(MethodStatement.java:257)
             // org.evosuite.testcase.statements.AbstractStatement.exceptionHandler(AbstractStatement.java:169)
             // org.evosuite.testcase.statements.MethodStatement.execute(MethodStatement.java:220)
             // org.evosuite.testcase.execution.TestRunnable.executeStatements(TestRunnable.java:307)
             // org.evosuite.testcase.execution.TestRunnable.call(TestRunnable.java:213)
             // org.evosuite.testcase.execution.TestRunnable.call(TestRunnable.java:55)
             // java.util.concurrent.FutureTask.run(FutureTask.java:266)
             // java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
             // java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
             // java.lang.Thread.run(Thread.java:748)
             //
             verifyException("org.evosuite.runtime.sandbox.MSecurityManager", e);
          }
      } 
    });
    future.get(4000, TimeUnit.MILLISECONDS);
  }
}
