/*
 * This file was automatically generated by EvoSuite
 * Thu Sep 20 14:23:13 GMT 2018
 */

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

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import static org.evosuite.runtime.EvoAssertions.*;
import javax.swing.JTree;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
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.filetree.TreeTableModelAdapter;

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

  @Test(timeout = 4000)
  public void test00()  throws Throwable  {
      TreeModel treeModel0 = mock(TreeModel.class, new ViolatedAssumptionAnswer());
      TreePath treePath0 = mock(TreePath.class, new ViolatedAssumptionAnswer());
      doReturn((Object) null).when(treePath0).getLastPathComponent();
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      doReturn(treePath0).when(jTree0).getPathForRow(anyInt());
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter(treeModel0, jTree0);
      TreeModel treeModel1 = mock(TreeModel.class, new ViolatedAssumptionAnswer());
      treeTableModelAdapter0.treeTableModel = treeModel1;
      treeTableModelAdapter0.treeTableModel = null;
      // Undeclared exception!
      try { 
        treeTableModelAdapter0.getValueAt(0, 1856);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.filetree.TreeTableModelAdapter", e);
      }
  }

  @Test(timeout = 4000)
  public void test01()  throws Throwable  {
      TreeModel treeModel0 = mock(TreeModel.class, new ViolatedAssumptionAnswer());
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter(treeModel0, jTree0);
      TreePath treePath0 = mock(TreePath.class, new ViolatedAssumptionAnswer());
      doReturn((Object) null).when(treePath0).getLastPathComponent();
      JTree jTree1 = mock(JTree.class, new ViolatedAssumptionAnswer());
      doReturn(treePath0).when(jTree1).getPathForRow(anyInt());
      treeTableModelAdapter0.tree = jTree1;
      Object object0 = treeTableModelAdapter0.nodeForRow((-876));
      assertNull(object0);
  }

  @Test(timeout = 4000)
  public void test02()  throws Throwable  {
      TreeModel treeModel0 = mock(TreeModel.class, new ViolatedAssumptionAnswer());
      TreePath treePath0 = mock(TreePath.class, new ViolatedAssumptionAnswer());
      doReturn("]_2s({W`~KwR5*' ").when(treePath0).getLastPathComponent();
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      doReturn(treePath0).when(jTree0).getPathForRow(anyInt());
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter(treeModel0, jTree0);
      Object object0 = treeTableModelAdapter0.nodeForRow(2);
      assertEquals("]_2s({W`~KwR5*' ", object0);
  }

  @Test(timeout = 4000)
  public void test03()  throws Throwable  {
      TreeModel treeModel0 = mock(TreeModel.class, new ViolatedAssumptionAnswer());
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter(treeModel0, jTree0);
      JTree jTree1 = mock(JTree.class, new ViolatedAssumptionAnswer());
      doReturn(1).when(jTree1).getRowCount();
      treeTableModelAdapter0.tree = jTree1;
      int int0 = treeTableModelAdapter0.getRowCount();
      assertEquals(1, int0);
  }

  @Test(timeout = 4000)
  public void test04()  throws Throwable  {
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      doReturn((-135)).when(jTree0).getRowCount();
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter((TreeModel) null, jTree0);
      int int0 = treeTableModelAdapter0.getRowCount();
      assertEquals((-135), int0);
  }

  @Test(timeout = 4000)
  public void test05()  throws Throwable  {
      TreeModel treeModel0 = mock(TreeModel.class, new ViolatedAssumptionAnswer());
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      doReturn((TreePath) null).when(jTree0).getPathForRow(anyInt());
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter(treeModel0, jTree0);
      // Undeclared exception!
      try { 
        treeTableModelAdapter0.nodeForRow(0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.filetree.TreeTableModelAdapter", e);
      }
  }

  @Test(timeout = 4000)
  public void test06()  throws Throwable  {
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter((TreeModel) null, jTree0);
      treeTableModelAdapter0.tree = null;
      // Undeclared exception!
      try { 
        treeTableModelAdapter0.getRowCount();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.filetree.TreeTableModelAdapter", e);
      }
  }

  @Test(timeout = 4000)
  public void test07()  throws Throwable  {
      TreeModel treeModel0 = mock(TreeModel.class, new ViolatedAssumptionAnswer());
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter(treeModel0, jTree0);
      // Undeclared exception!
      try { 
        treeTableModelAdapter0.getColumnName((-1));
        fail("Expecting exception: ClassCastException");
      
      } catch(ClassCastException e) {
         //
         // codegen.javax.swing.tree.TreeModel$MockitoMock$1448187456 cannot be cast to uk.ac.sanger.artemis.components.filetree.FileSystemModel
         //
         verifyException("uk.ac.sanger.artemis.components.filetree.TreeTableModelAdapter", e);
      }
  }

  @Test(timeout = 4000)
  public void test08()  throws Throwable  {
      TreeModel treeModel0 = mock(TreeModel.class, new ViolatedAssumptionAnswer());
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter(treeModel0, jTree0);
      // Undeclared exception!
      try { 
        treeTableModelAdapter0.getColumnCount();
        fail("Expecting exception: ClassCastException");
      
      } catch(ClassCastException e) {
         //
         // codegen.javax.swing.tree.TreeModel$MockitoMock$1448187456 cannot be cast to uk.ac.sanger.artemis.components.filetree.FileSystemModel
         //
         verifyException("uk.ac.sanger.artemis.components.filetree.TreeTableModelAdapter", e);
      }
  }

  @Test(timeout = 4000)
  public void test09()  throws Throwable  {
      TreeModel treeModel0 = mock(TreeModel.class, new ViolatedAssumptionAnswer());
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter(treeModel0, jTree0);
      // Undeclared exception!
      try { 
        treeTableModelAdapter0.getColumnClass(1);
        fail("Expecting exception: ClassCastException");
      
      } catch(ClassCastException e) {
         //
         // codegen.javax.swing.tree.TreeModel$MockitoMock$1448187456 cannot be cast to uk.ac.sanger.artemis.components.filetree.FileSystemModel
         //
         verifyException("uk.ac.sanger.artemis.components.filetree.TreeTableModelAdapter", e);
      }
  }

  @Test(timeout = 4000)
  public void test10()  throws Throwable  {
      TreeModel treeModel0 = mock(TreeModel.class, new ViolatedAssumptionAnswer());
      TreeTableModelAdapter treeTableModelAdapter0 = null;
      try {
        treeTableModelAdapter0 = new TreeTableModelAdapter(treeModel0, (JTree) null);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.filetree.TreeTableModelAdapter", e);
      }
  }

  @Test(timeout = 4000)
  public void test11()  throws Throwable  {
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      doReturn(0).when(jTree0).getRowCount();
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter((TreeModel) null, jTree0);
      int int0 = treeTableModelAdapter0.getRowCount();
      assertEquals(0, int0);
  }

  @Test(timeout = 4000)
  public void test12()  throws Throwable  {
      TreeModel treeModel0 = mock(TreeModel.class, new ViolatedAssumptionAnswer());
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter(treeModel0, jTree0);
      boolean boolean0 = treeTableModelAdapter0.isCellEditable(3923, 3923);
      assertTrue(boolean0);
  }

  @Test(timeout = 4000)
  public void test13()  throws Throwable  {
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter((TreeModel) null, jTree0);
      // Undeclared exception!
      try { 
        treeTableModelAdapter0.getColumnClass(15);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.filetree.TreeTableModelAdapter", e);
      }
  }

  @Test(timeout = 4000)
  public void test14()  throws Throwable  {
      TreeModel treeModel0 = mock(TreeModel.class, new ViolatedAssumptionAnswer());
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter(treeModel0, jTree0);
      treeTableModelAdapter0.setValueAt("TIFOa2?;=zW", 4234, 4234);
  }

  @Test(timeout = 4000)
  public void test15()  throws Throwable  {
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter((TreeModel) null, jTree0);
      // Undeclared exception!
      try { 
        treeTableModelAdapter0.getColumnName(0);
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.filetree.TreeTableModelAdapter", e);
      }
  }

  @Test(timeout = 4000)
  public void test16()  throws Throwable  {
      TreeModel treeModel0 = mock(TreeModel.class, new ViolatedAssumptionAnswer());
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter(treeModel0, jTree0);
      // Undeclared exception!
      try { 
        treeTableModelAdapter0.getValueAt(0, 0);
        fail("Expecting exception: ClassCastException");
      
      } catch(ClassCastException e) {
         //
         // codegen.javax.swing.tree.TreeModel$MockitoMock$1448187456 cannot be cast to uk.ac.sanger.artemis.components.filetree.FileSystemModel
         //
         verifyException("uk.ac.sanger.artemis.components.filetree.TreeTableModelAdapter", e);
      }
  }

  @Test(timeout = 4000)
  public void test17()  throws Throwable  {
      JTree jTree0 = mock(JTree.class, new ViolatedAssumptionAnswer());
      TreeTableModelAdapter treeTableModelAdapter0 = new TreeTableModelAdapter((TreeModel) null, jTree0);
      // Undeclared exception!
      try { 
        treeTableModelAdapter0.getColumnCount();
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // no message in exception (getMessage() returned null)
         //
         verifyException("uk.ac.sanger.artemis.components.filetree.TreeTableModelAdapter", e);
      }
  }
}
