/*
 * This file was automatically generated by EvoSuite
 * Fri Jun 08 19:43:48 GMT 2018
 */

package uk.ac.sanger.artemis.editor;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.awt.CardLayout;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.LayoutManager;
import java.awt.Rectangle;
import java.awt.image.ImageObserver;
import java.beans.PropertyChangeListener;
import java.io.CharArrayWriter;
import java.io.PrintWriter;
import java.text.DecimalFormat;
import java.text.FieldPosition;
import javax.swing.JFrame;
import javax.swing.JLayer;
import javax.swing.JOptionPane;
import javax.swing.JTabbedPane;
import javax.swing.JTextPane;
import javax.swing.plaf.basic.BasicScrollBarUI;
import javax.swing.plaf.metal.MetalComboBoxUI;
import javax.swing.plaf.synth.SynthScrollBarUI;
import javax.swing.table.JTableHeader;
import javax.swing.text.DefaultCaret;
import javax.swing.text.NavigationFilter;
import org.emboss.jemboss.JembossParams;
import org.emboss.jemboss.gui.Browser;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.mock.java.io.MockPrintWriter;
import org.evosuite.runtime.testdata.EvoSuiteFile;
import org.evosuite.runtime.testdata.EvoSuiteURL;
import org.evosuite.runtime.testdata.FileSystemHandling;
import org.evosuite.runtime.testdata.NetworkHandling;
import org.junit.runner.RunWith;
import uk.ac.sanger.artemis.editor.ScrollPanel;

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

  @Test(timeout = 4000)
  public void test00()  throws Throwable  {
      EvoSuiteFile evoSuiteFile0 = null;
      FileSystemHandling.appendDataToFile((EvoSuiteFile) null, (byte[]) null);
      GridLayout gridLayout0 = new GridLayout();
      FileSystemHandling fileSystemHandling0 = new FileSystemHandling();
      int int0 = (-540);
      gridLayout0.setVgap((-540));
      ScrollPanel scrollPanel0 = new ScrollPanel(gridLayout0);
      gridLayout0.addLayoutComponent("EausR*T,=", scrollPanel0);
      gridLayout0.setRows((-540));
      scrollPanel0.getScrollableTracksViewportHeight();
      scrollPanel0.getScrollableTracksViewportWidth();
      scrollPanel0.removeNotify();
      gridLayout0.removeLayoutComponent(scrollPanel0);
      NetworkHandling.createRemoteTextFile((EvoSuiteURL) null, "N(2)J(JtQy");
      JLayer<JTextPane> jLayer0 = new JLayer<JTextPane>();
      scrollPanel0.removePropertyChangeListener((PropertyChangeListener) jLayer0);
      scrollPanel0.addNotify();
      // Undeclared exception!
      try { 
        scrollPanel0.getPreferredScrollableViewportSize();
        fail("Expecting exception: ArithmeticException");
      
      } catch(ArithmeticException e) {
         //
         // / by zero
         //
         verifyException("java.awt.GridLayout", e);
      }
  }

  @Test(timeout = 4000)
  public void test01()  throws Throwable  {
      MetalComboBoxUI metalComboBoxUI0 = new MetalComboBoxUI();
      MetalComboBoxUI.MetalComboBoxLayoutManager metalComboBoxUI_MetalComboBoxLayoutManager0 = metalComboBoxUI0.new MetalComboBoxLayoutManager();
      ScrollPanel scrollPanel0 = new ScrollPanel(metalComboBoxUI_MetalComboBoxLayoutManager0);
      // Undeclared exception!
      try { 
        scrollPanel0.getPreferredScrollableViewportSize();
        fail("Expecting exception: StackOverflowError");
      
      } catch(StackOverflowError e) {
         //
         // no message in exception (getMessage() returned null)
         //
      }
  }

  @Test(timeout = 4000)
  public void test02()  throws Throwable  {
      FileSystemHandling fileSystemHandling0 = new FileSystemHandling();
      FlowLayout flowLayout0 = new FlowLayout(1494, (-1327), 1494);
      JOptionPane jOptionPane0 = new JOptionPane("uk.ac.sanger.artemis.editor.ScrollPanel");
      flowLayout0.layoutContainer(jOptionPane0);
      ScrollPanel scrollPanel0 = new ScrollPanel(flowLayout0);
      DefaultCaret defaultCaret0 = new DefaultCaret();
      scrollPanel0.addMouseMotionListener(defaultCaret0);
      scrollPanel0.getPreferredScrollableViewportSize();
      scrollPanel0.getPreferredScrollableViewportSize();
      scrollPanel0.getPreferredScrollableViewportSize();
      scrollPanel0.getPreferredScrollableViewportSize();
      int int0 = scrollPanel0.getScrollableUnitIncrement(defaultCaret0, 1501, (-856));
      assertEquals(10, int0);
  }

  @Test(timeout = 4000)
  public void test03()  throws Throwable  {
      BasicScrollBarUI basicScrollBarUI0 = new BasicScrollBarUI();
      ScrollPanel scrollPanel0 = new ScrollPanel(basicScrollBarUI0);
      Rectangle rectangle0 = new Rectangle();
      rectangle0.contains((-1902.5417562859), (-1902.5417562859));
      basicScrollBarUI0.contains(scrollPanel0, 0, 3253);
      scrollPanel0.getScrollableBlockIncrement(rectangle0, 0, 0);
      // Undeclared exception!
      try { 
        scrollPanel0.getPreferredScrollableViewportSize();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("javax.swing.plaf.basic.BasicScrollBarUI", e);
      }
  }

  @Test(timeout = 4000)
  public void test04()  throws Throwable  {
      int int0 = (-2675);
      CardLayout cardLayout0 = new CardLayout(8938, (-2675));
      ScrollPanel scrollPanel0 = new ScrollPanel(cardLayout0);
      scrollPanel0.getPreferredScrollableViewportSize();
      scrollPanel0.getComponentListeners();
      JTabbedPane jTabbedPane0 = null;
      try {
        jTabbedPane0 = new JTabbedPane((-5350));
        fail("Expecting exception: IllegalArgumentException");
      
      } catch(IllegalArgumentException e) {
         //
         // illegal tab placement: must be TOP, BOTTOM, LEFT, or RIGHT
         //
         verifyException("javax.swing.JTabbedPane", e);
      }
  }

  @Test(timeout = 4000)
  public void test05()  throws Throwable  {
      GridLayout gridLayout0 = new GridLayout(8887, (-1966));
      ScrollPanel scrollPanel0 = new ScrollPanel(gridLayout0);
      scrollPanel0.setLocation(8887, 629);
      boolean boolean0 = scrollPanel0.getScrollableTracksViewportWidth();
      assertFalse(boolean0);
      
      scrollPanel0.getPreferredScrollableViewportSize();
      assertFalse(scrollPanel0.getScrollableTracksViewportWidth());
  }

  @Test(timeout = 4000)
  public void test06()  throws Throwable  {
      ScrollPanel scrollPanel0 = new ScrollPanel();
      assertFalse(scrollPanel0.isFocusTraversalPolicyProvider());
      
      boolean boolean0 = scrollPanel0.getScrollableTracksViewportHeight();
      assertFalse(boolean0);
      
      scrollPanel0.getScrollableTracksViewportHeight();
      scrollPanel0.getPreferredScrollableViewportSize();
      boolean boolean1 = scrollPanel0.getScrollableTracksViewportWidth();
      assertTrue(boolean1 == boolean0);
      assertFalse(boolean1);
  }

  @Test(timeout = 4000)
  public void test07()  throws Throwable  {
      ScrollPanel scrollPanel0 = new ScrollPanel();
      JTableHeader jTableHeader0 = new JTableHeader();
      Rectangle rectangle0 = jTableHeader0.getHeaderRect(2264);
      int int0 = scrollPanel0.getScrollableUnitIncrement(rectangle0, 1, 0);
      assertEquals(10, int0);
  }

  @Test(timeout = 4000)
  public void test08()  throws Throwable  {
      SynthScrollBarUI synthScrollBarUI0 = new SynthScrollBarUI();
      ScrollPanel scrollPanel0 = new ScrollPanel(synthScrollBarUI0);
      Rectangle rectangle0 = new Rectangle();
      int int0 = scrollPanel0.getScrollableBlockIncrement(rectangle0, 0, 1);
      assertEquals(60, int0);
  }

  @Test(timeout = 4000)
  public void test09()  throws Throwable  {
      ScrollPanel scrollPanel0 = new ScrollPanel();
      boolean boolean0 = scrollPanel0.getScrollableTracksViewportWidth();
      assertFalse(boolean0);
  }

  @Test(timeout = 4000)
  public void test10()  throws Throwable  {
      ScrollPanel scrollPanel0 = new ScrollPanel();
      Dimension dimension0 = scrollPanel0.getPreferredScrollableViewportSize();
      assertEquals(10, dimension0.height);
      
      int int0 = scrollPanel0.getScrollableUnitIncrement((Rectangle) null, 10, 10);
      assertEquals(10, int0);
      
      boolean boolean0 = scrollPanel0.getScrollableTracksViewportWidth();
      boolean boolean1 = scrollPanel0.getScrollableTracksViewportHeight();
      assertTrue(boolean1 == boolean0);
      assertFalse(boolean1);
  }

  @Test(timeout = 4000)
  public void test11()  throws Throwable  {
      ScrollPanel scrollPanel0 = new ScrollPanel((LayoutManager) null);
      assertFalse(scrollPanel0.isFocusTraversalPolicyProvider());
  }

  @Test(timeout = 4000)
  public void test12()  throws Throwable  {
      ScrollPanel scrollPanel0 = new ScrollPanel();
      DefaultCaret defaultCaret0 = new DefaultCaret();
      int int0 = scrollPanel0.getScrollableBlockIncrement(defaultCaret0, 0, 0);
      assertEquals(60, int0);
  }
}
