/*
 * This file was automatically generated by EvoSuite
 * Wed Sep 19 22:03:27 GMT 2018
 */

package uk.ac.sanger.artemis.components;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JRadioButtonMenuItem;
import javax.swing.KeyStroke;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.testdata.EvoSuiteFile;
import org.evosuite.runtime.testdata.FileSystemHandling;
import org.junit.runner.RunWith;
import uk.ac.sanger.artemis.components.ShortCut;

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

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      KeyStroke keyStroke0 = KeyStroke.getKeyStroke('P');
      ShortCut shortCut0 = new ShortCut("m3c8@W'D.TR-Q9", "", keyStroke0);
      JRadioButtonMenuItem jRadioButtonMenuItem0 = new JRadioButtonMenuItem();
      ShortCut.applyShortCutFromCache("m3c8@W'D.TR-Q9", jRadioButtonMenuItem0);
      assertFalse(jRadioButtonMenuItem0.isFocusTraversalPolicySet());
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      ShortCut shortCut0 = new ShortCut("d~", "d~", (KeyStroke) null);
      // Undeclared exception!
      try { 
        ShortCut.applyShortCutFromCache("Object must not be null", (JMenuItem) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.ShortCut", e);
      }
  }

  @Test(timeout = 4000)
  public void test2()  throws Throwable  {
      EvoSuiteFile evoSuiteFile0 = new EvoSuiteFile("/Users/kp11/.artemis/cache/MenuShortCuts/m3c8@W'D.TD:Q9#");
      FileSystemHandling.appendLineToFile(evoSuiteFile0, "m3c8@W'D.TR-Q9");
      JRadioButtonMenuItem jRadioButtonMenuItem0 = new JRadioButtonMenuItem();
      ShortCut.applyShortCutFromCache("m3c8@W'D.TR-Q9", jRadioButtonMenuItem0);
      assertFalse(jRadioButtonMenuItem0.getIgnoreRepaint());
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      JMenu jMenu0 = new JMenu("");
      ShortCut.applyShortCutFromCache("9RI", jMenu0);
      assertTrue(jMenu0.getFocusTraversalKeysEnabled());
  }

  @Test(timeout = 4000)
  public void test4()  throws Throwable  {
      EvoSuiteFile evoSuiteFile0 = new EvoSuiteFile("/Users/kp11/.artemis/cache/MenuShortCuts/m3c8@W'D.TD:Q9#");
      FileSystemHandling.appendLineToFile(evoSuiteFile0, "m3c8@W'D.TD:Q9");
      KeyStroke keyStroke0 = KeyStroke.getKeyStroke('P');
      ShortCut shortCut0 = new ShortCut("m3c8@W'D.TD:Q9", "", keyStroke0);
  }

  @Test(timeout = 4000)
  public void test5()  throws Throwable  {
      boolean boolean0 = ShortCut.usingCache();
      assertTrue(boolean0);
  }
}
