/*
 * This file was automatically generated by EvoSuite
 * Wed Sep 19 22:25:47 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.datatransfer.Clipboard;
import javax.swing.JFrame;
import javax.swing.JMenuItem;
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.Selection;
import uk.ac.sanger.artemis.components.SelectionMenu;
import uk.ac.sanger.artemis.components.SelectionSubMenu;

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

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      SelectionMenu selectionMenu0 = mock(SelectionMenu.class, new ViolatedAssumptionAnswer());
      doReturn("79flsup*~").when(selectionMenu0).getText();
      SelectionSubMenu selectionSubMenu0 = new SelectionSubMenu(selectionMenu0, " ~x}f1U15FZ(kMM");
      selectionSubMenu0.setIgnoreRepaint(true);
      selectionSubMenu0.add((JMenuItem) selectionSubMenu0);
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      SelectionMenu selectionMenu0 = mock(SelectionMenu.class, new ViolatedAssumptionAnswer());
      doReturn("79flsup*~").when(selectionMenu0).getText();
      SelectionSubMenu selectionSubMenu0 = new SelectionSubMenu(selectionMenu0, " ~x}f1U15FZ(kMM");
      // Undeclared exception!
      try { 
        selectionSubMenu0.add((JMenuItem) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("java.awt.Container", e);
      }
  }

  @Test(timeout = 4000)
  public void test2()  throws Throwable  {
      SelectionSubMenu selectionSubMenu0 = null;
      try {
        selectionSubMenu0 = new SelectionSubMenu((SelectionMenu) null, (String) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.SelectionSubMenu", e);
      }
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      Selection selection0 = new Selection((Clipboard) null);
      SelectionMenu selectionMenu0 = new SelectionMenu((JFrame) null, "org.biojava.bio.symbol.AbstractAlphabet", selection0);
      SelectionSubMenu selectionSubMenu0 = new SelectionSubMenu(selectionMenu0, "org.biojava.bio.symbol.AbstractAlphabet");
      selectionSubMenu0.add((JMenuItem) selectionMenu0);
  }
}
