/*
 * This file was automatically generated by EvoSuite
 * Thu Jan 21 18:48:00 GMT 2021
 */

package org.apache.commons.io;

import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.runtime.EvoAssertions.*;
import java.io.File;
import java.util.List;
import org.apache.commons.io.FileCleaningTracker;
import org.apache.commons.io.FileDeleteStrategy;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.mock.java.io.MockFile;
import org.junit.runner.RunWith;

@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
public class FileCleaningTracker_ESTest extends FileCleaningTracker_ESTest_scaffolding {

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      FileCleaningTracker fileCleaningTracker0 = new FileCleaningTracker();
      MockFile mockFile0 = new MockFile("No new trackers can be added once exitWhenFinished() is called", "No new trackers can be added once exitWhenFinished() is called");
      FileDeleteStrategy fileDeleteStrategy0 = new FileDeleteStrategy("path");
      File file0 = MockFile.createTempFile("path", "No new trackers can be added once exitWhenFinished() is called");
      fileCleaningTracker0.track((File) mockFile0, (Object) "No new trackers can be added once exitWhenFinished() is called");
      fileDeleteStrategy0.delete(file0);
      fileDeleteStrategy0.deleteQuietly(file0);
      fileDeleteStrategy0.toString();
      fileCleaningTracker0.track((File) mockFile0, (Object) "No new trackers can be added once exitWhenFinished() is called", fileDeleteStrategy0);
      fileCleaningTracker0.exitWhenFinished();
      Object object0 = new Object();
      // Undeclared exception!
      try { 
        fileCleaningTracker0.track(file0, object0);
        fail("Expecting exception: IllegalStateException");
      
      } catch(IllegalStateException e) {
         //
         // No new trackers can be added once exitWhenFinished() is called
         //
         verifyException("org.apache.commons.io.FileCleaningTracker", e);
      }
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      FileCleaningTracker fileCleaningTracker0 = new FileCleaningTracker();
      MockFile mockFile0 = new MockFile("dm?}X{X';x", "l0;kv]j{>$y`Nx>");
      mockFile0.delete();
      fileCleaningTracker0.track("l0;kv]j{>$y`Nx>", (Object) "org.apache.commons.io.IOCase");
      File file0 = MockFile.createTempFile("l0;kv]j{>$y`Nx>", "l0;kv]j{>$y`Nx>");
      FileDeleteStrategy.ForceFileDeleteStrategy fileDeleteStrategy_ForceFileDeleteStrategy0 = (FileDeleteStrategy.ForceFileDeleteStrategy)FileDeleteStrategy.FORCE;
      fileCleaningTracker0.track("l0;kv]j{>$y`Nx>", (Object) mockFile0, (FileDeleteStrategy) fileDeleteStrategy_ForceFileDeleteStrategy0);
      fileCleaningTracker0.track((File) mockFile0, (Object) "l0;kv]j{>$y`Nx>");
      Object object0 = new Object();
      fileCleaningTracker0.track("org.apache.commons.io.IOCase", object0);
      Object object1 = new Object();
      fileCleaningTracker0.track((File) mockFile0, object1);
      fileCleaningTracker0.getDeleteFailures();
      fileCleaningTracker0.track(file0, (Object) file0, (FileDeleteStrategy) fileDeleteStrategy_ForceFileDeleteStrategy0);
      List<String> list0 = fileCleaningTracker0.getDeleteFailures();
      assertEquals(0, list0.size());
  }

  @Test(timeout = 4000)
  public void test2()  throws Throwable  {
      FileCleaningTracker fileCleaningTracker0 = new FileCleaningTracker();
      MockFile mockFile0 = new MockFile("", "23q/8(Sl=_DLg");
      fileCleaningTracker0.track((File) mockFile0, (Object) "");
      assertFalse(mockFile0.isHidden());
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      FileCleaningTracker fileCleaningTracker0 = new FileCleaningTracker();
      fileCleaningTracker0.exitWhenFinished();
      fileCleaningTracker0.exitWhenFinished();
      MockFile mockFile0 = new MockFile(",", ")");
      MockFile mockFile1 = new MockFile(mockFile0, ")");
      mockFile0.setLastModified(0L);
      Object object0 = new Object();
      // Undeclared exception!
      try { 
        fileCleaningTracker0.track((File) mockFile1, object0);
        fail("Expecting exception: IllegalStateException");
      
      } catch(IllegalStateException e) {
         //
         // No new trackers can be added once exitWhenFinished() is called
         //
         verifyException("org.apache.commons.io.FileCleaningTracker", e);
      }
  }

  @Test(timeout = 4000)
  public void test4()  throws Throwable  {
      FileCleaningTracker fileCleaningTracker0 = new FileCleaningTracker();
      int int0 = fileCleaningTracker0.getTrackCount();
      assertEquals(0, int0);
      
      String string0 = "";
      Object object0 = new Object();
      fileCleaningTracker0.track("v%i50n)", (Object) "");
      fileCleaningTracker0.exitWhenFinished = true;
      FileDeleteStrategy.ForceFileDeleteStrategy fileDeleteStrategy_ForceFileDeleteStrategy0 = (FileDeleteStrategy.ForceFileDeleteStrategy)FileDeleteStrategy.FORCE;
      // Undeclared exception!
      try { 
        fileCleaningTracker0.track("", object0, (FileDeleteStrategy) fileDeleteStrategy_ForceFileDeleteStrategy0);
        fail("Expecting exception: IllegalStateException");
      
      } catch(IllegalStateException e) {
         //
         // No new trackers can be added once exitWhenFinished() is called
         //
         verifyException("org.apache.commons.io.FileCleaningTracker", e);
      }
  }

  @Test(timeout = 4000)
  public void test5()  throws Throwable  {
      FileCleaningTracker fileCleaningTracker0 = new FileCleaningTracker();
      Object object0 = new Object();
      fileCleaningTracker0.track(" s(4X6A50efKM>v", object0);
  }

  @Test(timeout = 4000)
  public void test6()  throws Throwable  {
      FileCleaningTracker fileCleaningTracker0 = new FileCleaningTracker();
      FileDeleteStrategy fileDeleteStrategy0 = FileDeleteStrategy.NORMAL;
      fileCleaningTracker0.track("@@K=qf}1U;bz3}>n", (Object) "@@K=qf}1U;bz3}>n", fileDeleteStrategy0);
      fileCleaningTracker0.getDeleteFailures();
      MockFile mockFile0 = new MockFile("@@K=qf}1U;bz3}>n", "@@K=qf}1U;bz3}>n");
      Object object0 = new Object();
      fileCleaningTracker0.track((File) mockFile0, object0, fileDeleteStrategy0);
      assertFalse(mockFile0.exists());
  }

  @Test(timeout = 4000)
  public void test7()  throws Throwable  {
      FileCleaningTracker fileCleaningTracker0 = new FileCleaningTracker();
      fileCleaningTracker0.getDeleteFailures();
      String string0 = null;
      String string1 = "G\"6^P";
      // Undeclared exception!
      try { 
        MockFile.createTempFile((String) null, "G\"6^P");
        fail("Expecting exception: NullPointerException");
      
      } catch(NullPointerException e) {
         //
         // Cannot invoke \"String.length()\" because \"prefix\" is null
         //
         verifyException("org.evosuite.runtime.vfs.VirtualFileSystem", e);
      }
  }
}
