content: /*
   * This file was automatically generated by UTestGen and EvoSuite
   * Thu Mar 21 04:04:30 GMT 2024
   */
  
  package visu.handball.moves.xml;
  
  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 java.awt.HeadlessException;
  import java.io.File;
  import java.io.InputStream;
  import java.io.PipedInputStream;
  import org.evosuite.runtime.EvoRunner;
  import org.evosuite.runtime.EvoRunnerParameters;
  import org.evosuite.runtime.mock.java.io.MockFile;
  import org.junit.runner.RunWith;
  import visu.handball.moves.xml.HandballModelReader;
  
  @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) 
  public class HandballModelReader_ESTest extends HandballModelReader_ESTest_scaffolding {
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetInputFileReturningFileWhereIsAbsoluteIsTrue() throws Throwable  {
        // No Comments were added
        MockFile arg2 = new MockFile("");
        File arg0 = MockFile.createTempFile("|k:f}R!=JARoJY$TZO", "|k:f}R!=JARoJY$TZO", (File) arg2);
        HandballModelReader instance = HandballModelReader.getInstance(arg0);
        File inputFile = instance.getInputFile();
        assertTrue(inputFile.canExecute());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetInputFileReturningFileWhereIsDirectoryIsTrue() throws Throwable  {
        // Arrange
        MockFile mockFile = new MockFile((File) null, "");
        HandballModelReader instance = HandballModelReader.getInstance(mockFile);
        
        // Act
        File inputFile = instance.getInputFile();
        
        // Assert
        assertFalse(inputFile.isHidden());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetInputFileReturningFileWhereLastModifiedIsZero() throws Throwable  {
        // Given: The HandballModelReader class is initialized with a mock file named "move"
        MockFile arg0 = new MockFile("move");
        HandballModelReader instance = HandballModelReader.getInstance((File) arg0);
        
        // When: The getInputFile method of the HandballModelReader instance is called
        File inputFile = instance.getInputFile();
        
        // Then: The input file should be a mock file with the name "move" and total space of 0
        assertEquals(0L, inputFile.getTotalSpace());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetInputFile() throws Throwable  {
        // Create a new instance of MockFile and set its path to "PRH=FN;mnKoHs2jcxh"
        MockFile arg0 = new MockFile("PRH=FN;mnKoHs2jcxh");
        
        // Get an instance of the HandballModelReader class using the static getInstance() method
        HandballModelReader instance = HandballModelReader.getInstance((File) arg0);
        
        // Set the input file for the HandballModelReader instance to the MockFile object created earlier
        instance.setInputFile(arg0);
        
        // Assert that the usable space of the input file is equal to 0L
        assertEquals(0L, arg0.getUsableSpace());
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testSetInputStream() throws Throwable  {
        // Given: A HandballModelReader instance with a MockFile argument that contains the string "PRH=FN;mnKoHs2jcxh"
        MockFile arg0 = new MockFile("PRH=FN;mnKoHs2jcxh");
        HandballModelReader instance = HandballModelReader.getInstance((File) arg0);
        
        // When: The setInputStream method is called with a null value
        instance.setInputStream((InputStream) null);
        
        // Then: An IllegalArgumentException should be thrown, indicating that the input stream cannot be null
        assertThrows(IllegalArgumentException.class, () -> instance.setInputStream((InputStream) null));
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testReadFromXmlThrowsHeadlessException() throws Throwable  {
        PipedInputStream arg0 = new PipedInputStream();
        HandballModelReader instance = HandballModelReader.getInstance((InputStream) arg0);
        // When: We attempt to read from a non-headless environment
        try {
        instance.readFromXml();
        fail("Expecting exception: HeadlessException");
        
        } catch(HeadlessException e) {
        // Then: An exception is thrown indicating that the program is running in a headless mode
        verifyException("java.awt.GraphicsEnvironment", e);}
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetInputFileReturningNull() throws Throwable  {
        // No Comments were added
        HandballModelReader instance = HandballModelReader.getInstance((InputStream) null);
        File inputFile = instance.getInputFile();
        assertNull(inputFile);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetInputStream() throws Throwable  {
        // Setup a MockFile with the expected file path and contents
        MockFile arg0 = new MockFile("PRH=FN;mnKoHs2jcxh");
        
        // Create an instance of HandballModelReader using the MockFile
        HandballModelReader instance = HandballModelReader.getInstance((File) arg0);
        
        // Call the method to be tested and get the result (InputStream)
        InputStream inputStream = instance.getInputStream();
        
        // Assert that the returned InputStream is null
        assertNull(inputStream);
    }
  
    @Test
    @Timeout(value = 4000 , unit = TimeUnit.MILLISECONDS)
    public void testGetInstanceTakingInputStreamWithNull() throws Throwable  {
        // Given: an instance of HandballModelReader with a null input stream
        HandballModelReader instance = HandballModelReader.getInstance((InputStream) null);
        
        // When: trying to read from the XML file
        try {
        instance.readFromXml();
        
        // Then: expect an exception to be thrown
        fail("Expecting exception: HeadlessException");
        } catch(HeadlessException e) {
        // Verify that the exception is of type HeadlessException
        verifyException("java.awt.GraphicsEnvironment", e);}
    }
  }
  