/*
 * This file was automatically generated by EvoSuite
 * Fri Jun 08 18:03:36 GMT 2018
 */

package uk.ac.sanger.artemis.components;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.awt.HeadlessException;
import java.awt.datatransfer.Clipboard;
import java.util.Vector;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JMenuItem;
import javax.swing.JRadioButtonMenuItem;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;
import uk.ac.sanger.artemis.Selection;
import uk.ac.sanger.artemis.components.SelectionMenu;
import uk.ac.sanger.artemis.util.StringVector;

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

  @Test(timeout = 4000)
  public void test00()  throws Throwable  {
      String string0 = SelectionMenu.getKeyText(65);
      assertEquals("A", string0);
  }

  @Test(timeout = 4000)
  public void test01()  throws Throwable  {
      String string0 = SelectionMenu.getKeyText(57);
      assertEquals("9", string0);
  }

  @Test(timeout = 4000)
  public void test02()  throws Throwable  {
      Clipboard clipboard0 = new Clipboard("Qn[&Q:K'5eD)j LE~");
      Selection selection0 = new Selection(clipboard0);
      SelectionMenu selectionMenu0 = new SelectionMenu((JFrame) null, "Qn[&Q:K'5eD)j LE~", selection0);
      boolean boolean0 = selectionMenu0.isEditableShortCutMenu();
      assertFalse(boolean0);
  }

  @Test(timeout = 4000)
  public void test03()  throws Throwable  {
      Clipboard clipboard0 = new Clipboard("");
      Selection selection0 = new Selection(clipboard0);
      SelectionMenu selectionMenu0 = new SelectionMenu((JFrame) null, "G2 /$Us", selection0);
      Selection selection1 = selectionMenu0.getSelection();
      assertSame(selection1, selection0);
  }

  @Test(timeout = 4000)
  public void test04()  throws Throwable  {
      Clipboard clipboard0 = new Clipboard("");
      Selection selection0 = new Selection(clipboard0);
      SelectionMenu selectionMenu0 = new SelectionMenu((JFrame) null, "G2 /$Us", selection0);
      // Undeclared exception!
      try { 
        selectionMenu0.getShortCuts((Vector<String>) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.SelectionMenu", e);
      }
  }

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

  @Test(timeout = 4000)
  public void test06()  throws Throwable  {
      // Undeclared exception!
      try { 
        SelectionMenu.checkForSelectionFeatures((JFrame) null, (Selection) null, 0, "1..");
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.SelectionMenu", e);
      }
  }

  @Test(timeout = 4000)
  public void test07()  throws Throwable  {
      Selection selection0 = new Selection((Clipboard) null);
      // Undeclared exception!
      try { 
        SelectionMenu.checkForSelectionFeatures((JFrame) null, selection0, 0, "unknown(0x16)");
        fail("Expecting exception: HeadlessException");
      
      } catch(HeadlessException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("java.awt.GraphicsEnvironment", e);
      }
  }

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

  @Test(timeout = 4000)
  public void test09()  throws Throwable  {
      Clipboard clipboard0 = new Clipboard("uk.ac.sanger.artemis.components.EntryGroupPanel");
      Selection selection0 = new Selection(clipboard0);
      // Undeclared exception!
      try { 
        SelectionMenu.checkForSelectionFeatures((JFrame) null, selection0);
        fail("Expecting exception: HeadlessException");
      
      } catch(HeadlessException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("java.awt.GraphicsEnvironment", e);
      }
  }

  @Test(timeout = 4000)
  public void test10()  throws Throwable  {
      SelectionMenu selectionMenu0 = new SelectionMenu((JFrame) null, "ahbSy*w?x", (Selection) null);
      // Undeclared exception!
      try { 
        selectionMenu0.checkForSelectionFeatures((-1827), "v");
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.SelectionMenu", e);
      }
  }

  @Test(timeout = 4000)
  public void test11()  throws Throwable  {
      SelectionMenu selectionMenu0 = new SelectionMenu((JFrame) null, "Qn[&Q:K'5eD)j LE~", (Selection) null);
      // Undeclared exception!
      try { 
        selectionMenu0.checkForSelectionFeatures();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.SelectionMenu", e);
      }
  }

  @Test(timeout = 4000)
  public void test12()  throws Throwable  {
      SelectionMenu selectionMenu0 = new SelectionMenu((JFrame) null, (String) null, (Selection) null);
      // Undeclared exception!
      try { 
        selectionMenu0.checkForSelectionFeatureSegments(56, "8");
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.SelectionMenu", e);
      }
  }

  @Test(timeout = 4000)
  public void test13()  throws Throwable  {
      // Undeclared exception!
      try { 
        SelectionMenu.checkForSelectionCDSFeatures((JFrame) null, (Selection) null, 1224, (String) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.SelectionMenu", e);
      }
  }

  @Test(timeout = 4000)
  public void test14()  throws Throwable  {
      Clipboard clipboard0 = new Clipboard("Qn[&Q:K'5eD)j LE~");
      Selection selection0 = new Selection(clipboard0);
      SelectionMenu selectionMenu0 = new SelectionMenu((JFrame) null, "Qn[&Q:K'5eD)j LE~", selection0);
      // Undeclared exception!
      try { 
        selectionMenu0.add((JMenuItem) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
      }
  }

  @Test(timeout = 4000)
  public void test15()  throws Throwable  {
      Clipboard clipboard0 = new Clipboard("DELETE");
      Selection selection0 = new Selection(clipboard0);
      // Undeclared exception!
      try { 
        SelectionMenu.checkForSelectionRange((JFrame) null, selection0);
        fail("Expecting exception: HeadlessException");
      
      } catch(HeadlessException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("java.awt.GraphicsEnvironment", e);
      }
  }

  @Test(timeout = 4000)
  public void test16()  throws Throwable  {
      Clipboard clipboard0 = new Clipboard("Qn[&Q:K'5eD)j LE~");
      Selection selection0 = new Selection(clipboard0);
      SelectionMenu selectionMenu0 = new SelectionMenu((JFrame) null, "Qn[&Q:K'5eD)j LE~", selection0);
      JFrame jFrame0 = selectionMenu0.getParentFrame();
      assertNull(jFrame0);
  }

  @Test(timeout = 4000)
  public void test17()  throws Throwable  {
      String string0 = SelectionMenu.getKeyText(227);
      assertEquals("KP_RIGHT", string0);
  }

  @Test(timeout = 4000)
  public void test18()  throws Throwable  {
      String string0 = SelectionMenu.getKeyText(226);
      assertEquals("KP_LEFT", string0);
  }

  @Test(timeout = 4000)
  public void test19()  throws Throwable  {
      String string0 = SelectionMenu.getKeyText(225);
      assertEquals("KP_DOWN", string0);
  }

  @Test(timeout = 4000)
  public void test20()  throws Throwable  {
      String string0 = SelectionMenu.getKeyText(224);
      assertEquals("KP_UP", string0);
  }

  @Test(timeout = 4000)
  public void test21()  throws Throwable  {
      String string0 = SelectionMenu.getKeyText(127);
      assertEquals("DELETE", string0);
  }

  @Test(timeout = 4000)
  public void test22()  throws Throwable  {
      String string0 = SelectionMenu.getKeyText(40);
      assertEquals("DOWN", string0);
  }

  @Test(timeout = 4000)
  public void test23()  throws Throwable  {
      String string0 = SelectionMenu.getKeyText(39);
      assertEquals("RIGHT", string0);
  }

  @Test(timeout = 4000)
  public void test24()  throws Throwable  {
      String string0 = SelectionMenu.getKeyText(38);
      assertEquals("UP", string0);
  }

  @Test(timeout = 4000)
  public void test25()  throws Throwable  {
      String string0 = SelectionMenu.getKeyText(2650);
      assertEquals("unknown(0xa5a)", string0);
  }

  @Test(timeout = 4000)
  public void test26()  throws Throwable  {
      String string0 = SelectionMenu.getKeyText(56);
      assertEquals("8", string0);
  }

  @Test(timeout = 4000)
  public void test27()  throws Throwable  {
      String string0 = SelectionMenu.getKeyText(8);
      assertEquals("BACK_SPACE", string0);
  }

  @Test(timeout = 4000)
  public void test28()  throws Throwable  {
      Clipboard clipboard0 = new Clipboard("");
      Selection selection0 = new Selection(clipboard0);
      SelectionMenu selectionMenu0 = new SelectionMenu((JFrame) null, "", selection0);
      Vector<String> vector0 = selectionMenu0.getUsedShortCutKeys();
      assertFalse(vector0.contains(""));
  }

  @Test(timeout = 4000)
  public void test29()  throws Throwable  {
      Clipboard clipboard0 = new Clipboard("");
      Selection selection0 = new Selection(clipboard0);
      SelectionMenu selectionMenu0 = new SelectionMenu((JFrame) null, "", selection0);
      // Undeclared exception!
      try { 
        selectionMenu0.checkForSelectionRange();
        fail("Expecting exception: HeadlessException");
      
      } catch(HeadlessException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("java.awt.GraphicsEnvironment", e);
      }
  }

  @Test(timeout = 4000)
  public void test30()  throws Throwable  {
      Selection selection0 = new Selection((Clipboard) null);
      SelectionMenu selectionMenu0 = new SelectionMenu((JFrame) null, "unknown(0x2e)", selection0);
      // Undeclared exception!
      try { 
        selectionMenu0.checkForSelectionFeatureSegments(46, "unknown(0x2e)");
        fail("Expecting exception: HeadlessException");
      
      } catch(HeadlessException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("java.awt.GraphicsEnvironment", e);
      }
  }

  @Test(timeout = 4000)
  public void test31()  throws Throwable  {
      Selection selection0 = new Selection((Clipboard) null);
      // Undeclared exception!
      try { 
        SelectionMenu.checkForSelectionCDSFeatures((JFrame) null, selection0, 0, "Q0 QYDXo");
        fail("Expecting exception: HeadlessException");
      
      } catch(HeadlessException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("java.awt.GraphicsEnvironment", e);
      }
  }

  @Test(timeout = 4000)
  public void test32()  throws Throwable  {
      Clipboard clipboard0 = new Clipboard("Qn[&Q:K'5eD)j LE~");
      Selection selection0 = new Selection(clipboard0);
      SelectionMenu selectionMenu0 = new SelectionMenu((JFrame) null, "Qn[&Q:K'5eD)j LE~", selection0);
      // Undeclared exception!
      try { 
        selectionMenu0.checkForSelectionFeatures(0, "Qn[&Q:K'5eD)j LE~");
        fail("Expecting exception: HeadlessException");
      
      } catch(HeadlessException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("java.awt.GraphicsEnvironment", e);
      }
  }

  @Test(timeout = 4000)
  public void test33()  throws Throwable  {
      SelectionMenu selectionMenu0 = new SelectionMenu((JFrame) null, "lwS~4O_Nh;ti~Y%R{L", (Selection) null);
      // Undeclared exception!
      try { 
        selectionMenu0.checkForSelectionRange();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.SelectionMenu", e);
      }
  }

  @Test(timeout = 4000)
  public void test34()  throws Throwable  {
      Clipboard clipboard0 = new Clipboard("Qn[&Q:K'5eD)j LE~");
      Selection selection0 = new Selection(clipboard0);
      SelectionMenu selectionMenu0 = new SelectionMenu((JFrame) null, "Qn[&Q:K'5eD)j LE~", selection0);
      // Undeclared exception!
      try { 
        selectionMenu0.checkForSelectionFeatures();
        fail("Expecting exception: HeadlessException");
      
      } catch(HeadlessException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("java.awt.GraphicsEnvironment", e);
      }
  }

  @Test(timeout = 4000)
  public void test35()  throws Throwable  {
      // Undeclared exception!
      try { 
        SelectionMenu.makeMenuKeyStroke(2634);
        
      } catch(Exception e) {
    	  	fail("Caught exception: " + e.getMessage());
      }
  }

  @Test(timeout = 4000)
  public void test36()  throws Throwable  {
      Clipboard clipboard0 = new Clipboard("Qn[&Q:K'5eD)j LE~");
      Selection selection0 = new Selection(clipboard0);
      SelectionMenu selectionMenu0 = new SelectionMenu((JFrame) null, "Qn[&Q:K'5eD)j LE~", selection0);
      ImageIcon imageIcon0 = new ImageIcon("nk)+H0xNpf2", "|#uhw");
      JRadioButtonMenuItem jRadioButtonMenuItem0 = new JRadioButtonMenuItem(imageIcon0, false);
      selectionMenu0.add((JMenuItem) jRadioButtonMenuItem0);
      StringVector stringVector0 = StringVector.getStrings("", "x,[LOLO\"U9", false);
      // Undeclared exception!
      try { 
        selectionMenu0.getShortCuts(stringVector0);
      
      } catch(Exception e) {
    	  	fail("Caught exception: " + e.getMessage());
      }
  }
}
