/*
 * This file was automatically generated by EvoSuite
 * Thu Sep 20 12:39:07 GMT 2018
 */

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

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.Component;
import javax.swing.ComboBoxEditor;
import javax.swing.JComboBox;
import javax.swing.JEditorPane;
import javax.swing.JTextArea;
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.genebuilder.AutoCompleteComboDocument;

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

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      ComboBoxEditor comboBoxEditor0 = mock(ComboBoxEditor.class, new ViolatedAssumptionAnswer());
      doReturn((Component) null).when(comboBoxEditor0).getEditorComponent();
      JComboBox<JEditorPane> jComboBox0 = (JComboBox<JEditorPane>) mock(JComboBox.class, new ViolatedAssumptionAnswer());
      doReturn(comboBoxEditor0).when(jComboBox0).getEditor();
      AutoCompleteComboDocument autoCompleteComboDocument0 = null;
      try {
        autoCompleteComboDocument0 = new AutoCompleteComboDocument(jComboBox0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.genebuilder.AutoCompleteComboDocument", e);
      }
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      Component component0 = mock(Component.class, new ViolatedAssumptionAnswer());
      ComboBoxEditor comboBoxEditor0 = mock(ComboBoxEditor.class, new ViolatedAssumptionAnswer());
      doReturn(component0).when(comboBoxEditor0).getEditorComponent();
      JComboBox<JTextArea> jComboBox0 = (JComboBox<JTextArea>) mock(JComboBox.class, new ViolatedAssumptionAnswer());
      doReturn(comboBoxEditor0).when(jComboBox0).getEditor();
      AutoCompleteComboDocument autoCompleteComboDocument0 = null;
      try {
        autoCompleteComboDocument0 = new AutoCompleteComboDocument(jComboBox0);
        fail("Expecting exception: ClassCastException");
      
      } catch(ClassCastException e) {
         //
         // codegen.java.awt.Component$MockitoMock$1166552897 cannot be cast to javax.swing.text.JTextComponent
         //
         verifyException("uk.ac.sanger.artemis.components.genebuilder.AutoCompleteComboDocument", e);
      }
  }
}
