/*
 * This file was automatically generated by EvoSuite
 * Wed Sep 19 21:48:14 GMT 2018
 */

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

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import javax.swing.JPasswordField;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.util.SystemInUtil;
import org.junit.runner.RunWith;
import uk.ac.sanger.artemis.components.database.DatabaseLoginPromptConsole;
import uk.ac.sanger.artemis.io.UI;

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

  @Test(timeout = 4000)
  public void test00()  throws Throwable  {
      DatabaseLoginPromptConsole databaseLoginPromptConsole0 = new DatabaseLoginPromptConsole();
      SystemInUtil.addInputLine("");
      databaseLoginPromptConsole0.prompt();
      String string0 = databaseLoginPromptConsole0.getUser();
      assertEquals("", string0);
  }

  @Test(timeout = 4000)
  public void test01()  throws Throwable  {
      DatabaseLoginPromptConsole databaseLoginPromptConsole0 = new DatabaseLoginPromptConsole();
      SystemInUtil.addInputLine("");
      databaseLoginPromptConsole0.prompt();
      String string0 = databaseLoginPromptConsole0.getServer();
      assertEquals("", string0);
  }

  @Test(timeout = 4000)
  public void test02()  throws Throwable  {
      SystemInUtil.addInputLine("Enter Database");
      DatabaseLoginPromptConsole databaseLoginPromptConsole0 = new DatabaseLoginPromptConsole();
      boolean boolean0 = databaseLoginPromptConsole0.prompt();
      assertTrue(boolean0);
      
      String string0 = databaseLoginPromptConsole0.getPort();
      assertEquals("", string0);
      assertNotNull(string0);
  }

  @Test(timeout = 4000)
  public void test03()  throws Throwable  {
      DatabaseLoginPromptConsole databaseLoginPromptConsole0 = new DatabaseLoginPromptConsole();
      SystemInUtil.addInputLine("Enter Password");
      boolean boolean0 = databaseLoginPromptConsole0.prompt();
      assertTrue(boolean0);
      
      String string0 = databaseLoginPromptConsole0.getDb();
      assertNotNull(string0);
      assertEquals("", databaseLoginPromptConsole0.getPort());
  }

  @Test(timeout = 4000)
  public void test04()  throws Throwable  {
      DatabaseLoginPromptConsole databaseLoginPromptConsole0 = new DatabaseLoginPromptConsole();
      SystemInUtil.addInputLine("");
      databaseLoginPromptConsole0.prompt();
      String string0 = databaseLoginPromptConsole0.getDb();
      assertEquals("", string0);
  }

  @Test(timeout = 4000)
  public void test05()  throws Throwable  {
      DatabaseLoginPromptConsole databaseLoginPromptConsole0 = new DatabaseLoginPromptConsole();
      // Undeclared exception!
      try { 
        databaseLoginPromptConsole0.prompt();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.io.UI", e);
      }
  }

  @Test(timeout = 4000)
  public void test06()  throws Throwable  {
      DatabaseLoginPromptConsole databaseLoginPromptConsole0 = new DatabaseLoginPromptConsole();
      // Undeclared exception!
      try { 
        databaseLoginPromptConsole0.getSSL();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.database.DatabaseLoginPromptConsole", e);
      }
  }

  @Test(timeout = 4000)
  public void test07()  throws Throwable  {
      SystemInUtil.addInputLine("Enter Database");
      DatabaseLoginPromptConsole databaseLoginPromptConsole0 = new DatabaseLoginPromptConsole();
      databaseLoginPromptConsole0.prompt();
      boolean boolean0 = databaseLoginPromptConsole0.prompt();
      assertEquals("", databaseLoginPromptConsole0.getPort());
      assertTrue(boolean0);
  }

  @Test(timeout = 4000)
  public void test08()  throws Throwable  {
      DatabaseLoginPromptConsole databaseLoginPromptConsole0 = new DatabaseLoginPromptConsole();
      UI.UIMode uI_UIMode0 = UI.UIMode.SWING;
      UI.mode = uI_UIMode0;
      UI.UIMode uI_UIMode1 = UI.UIMode.SCRIPT;
      UI.mode = uI_UIMode1;
      boolean boolean0 = databaseLoginPromptConsole0.prompt();
      assertFalse(boolean0);
  }

  @Test(timeout = 4000)
  public void test09()  throws Throwable  {
      SystemInUtil.addInputLine("Enter Database");
      DatabaseLoginPromptConsole databaseLoginPromptConsole0 = new DatabaseLoginPromptConsole();
      boolean boolean0 = databaseLoginPromptConsole0.prompt();
      assertTrue(boolean0);
      
      boolean boolean1 = databaseLoginPromptConsole0.getSSL();
      assertEquals("", databaseLoginPromptConsole0.getPort());
      assertFalse(boolean1 == boolean0);
      assertFalse(boolean1);
  }

  @Test(timeout = 4000)
  public void test10()  throws Throwable  {
      DatabaseLoginPromptConsole databaseLoginPromptConsole0 = new DatabaseLoginPromptConsole();
      String string0 = databaseLoginPromptConsole0.getDb();
      assertNull(string0);
  }

  @Test(timeout = 4000)
  public void test11()  throws Throwable  {
      DatabaseLoginPromptConsole databaseLoginPromptConsole0 = new DatabaseLoginPromptConsole();
      String string0 = databaseLoginPromptConsole0.getUser();
      assertNull(string0);
  }

  @Test(timeout = 4000)
  public void test12()  throws Throwable  {
      DatabaseLoginPromptConsole databaseLoginPromptConsole0 = new DatabaseLoginPromptConsole();
      String string0 = databaseLoginPromptConsole0.getServer();
      assertNull(string0);
  }

  @Test(timeout = 4000)
  public void test13()  throws Throwable  {
      DatabaseLoginPromptConsole databaseLoginPromptConsole0 = new DatabaseLoginPromptConsole();
      JPasswordField jPasswordField0 = databaseLoginPromptConsole0.getPfield();
      assertFalse(jPasswordField0.isFocusTraversalPolicyProvider());
  }

  @Test(timeout = 4000)
  public void test14()  throws Throwable  {
      DatabaseLoginPromptConsole databaseLoginPromptConsole0 = new DatabaseLoginPromptConsole();
      String string0 = databaseLoginPromptConsole0.getPort();
      assertNull(string0);
  }
}
