content: /*
   * This file was automatically generated by EvoSuite
   */
  
  package com.lts.util;
  
  import org.junit.Test;
  import org.junit.runner.RunWith;
  import org.evosuite.junit.EvoSuiteRunner;
  import static org.junit.Assert.*;
  import com.lts.util.ProcessUtils;
  import java.io.File;
  import java.io.IOException;
  import java.nio.CharBuffer;
  import java.util.Map;
  import java.util.Properties;
  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 ProcessUtilsEvoSuiteTest {
  
    private static ExecutorService executor; 
  
    @BeforeClass 
    public static void initEvoSuiteFramework(){ 
      org.evosuite.Properties.REPLACE_CALLS = true; 
      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
    public void test0()  throws Throwable  {
        // Undeclared exception!
        try {
          ProcessUtils.buildJNI("TA.R|&`u9&5j3JWf4\"N", "TA.R|&`u9&5j3JWf4\"N", "TA.R|&`u9&5j3JWf4\"N");
          fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        }
    }
  
    @Test
    public void test1()  throws Throwable  {
      Future<?> future = executor.submit(new Runnable(){ 
              public void run() { 
          try {
            // Undeclared exception!
            try {
              ProcessUtils.java("child, ", "child, ");
              fail("Expecting exception: SecurityException");
            } catch(SecurityException e) {
              /*
               * Security manager blocks (java.io.FilePermission <<ALL FILES>> execute)
               * java.lang.Thread.getStackTrace(Thread.java:1479)
               * org.evosuite.sandbox.MSecurityManager.checkPermission(MSecurityManager.java:303)
               * java.lang.SecurityManager.checkExec(SecurityManager.java:782)
               * java.lang.ProcessBuilder.start(ProcessBuilder.java:448)
               * java.lang.Runtime.exec(Runtime.java:593)
               * com.lts.util.ProcessUtils.java(ProcessUtils.java:128)
               * com.lts.util.ProcessUtils.java(ProcessUtils.java:155)
               * sun.reflect.GeneratedMethodAccessor45.invoke(Unknown Source)
               * 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
    public void test2()  throws Throwable  {
        String[] stringArray0 = new String[3];
        Properties properties0 = new Properties();
        File file0 = new File((String) null, "M");
        // Undeclared exception!
        try {
          ProcessUtils.buildJNI(stringArray0, properties0, file0);
          fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        }
    }
  
    @Test
    public void test3()  throws Throwable  {
        Class<?> class0 = CharBuffer.class;
        Thread thread0 = ProcessUtils.thread("TA.R|&`u9&5j3JWf4\"N", (Class) class0, "TA.R|&`u9&5j3JWf4\"N");
        assertNotNull(thread0);
        assertEquals(3216L, thread0.getId());
    }
  
    @Test
    public void test4()  throws Throwable  {
        // Undeclared exception!
        try {
          ProcessUtils.buildEnvArray();
          fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        }
    }
  
    @Test
    public void test5()  throws Throwable  {
        // Undeclared exception!
        try {
          ProcessUtils.JavaJNI("", "", "");
          fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        }
    }
  
    @Test
    public void test6()  throws Throwable  {
        String[] stringArray0 = new String[16];
        Properties properties0 = new Properties();
        File file0 = new File((String) null, "");
        // Undeclared exception!
        try {
          ProcessUtils.java("", stringArray0, properties0, file0);
          fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        }
    }
  
    @Test
    public void test7()  throws Throwable  {
        ProcessUtils processUtils0 = new ProcessUtils();
        assertEquals("/usr/local/packages/java/jdk1.6.0_29/jre\\bin;null\\SYSTEM32;null", processUtils0.minimalPath());
    }
  
    @Test
    public void test8()  throws Throwable  {
        String[] stringArray0 = new String[5];
        ProcessUtils.printEnv(stringArray0);
    }
  
    @Test
    public void test9()  throws Throwable  {
        // Undeclared exception!
        try {
          ProcessUtils.JavaJNI((String) null, (String) null, (String) null);
          fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        }
    }
  
    @Test
    public void test10()  throws Throwable  {
        Properties properties0 = new Properties();
        properties0.setProperty("TA.R|&`u9&5j3JWf4\"N", "TA.R|&`u9&5j3JWf4\"N");
        ProcessUtils.updateEnvironment((Map) properties0, properties0);
        assertEquals("{TA.R|&`u9&5j3JWf4\"N=TA.R|&`u9&5j3JWf4\"N}", properties0.toString());
        assertEquals(1, properties0.size());
    }
  }
  