content: /*
   * This file was automatically generated by EvoSuite
   */
  
  package com.lts.io.archive;
  
  import org.junit.Test;
  import org.junit.runner.RunWith;
  import org.evosuite.junit.EvoSuiteRunner;
  import static org.junit.Assert.*;
  import com.lts.LTSException;
  import com.lts.io.ImprovedFile;
  import com.lts.io.archive.ZipArchive;
  import com.lts.util.deepcopy.DeepCopyException;
  import java.io.BufferedInputStream;
  import java.io.ByteArrayOutputStream;
  import java.io.DataInputStream;
  import java.io.File;
  import java.io.IOException;
  import java.io.InputStream;
  import java.io.OutputStream;
  import java.io.PrintStream;
  import java.net.URL;
  import java.util.Enumeration;
  import java.util.List;
  import java.util.Properties;
  import java.util.StringTokenizer;
  import java.util.concurrent.ExecutorService;
  import java.util.concurrent.Executors;
  import java.util.concurrent.Future;
  import java.util.concurrent.TimeUnit;
  import org.evosuite.Properties.SandboxMode;
  import org.evosuite.sandbox.Sandbox;
  import org.junit.After;
  import org.junit.AfterClass;
  import org.junit.Before;
  import org.junit.BeforeClass;
  
  @RunWith(EvoSuiteRunner.class)
  public class ZipArchiveEvoSuiteTest {
  
    private static ExecutorService executor; 
  
    @BeforeClass 
    public static void initEvoSuiteFramework(){ 
      org.evosuite.Properties.REPLACE_CALLS = false; 
      org.evosuite.Properties.SANDBOX_MODE = SandboxMode.RECOMMENDED; 
      Sandbox.initializeSecurityManagerForSUT(); 
      executor = Executors.newCachedThreadPool(); 
    } 
  
    @AfterClass 
    public static void clearEvoSuiteFramework(){ 
      executor.shutdownNow(); 
      Sandbox.resetDefaultSecurityManager(); 
    } 
  
    @Before 
    public void initTestCase(){ 
      Sandbox.goingToExecuteSUTCode(); 
    } 
  
    @After 
    public void doneWithTestCase(){ 
      Sandbox.doneWithExecutingSUTCode(); 
    } 
  
  
    //Test case number: 0
    /*
     * 2 covered goals:
     * 1 com.lts.io.archive.ZipArchive.deepCopyData(Ljava/lang/Object;Ljava/util/Map;Z)V: root-Branch
     * 2 com.lts.io.archive.ZipArchive.<init>()V: root-Branch
     */
    @Test
    public void test0()  throws Throwable  {
        ZipArchive zipArchive0 = new ZipArchive();
        // Undeclared exception!
        try {
          zipArchive0.deepCopy(true);
          fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        }
    }
  
    //Test case number: 1
    /*
     * 2 covered goals:
     * 1 com.lts.io.archive.ZipArchive.entryToURL(Ljava/lang/String;)Ljava/net/URL;: root-Branch
     * 2 com.lts.io.archive.ZipArchive.<init>(Ljava/io/File;)V: root-Branch
     */
    @Test
    public void test1()  throws Throwable  {
        ImprovedFile improvedFile0 = new ImprovedFile("]k]+OR6t", "]k]+OR6t");
        ZipArchive zipArchive0 = new ZipArchive((File) improvedFile0);
        URL uRL0 = zipArchive0.entryToURL("K]Z24B_x,!jLZ");
        assertEquals("file:/scratch/gordon/test_sf110/sf110/78_caloriecount/%5Dk%5D+OR6t/%5Dk%5D+OR6t!/K]Z24B_x,!jLZ", uRL0.getPath());
        assertNotNull(uRL0);
    }
  
    //Test case number: 2
    /*
     * 1 covered goal:
     * 1 com.lts.io.archive.ZipArchive.<init>(Ljava/io/InputStream;Lcom/lts/io/ImprovedFile;)V: root-Branch
     */
    @Test
    public void test2()  throws Throwable  {
      Future<?> future = executor.submit(new Runnable(){ 
              public void run() { 
          try {
            ZipArchive zipArchive0 = null;
            try {
              zipArchive0 = new ZipArchive((InputStream) null, (ImprovedFile) null);
              fail("Expecting exception: SecurityException");
            } catch(SecurityException e) {
              /*
               * Security manager blocks (java.io.FilePermission /tmp/arc3246623612716098578zip write)
               * java.lang.Thread.getStackTrace(Thread.java:1479)
               * org.evosuite.sandbox.MSecurityManager.checkPermission(MSecurityManager.java:303)
               * java.lang.SecurityManager.checkWrite(SecurityManager.java:962)
               * java.io.File.checkAndCreate(File.java:1696)
               * java.io.File.createTempFile(File.java:1792)
               * com.lts.io.ImprovedFile.createTempImprovedFile(ImprovedFile.java:421)
               * com.lts.io.archive.AbstractTempDirectoryArchive.initialize(AbstractTempDirectoryArchive.java:194)
               * com.lts.io.archive.ZipArchive.<init>(ZipArchive.java:118)
               * sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
               * sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
               * sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
               * java.lang.reflect.Constructor.newInstance(Constructor.java:513)
               * org.evosuite.testcase.ConstructorStatement$1.execute(ConstructorStatement.java:226)
               * org.evosuite.testcase.AbstractStatement.exceptionHandler(AbstractStatement.java:142)
               * org.evosuite.testcase.ConstructorStatement.execute(ConstructorStatement.java:188)
               * org.evosuite.testcase.TestRunnable.call(TestRunnable.java:291)
               * org.evosuite.testcase.TestRunnable.call(TestRunnable.java:44)
               * java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
               * java.util.concurrent.FutureTask.run(FutureTask.java:138)
               * java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
               * java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
               * java.lang.Thread.run(Thread.java:662)
               */
            }
          } catch(Throwable t) {
              // Need to catch declared exceptions
          }
        } 
      }); 
      future.get(6000, TimeUnit.MILLISECONDS); 
    }
  
    //Test case number: 3
    /*
     * 2 covered goals:
     * 1 com.lts.io.archive.ZipArchive.getZipFile()Ljava/util/zip/ZipFile;: I5 Branch 1 IF_ACMPNE L57 - false
     * 2 com.lts.io.archive.ZipArchive.<init>(Ljava/lang/String;)V: root-Branch
     */
    @Test
    public void test3()  throws Throwable  {
        ZipArchive zipArchive0 = new ZipArchive("'2)RP\"&8X0");
        try {
          zipArchive0.getZipFile();
          fail("Expecting exception: LTSException");
        } catch(LTSException e) {
          /*
           * Error trying to initialize zipfile for '2)RP\"&8X0
           */
        }
    }
  
    //Test case number: 4
    /*
     * 1 covered goal:
     * 1 com.lts.io.archive.ZipArchive.finalize()V: I5 Branch 2 IF_ACMPEQ L85 - true
     */
    @Test
    public void test4()  throws Throwable  {
        ZipArchive zipArchive0 = new ZipArchive("sR>@T`A7j4~&6:%SJ");
        zipArchive0.finalize();
        assertEquals(true, zipArchive0.createBackups());
        assertEquals(true, zipArchive0.getCreateBackups());
    }
  
    //Test case number: 5
    /*
     * 2 covered goals:
     * 1 com.lts.io.archive.ZipArchive.extractArchive(Ljava/io/File;)V: I5 Branch 3 IFEQ L131 - true
     * 2 com.lts.io.archive.ZipArchive.<init>(Ljava/io/File;Ljava/io/File;Z)V: root-Branch
     */
    @Test
    public void test5()  throws Throwable  {
        ImprovedFile improvedFile0 = new ImprovedFile("]k]+OR6t", "]k]+OR6t");
        ZipArchive zipArchive0 = new ZipArchive((File) improvedFile0, (File) improvedFile0, false);
        // Undeclared exception!
        try {
          zipArchive0.remove((String) null);
          fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        }
    }
  
    //Test case number: 6
    /*
     * 3 covered goals:
     * 1 com.lts.io.archive.ZipArchive.extractArchive(Ljava/io/File;)V: I5 Branch 3 IFEQ L131 - false
     * 2 com.lts.io.archive.ZipArchive.extractArchive(Ljava/io/File;)V: I11 Branch 4 IFGT L131 - true
     * 3 com.lts.io.archive.ZipArchive.<init>(Ljava/io/File;Ljava/io/File;Z)V: root-Branch
     */
    @Test
    public void test6()  throws Throwable  {
        ImprovedFile improvedFile0 = new ImprovedFile("/19=32fWiI9W");
        File file0 = improvedFile0.getParentFile();
        File file1 = file0.getAbsoluteFile();
        ZipArchive zipArchive0 = new ZipArchive(file1, file1, false);
        try {
          zipArchive0.createEntry("/19=32fWiI9W");
          fail("Expecting exception: LTSException");
        } catch(LTSException e) {
          /*
           * Error trying to read zipfile, /
           */
        }
    }
  
    //Test case number: 7
    /*
     * 2 covered goals:
     * 1 com.lts.io.archive.ZipArchive.entryExists(Ljava/lang/String;)Z: I5 Branch 9 IFNE L177 - true
     * 2 com.lts.io.archive.ZipArchive.entryExists(Ljava/lang/String;)Z: I17 Branch 10 IFLE L180 - false
     */
    @Test
    public void test7()  throws Throwable  {
        ImprovedFile improvedFile0 = new ImprovedFile("/19=2fWiI9W");
        File file0 = improvedFile0.getParentFile();
        ZipArchive zipArchive0 = new ZipArchive(file0);
        try {
          zipArchive0.getInputStream("/19=2fWiI9W");
          fail("Expecting exception: LTSException");
        } catch(LTSException e) {
          /*
           * Error trying to ascertain the existence of entry, 19=2fWiI9W
           */
        }
    }
  
    //Test case number: 8
    /*
     * 3 covered goals:
     * 1 com.lts.io.archive.ZipArchive.entryExists(Ljava/lang/String;)Z: I5 Branch 9 IFNE L177 - false
     * 2 com.lts.io.archive.ZipArchive.closeNoExceptions(Ljava/io/InputStream;)V: I4 Branch 18 IF_ACMPNE L351 - false
     * 3 com.lts.io.archive.ZipArchive.closeNoExceptions(Ljava/io/OutputStream;)V: I4 Branch 19 IF_ACMPNE L364 - false
     */
    @Test
    public void test8()  throws Throwable  {
      Future<?> future = executor.submit(new Runnable(){ 
              public void run() { 
          try {
            ZipArchive zipArchive0 = new ZipArchive("");
            ImprovedFile improvedFile0 = (ImprovedFile)zipArchive0.getFile();
            // Undeclared exception!
            try {
              zipArchive0.extractToFile("", (File) improvedFile0);
              fail("Expecting exception: SecurityException");
            } catch(SecurityException e) {
              /*
               * Security manager blocks (java.io.FilePermission  write)
               * java.lang.Thread.getStackTrace(Thread.java:1479)
               * org.evosuite.sandbox.MSecurityManager.checkPermission(MSecurityManager.java:303)
               * java.lang.SecurityManager.checkWrite(SecurityManager.java:962)
               * java.io.FileOutputStream.<init>(FileOutputStream.java:183)
               * java.io.FileOutputStream.<init>(FileOutputStream.java:145)
               * com.lts.io.archive.ZipArchive.extractToFile(ZipArchive.java:385)
               * sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               * sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               * sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               * java.lang.reflect.Method.invoke(Method.java:597)
               * org.evosuite.testcase.MethodStatement$1.execute(MethodStatement.java:262)
               * org.evosuite.testcase.AbstractStatement.exceptionHandler(AbstractStatement.java:142)
               * org.evosuite.testcase.MethodStatement.execute(MethodStatement.java:217)
               * org.evosuite.testcase.TestRunnable.call(TestRunnable.java:291)
               * org.evosuite.testcase.TestRunnable.call(TestRunnable.java:44)
               * java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
               * java.util.concurrent.FutureTask.run(FutureTask.java:138)
               * java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
               * java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
               * java.lang.Thread.run(Thread.java:662)
               */
            }
          } catch(Throwable t) {
              // Need to catch declared exceptions
          }
        } 
      }); 
      future.get(6000, TimeUnit.MILLISECONDS); 
    }
  
    //Test case number: 9
    /*
     * 1 covered goal:
     * 1 com.lts.io.archive.ZipArchive.getZipEntry(Ljava/lang/String;)Ljava/util/zip/ZipEntry;: I6 Branch 12 IFLE L202 - true
     */
    @Test
    public void test9()  throws Throwable  {
        ZipArchive zipArchive0 = new ZipArchive("");
        try {
          zipArchive0.getEntrySize("");
          fail("Expecting exception: LTSException");
        } catch(LTSException e) {
          /*
           * Error trying to get zip entry for , from archive, 
           */
        }
    }
  
    //Test case number: 10
    /*
     * 1 covered goal:
     * 1 com.lts.io.archive.ZipArchive.getZipEntry(Ljava/lang/String;)Ljava/util/zip/ZipEntry;: I6 Branch 12 IFLE L202 - false
     */
    @Test
    public void test10()  throws Throwable  {
        ZipArchive zipArchive0 = new ZipArchive("/Create");
        try {
          zipArchive0.getEntrySize("/Create");
          fail("Expecting exception: LTSException");
        } catch(LTSException e) {
          /*
           * Error trying to get zip entry for Create, from archive, /Create
           */
        }
    }
  
    //Test case number: 11
    /*
     * 1 covered goal:
     * 1 com.lts.io.archive.ZipArchive.basicGet(Ljava/lang/String;)Ljava/io/InputStream;: I6 Branch 13 IFLE L240 - true
     */
    @Test
    public void test11()  throws Throwable  {
        ZipArchive zipArchive0 = new ZipArchive();
        // Undeclared exception!
        try {
          zipArchive0.basicGet("");
          fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        }
    }
  
    //Test case number: 12
    /*
     * 1 covered goal:
     * 1 com.lts.io.archive.ZipArchive.basicGet(Ljava/lang/String;)Ljava/io/InputStream;: I6 Branch 13 IFLE L240 - false
     */
    @Test
    public void test12()  throws Throwable  {
        ZipArchive zipArchive0 = new ZipArchive();
        // Undeclared exception!
        try {
          zipArchive0.basicGet("/CreaLe");
          fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        }
    }
  
    //Test case number: 13
    /*
     * 2 covered goals:
     * 1 com.lts.io.archive.ZipArchive.closeNoExceptions(Ljava/io/InputStream;)V: I4 Branch 18 IF_ACMPNE L351 - true
     * 2 com.lts.io.archive.ZipArchive.<init>(Ljava/io/File;)V: root-Branch
     */
    @Test
    public void test13()  throws Throwable  {
        ImprovedFile improvedFile0 = new ImprovedFile("]k]+OR6t", "]k]+OR6t");
        ZipArchive zipArchive0 = new ZipArchive((File) improvedFile0);
        BufferedInputStream bufferedInputStream0 = new BufferedInputStream((InputStream) null);
        DataInputStream dataInputStream0 = new DataInputStream((InputStream) bufferedInputStream0);
        zipArchive0.closeNoExceptions((InputStream) dataInputStream0);
        assertEquals(true, zipArchive0.getCreateBackups());
        assertEquals("]k]+OR6t/]k]+OR6t", zipArchive0.toString());
    }
  
    //Test case number: 14
    /*
     * 1 covered goal:
     * 1 com.lts.io.archive.ZipArchive.closeNoExceptions(Ljava/io/OutputStream;)V: I4 Branch 19 IF_ACMPNE L364 - true
     */
    @Test
    public void test14()  throws Throwable  {
        ZipArchive zipArchive0 = new ZipArchive();
        ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream(1821);
        PrintStream printStream0 = new PrintStream((OutputStream) byteArrayOutputStream0, true);
        zipArchive0.closeNoExceptions((OutputStream) printStream0);
        assertEquals(false, zipArchive0.archiveHasBeenExtracted());
    }
  
    //Test case number: 15
    /*
     * 2 covered goals:
     * 1 com.lts.io.archive.ZipArchive.enumToList(Ljava/util/Enumeration;)Ljava/util/List;: I10 Branch 21 IFEQ L415 - true
     * 2 com.lts.io.archive.ZipArchive.<init>()V: root-Branch
     */
    @Test
    public void test15()  throws Throwable  {
        ZipArchive zipArchive0 = new ZipArchive();
        Properties properties0 = new Properties();
        Enumeration<Object> enumeration0 = properties0.keys();
        List<Object> list0 = zipArchive0.enumToList(enumeration0);
        assertEquals(0, list0.size());
    }
  
    //Test case number: 16
    /*
     * 1 covered goal:
     * 1 com.lts.io.archive.ZipArchive.enumToList(Ljava/util/Enumeration;)Ljava/util/List;: I10 Branch 21 IFEQ L415 - false
     */
    @Test
    public void test16()  throws Throwable  {
        ZipArchive zipArchive0 = new ZipArchive("dwpO#^gTA1bf/`3o8T");
        StringTokenizer stringTokenizer0 = new StringTokenizer("dwpO#^gTA1bf/`3o8T");
        // Undeclared exception!
        List<Object> list0 = null;
        try {
          list0 = zipArchive0.enumToList((Enumeration) stringTokenizer0);
          fail("Expecting exception: ClassCastException");
        } catch(ClassCastException e) {
          /*
           * java.lang.String cannot be cast to java.util.zip.ZipEntry
           */
        }
        assertEquals(true, zipArchive0.createBackups());
        assertEquals("dwpO#^gTA1bf/`3o8T", zipArchive0.toString());
    }
  
    //Test case number: 17
    /*
     * 2 covered goals:
     * 1 com.lts.io.archive.ZipArchive.createArchive()V: I5 Branch 24 IFEQ L461 - true
     * 2 com.lts.io.archive.ZipArchive.<init>(Ljava/lang/String;)V: root-Branch
     */
    @Test
    public void test17()  throws Throwable  {
      Future<?> future = executor.submit(new Runnable(){ 
              public void run() { 
          try {
            ZipArchive zipArchive0 = new ZipArchive("+%GIfX*Te");
            // Undeclared exception!
            try {
              zipArchive0.createArchive();
              fail("Expecting exception: SecurityException");
            } catch(SecurityException e) {
              /*
               * Security manager blocks (java.io.FilePermission +%GIfX*Te write)
               * java.lang.Thread.getStackTrace(Thread.java:1479)
               * org.evosuite.sandbox.MSecurityManager.checkPermission(MSecurityManager.java:303)
               * java.lang.SecurityManager.checkWrite(SecurityManager.java:962)
               * java.io.FileOutputStream.<init>(FileOutputStream.java:183)
               * java.io.FileOutputStream.<init>(FileOutputStream.java:145)
               * com.lts.io.archive.ZipArchive.createArchive(ZipArchive.java:469)
               * sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
               * sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
               * sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
               * java.lang.reflect.Method.invoke(Method.java:597)
               * org.evosuite.testcase.MethodStatement$1.execute(MethodStatement.java:262)
               * org.evosuite.testcase.AbstractStatement.exceptionHandler(AbstractStatement.java:142)
               * org.evosuite.testcase.MethodStatement.execute(MethodStatement.java:217)
               * org.evosuite.testcase.TestRunnable.call(TestRunnable.java:291)
               * org.evosuite.testcase.TestRunnable.call(TestRunnable.java:44)
               * java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
               * java.util.concurrent.FutureTask.run(FutureTask.java:138)
               * java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
               * java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
               * java.lang.Thread.run(Thread.java:662)
               */
            }
          } catch(Throwable t) {
              // Need to catch declared exceptions
          }
        } 
      }); 
      future.get(6000, TimeUnit.MILLISECONDS); 
    }
  }
  