content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Mon Mar 18 06:26:37 GMT 2024
   */
  
  package com.lts.io;
  
  import org.junit.jupiter.api.Test;
  import static org.junit.jupiter.api.Assertions.*;
  import org.junit.jupiter.api.Timeout;
  import java.util.concurrent.TimeUnit;
  import static org.evosuite.runtime.EvoAssertions.*;
  import com.lts.io.DirectoryScanner;
  import java.io.File;
  import java.util.Vector;
  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 DirectoryScanner_Original_ESTest extends DirectoryScanner_Original_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsIncludedReturningTrue() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        String[] stringArray = new String[1];
        stringArray[0] = "**/*~";
        directoryScanner.includes = stringArray;
        boolean included = directoryScanner.isIncluded("**/*~");
        assertTrue(included);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsIncludedReturningFalse() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setBasedir("");
        directoryScanner.scan();
        boolean included = directoryScanner.isIncluded("");
        assertFalse(included);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsExcludedReturningTrue() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        String[] stringArray = new String[3];
        stringArray[0] = "p7F_o";
        directoryScanner.excludes = stringArray;
        boolean excluded = directoryScanner.isExcluded("p7F_o");
        assertTrue(excluded);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testIsExcludedReturningFalse() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setBasedir("");
        directoryScanner.scan();
        boolean excluded = directoryScanner.isExcluded("");
        assertFalse(excluded);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNotIncludedFilesReturningEmptyArray() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setBasedir("");
        directoryScanner.scan();
        String[] notIncludedFiles = directoryScanner.getNotIncludedFiles();
        assertEquals(0, notIncludedFiles.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetBasedirReturningFileWhereLastModifiedIsPositive() throws Throwable  {
        MockFile arg2 = new MockFile(".!mr X$<");
        MockFile.createTempFile(".!mr X$<", ".!mr X$<", (File) arg2);
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setBasedir(".!mr X$<");
        File basedir = directoryScanner.getBasedir();
        assertTrue(basedir.canWrite());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCouldHoldIncludedReturningFalse() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        String[] stringArray = new String[1];
        stringArray[0] = "[lsAK^h<,kW{jD7";
        directoryScanner.includes = stringArray;
        boolean couldHoldIncluded = directoryScanner.couldHoldIncluded("] ");
        assertFalse(couldHoldIncluded);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetBasedirTakingFile() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        MockFile arg0 = new MockFile("cO^;5jn?3nu|3A{\"S", "");
        directoryScanner.setBasedir((File) arg0);
        assertEquals(0L, arg0.getTotalSpace());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCreatesDirectoryScannerAndCallsAddDefaultExcludes() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.addDefaultExcludes();
        directoryScanner.addDefaultExcludes();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetExcludedDirectoriesReturningNonEmptyArray() throws Throwable  {
        MockFile arg2 = new MockFile("*4?", "*4?");
        MockFile.createTempFile("*4?", "*4?", (File) arg2);
        DirectoryScanner directoryScanner = new DirectoryScanner();
        String[] stringArray = new String[2];
        stringArray[0] = "*4?";
        stringArray[1] = "y";
        directoryScanner.excludes = stringArray;
        directoryScanner.setBasedir("*4?");
        directoryScanner.scan();
        String[] excludedDirectories = directoryScanner.getExcludedDirectories();
        assertEquals(1, excludedDirectories.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetExcludedDirectoriesReturningEmptyArray() throws Throwable  {
        MockFile arg2 = new MockFile("*4?", "*4?");
        MockFile.createTempFile("*4?", "*4?", (File) arg2);
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setBasedir("*4?");
        directoryScanner.scan();
        String[] excludedDirectories = directoryScanner.getExcludedDirectories();
        assertEquals(0, excludedDirectories.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNotIncludedDirectoriesReturningNonEmptyArray() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setBasedir("/home/ubuntu/getting-new-results-dynamosa/non-trivial-java-classes-to-study-search-based-software-testing-approaches/subjects");
        directoryScanner.scan();
        String[] notIncludedDirectories = directoryScanner.getNotIncludedDirectories();
        assertEquals(1, notIncludedDirectories.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetIncludedDirectoriesReturningNonEmptyArray() throws Throwable  {
        MockFile arg2 = new MockFile("*4?", "*4?");
        MockFile.createTempFile("*4?", "*4?", (File) arg2);
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setBasedir("*4?");
        directoryScanner.scan();
        String[] includedDirectories = directoryScanner.getIncludedDirectories();
        assertEquals(1, includedDirectories.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetIncludedDirectoriesReturningEmptyArray() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        Vector<String> vector = new Vector<String>();
        directoryScanner.dirsIncluded = vector;
        String[] includedDirectories = directoryScanner.getIncludedDirectories();
        assertNotNull(includedDirectories);
        assertEquals(0, includedDirectories.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetExcludedFilesThrowsClassCastException() throws Throwable  {
        MockFile arg2 = new MockFile("**/CVS", "**/CVS");
        MockFile.createTempFile("**/CVS", "**/CVS", (File) arg2);
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setBasedir("**/CVS");
        directoryScanner.scan();
        Vector<Object> vector = new Vector<Object>();
        directoryScanner.filesExcluded = vector;
        vector.add((Object) directoryScanner.filesExcluded);
        // Undeclared exception!
        try { 
          directoryScanner.getExcludedFiles();
          fail("Expecting exception: ClassCastException");
        
        } catch(ClassCastException e) {
           //
           // java.util.Vector cannot be cast to java.lang.String
           //
           verifyException("com.lts.io.DirectoryScanner", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetIncludedFilesReturningNonEmptyArray() throws Throwable  {
        MockFile arg2 = new MockFile("**OCV|", "**OCV|");
        MockFile.createTempFile("**OCV|", "**OCV|", (File) arg2);
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setBasedir("**OCV|");
        directoryScanner.scan();
        String[] includedFiles = directoryScanner.getIncludedFiles();
        assertEquals(1, includedFiles.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetIncludedFilesReturningEmptyArray() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        MockFile arg2 = new MockFile("9|q]-Aruh\"<8QlUG", "");
        MockFile.createTempFile("9|q]-Aruh\"<8QlUG", "**/#*#", (File) arg2);
        directoryScanner.setBasedir("9|q]-Aruh\"<8QlUG");
        directoryScanner.scan();
        String[] includedFiles = directoryScanner.getIncludedFiles();
        assertEquals(0, includedFiles.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testScandir() throws Throwable  {
        MockFile arg0 = new MockFile("**/CVS", "**/CVS");
        MockFile.createTempFile("**/CVS", "**/CVS", (File) arg0);
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setBasedir("**/CVS");
        directoryScanner.scan();
        directoryScanner.scandir(arg0, "**/CVS", false);
        assertTrue(arg0.canExecute());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testScandirThrowsException() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setBasedir("//*z**/CVS0**");
        File arg0 = directoryScanner.getBasedir();
        try { 
          directoryScanner.scandir(arg0, "basedir does not exist", true);
          fail("Expecting exception: Exception");
        
        } catch(Exception e) {
           //
           // IO error scanning directory /*z**_/CVS0**
           //
           verifyException("com.lts.io.DirectoryScanner", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetExcludedFilesThrowsNullPointerExceptionAndScanAndSetBasedirTakingString() throws Throwable  {
        MockFile arg2 = new MockFile("*4?", "*4?");
        MockFile.createTempFile("*4?", "*4?", (File) arg2);
        DirectoryScanner directoryScanner = new DirectoryScanner();
        String[] stringArray = new String[2];
        stringArray[0] = "*4?";
        directoryScanner.excludes = stringArray;
        directoryScanner.setBasedir("*4?");
        directoryScanner.scan();
        // Undeclared exception!
        try { 
          directoryScanner.getExcludedFiles();
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNotIncludedDirectoriesReturningEmptyArray() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setBasedir("");
        directoryScanner.scan();
        String[] notIncludedDirectories = directoryScanner.getNotIncludedDirectories();
        assertEquals(0, notIncludedDirectories.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetExcludedFilesThrowsNullPointerException() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.haveSlowResults = true;
        // Undeclared exception!
        try { 
          directoryScanner.getExcludedFiles();
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.lts.io.DirectoryScanner", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSlowScanThrowsNullPointerException() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        // Undeclared exception!
        try { 
          directoryScanner.slowScan();
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.lts.io.DirectoryScanner", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testScanThrowsIllegalStateException0() throws Throwable  {
        MockFile arg2 = new MockFile("*/+*");
        File createTempFile = MockFile.createTempFile("*/+*", "*/+*", (File) arg2);
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.basedir = createTempFile;
        // Undeclared exception!
        try { 
          directoryScanner.scan();
          fail("Expecting exception: IllegalStateException");
        
        } catch(IllegalStateException e) {
           //
           // basedir is not a directory
           //
           verifyException("com.lts.io.DirectoryScanner", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testScanThrowsIllegalStateException1() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        // Undeclared exception!
        try { 
          directoryScanner.scan();
          fail("Expecting exception: IllegalStateException");
        
        } catch(IllegalStateException e) {
           //
           // No basedir set
           //
           verifyException("com.lts.io.DirectoryScanner", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetExcludesWithNonEmptyArray() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        String[] arg0 = new String[2];
        arg0[0] = "*AY&*s";
        arg0[1] = "slSs<DF;r1ou}rc`=/";
        directoryScanner.setExcludes(arg0);
        assertEquals(2, arg0.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetExcludesWithNull() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setExcludes((String[]) null);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetIncludesThrowsNullPointerException() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        String[] arg0 = new String[9];
        arg0[0] = "";
        arg0[1] = "sSs<DF;r1ou}9c`=/";
        // Undeclared exception!
        try { 
          directoryScanner.setIncludes(arg0);
          fail("Expecting exception: NullPointerException");
        
        } catch(NullPointerException e) {
           //
           // no message in exception (getMessage() returned null)
           //
           verifyException("com.lts.io.DirectoryScanner", e);
        }
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetIncludes() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        String[] arg0 = new String[2];
        arg0[0] = "**/C)*";
        arg0[1] = "**/C)*";
        directoryScanner.setIncludes(arg0);
        assertEquals(2, arg0.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetIncludesWithNull() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setIncludes((String[]) null);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMatchPatternStartReturningTrue() throws Throwable  {
        boolean matchPatternStart = DirectoryScanner.matchPatternStart("*@kh?0*", "*@kh?0*");
        assertTrue(matchPatternStart);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMatchPathAndMatchPathReturningTrue0() throws Throwable  {
        boolean matchPath = DirectoryScanner.matchPath("//**//*E0PU@**/S/**", "//**//*E0PU@**/S/**");
        assertTrue(matchPath);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMatchWithNonEmptyString() throws Throwable  {
        boolean match = DirectoryScanner.match("*?", "R");
        assertTrue(match);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMatch() throws Throwable  {
        boolean match = DirectoryScanner.match("**", "");
        assertTrue(match);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMatchPathAndMatchPathReturningTrue1() throws Throwable  {
        boolean matchPath = DirectoryScanner.matchPath("?4%R0!*~Z0<4C+51", "?4%R0!*~Z0<4C+51");
        assertTrue(matchPath);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMatchReturningFalse() throws Throwable  {
        boolean match = DirectoryScanner.match("//*@lCV/0w*", "");
        assertFalse(match);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMatchPathAndMatchPathReturningTrue2() throws Throwable  {
        boolean matchPath = DirectoryScanner.matchPath("$@s|vnl,?a", "$@s|vnl,?a");
        assertTrue(matchPath);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testScan() throws Throwable  {
        MockFile arg2 = new MockFile("**/%*%");
        MockFile.createTempFile("**/%*%", "**/%*%", (File) arg2);
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.addDefaultExcludes();
        directoryScanner.setBasedir("**/%*%");
        directoryScanner.scan();
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMatchPathAndMatchPathReturningTrue3() throws Throwable  {
        boolean matchPath = DirectoryScanner.matchPath("/**/CS/**/**/CS", "/**/CS/**/**/CS");
        assertTrue(matchPath);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMatchPathAndMatchPathReturningFalse0() throws Throwable  {
        boolean matchPath = DirectoryScanner.matchPath("/**/CVS/**", "/");
        assertFalse(matchPath);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMatchPathAndMatchPathReturningFalse1() throws Throwable  {
        boolean matchPath = DirectoryScanner.matchPath("*rY$?", "*");
        assertFalse(matchPath);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMatchPathAndMatchPathReturningFalse2() throws Throwable  {
        boolean matchPath = DirectoryScanner.matchPath("**/V/*", "**Yi*;");
        assertFalse(matchPath);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMatchPatternStart0() throws Throwable  {
        boolean matchPatternStart = DirectoryScanner.matchPatternStart("/JU[yh#m:TH?s,ZASG^", "/**/CVS");
        assertFalse(matchPatternStart);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testCouldHoldIncludedReturningTrue() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        String[] stringArray = new String[2];
        stringArray[0] = "**/CVS";
        directoryScanner.includes = stringArray;
        boolean couldHoldIncluded = directoryScanner.couldHoldIncluded("**/CVS");
        assertTrue(couldHoldIncluded);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetNotIncludedFilesReturningNonEmptyArray() throws Throwable  {
        MockFile arg2 = new MockFile("*/+*");
        MockFile.createTempFile("*/+*", "*/+*", (File) arg2);
        DirectoryScanner directoryScanner = new DirectoryScanner();
        String[] stringArray = new String[3];
        stringArray[0] = "*/+*";
        stringArray[1] = "*/+*";
        stringArray[2] = "*/+*";
        directoryScanner.includes = stringArray;
        directoryScanner.setBasedir("*/+*");
        directoryScanner.scan();
        String[] notIncludedFiles = directoryScanner.getNotIncludedFiles();
        assertEquals(1, notIncludedFiles.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetExcludedFiles() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setBasedir("/");
        directoryScanner.scan();
        String[] excludedFiles = directoryScanner.getExcludedFiles();
        assertEquals(0, excludedFiles.length);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testMatchPatternStart1() throws Throwable  {
        boolean matchPatternStart = DirectoryScanner.matchPatternStart("*", "**/%*%/");
        assertFalse(matchPatternStart);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetBasedirReturningNull() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        File basedir = directoryScanner.getBasedir();
        assertNull(basedir);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testScanThrowsIllegalStateExceptionAndSetBasedirTakingString() throws Throwable  {
        DirectoryScanner directoryScanner = new DirectoryScanner();
        directoryScanner.setBasedir("**/CVS");
        // Undeclared exception!
        try { 
          directoryScanner.scan();
          fail("Expecting exception: IllegalStateException");
        
        } catch(IllegalStateException e) {
           //
           // basedir does not exist
           //
           verifyException("com.lts.io.DirectoryScanner", e);
        }
    }
  }
  