/*
 * This file was automatically generated by EvoSuite
 * Thu Jan 21 19:21:53 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.BufferedReader;
import java.io.Reader;
import java.io.StringReader;
import java.util.NoSuchElementException;
import org.apache.commons.io.LineIterator;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.junit.runner.RunWith;

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

  @Test(timeout = 4000)
  public void test0()  throws Throwable  {
      StringReader stringReader0 = new StringReader("<Z%h&|nEdJ%8Af");
      BufferedReader bufferedReader0 = new BufferedReader(stringReader0);
      LineIterator lineIterator0 = new LineIterator(bufferedReader0);
      LineIterator lineIterator1 = new LineIterator(bufferedReader0);
      lineIterator0.close();
      // Undeclared exception!
      try { 
        lineIterator1.hasNext();
        fail("Expecting exception: IllegalStateException");
      
      } catch(IllegalStateException e) {
         //
         // java.io.IOException: Stream closed
         //
         verifyException("org.apache.commons.io.LineIterator", e);
      }
  }

  @Test(timeout = 4000)
  public void test1()  throws Throwable  {
      Reader reader0 = Reader.nullReader();
      LineIterator lineIterator0 = new LineIterator(reader0);
      // Undeclared exception!
      try { 
        lineIterator0.next();
        fail("Expecting exception: NoSuchElementException");
      
      } catch(NoSuchElementException e) {
         //
         // No more lines
         //
         verifyException("org.apache.commons.io.LineIterator", e);
      }
  }

  @Test(timeout = 4000)
  public void test2()  throws Throwable  {
      Reader reader0 = Reader.nullReader();
      LineIterator lineIterator0 = new LineIterator(reader0);
      boolean boolean0 = lineIterator0.hasNext();
      assertFalse(boolean0);
      
      boolean boolean1 = lineIterator0.hasNext();
      assertFalse(boolean1);
  }

  @Test(timeout = 4000)
  public void test3()  throws Throwable  {
      LineIterator lineIterator0 = null;
      try {
        lineIterator0 = new LineIterator((Reader) null);
        fail("Expecting exception: IllegalArgumentException");
      
      } catch(IllegalArgumentException e) {
         //
         // Reader must not be null
         //
         verifyException("org.apache.commons.io.LineIterator", e);
      }
  }

  @Test(timeout = 4000)
  public void test4()  throws Throwable  {
      StringReader stringReader0 = new StringReader("");
      LineIterator lineIterator0 = new LineIterator(stringReader0);
      LineIterator.closeQuietly(lineIterator0);
  }

  @Test(timeout = 4000)
  public void test5()  throws Throwable  {
      StringReader stringReader0 = new StringReader("NvsS.TISx");
      LineIterator lineIterator0 = new LineIterator(stringReader0);
      String string0 = lineIterator0.next();
      assertEquals("NvsS.TISx", string0);
  }

  @Test(timeout = 4000)
  public void test6()  throws Throwable  {
      StringReader stringReader0 = new StringReader("<Z%h&|nEdJ%8Af");
      LineIterator lineIterator0 = new LineIterator(stringReader0);
      boolean boolean0 = lineIterator0.hasNext();
      assertTrue(boolean0);
      
      boolean boolean1 = lineIterator0.hasNext();
      assertTrue(boolean1);
  }

  @Test(timeout = 4000)
  public void test7()  throws Throwable  {
      StringReader stringReader0 = new StringReader("~Gw!Bv0#~jHC<Q");
      LineIterator lineIterator0 = new LineIterator(stringReader0);
      // Undeclared exception!
      try { 
        lineIterator0.remove();
        fail("Expecting exception: UnsupportedOperationException");
      
      } catch(UnsupportedOperationException e) {
         //
         // Remove unsupported on LineIterator
         //
         verifyException("org.apache.commons.io.LineIterator", e);
      }
  }
}
