content: /*
   * This file was automatically generated by EvoSuite
   */
  
  package com.lts.caloriecount.app;
  
  import org.junit.Test;
  import org.junit.runner.RunWith;
  import org.evosuite.junit.EvoSuiteRunner;
  import static org.junit.Assert.*;
  import com.lts.application.ApplicationException;
  import com.lts.application.ApplicationTerminateException;
  import com.lts.caloriecount.app.CalorieCount;
  import com.lts.caloriecount.app.CalorieCountProperties;
  import com.lts.caloriecount.data.CalorieCountData;
  import com.lts.caloriecount.data.food.Food;
  import com.lts.caloriecount.data.frequent.FrequentFood;
  import com.lts.caloriecount.data.frequent.FrequentFoodList;
  import com.lts.caloriecount.ui.gatherwin.GatherUIThread;
  import com.lts.pest.Pest;
  import java.awt.HeadlessException;
  import java.io.File;
  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 CalorieCountEvoSuiteTest {
  
    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  {
        CalorieCount calorieCount0 = (CalorieCount)Pest.getApp();
        // Undeclared exception!
        try {
          calorieCount0.startApplication();
          fail("Expecting exception: HeadlessException");
        } catch(HeadlessException e) {
        }
    }
  
    @Test
    public void test1()  throws Throwable  {
      Future<?> future = executor.submit(new Runnable(){ 
              public void run() { 
          try {
            CalorieCount calorieCount0 = (CalorieCount)Pest.getApp();
            // Undeclared exception!
            try {
              calorieCount0.createRepository((File) null, (File) null);
              fail("Expecting exception: SecurityException");
            } catch(SecurityException e) {
              /*
               * Security manager blocks (java.io.FilePermission /tmp/cc_temp_data8382816635835581374.tmp 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)
               * java.io.File.createTempFile(File.java:1828)
               * com.lts.caloriecount.data.SingleFileRepository.initialize(SingleFileRepository.java:58)
               * com.lts.caloriecount.data.SingleFileRepository.<init>(SingleFileRepository.java:49)
               * com.lts.caloriecount.data.CalorieCountRepository.<init>(CalorieCountRepository.java:12)
               * com.lts.caloriecount.app.CalorieCount.createRepository(CalorieCount.java:154)
               * 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
    public void test2()  throws Throwable  {
        CalorieCount calorieCount0 = (CalorieCount)Pest.getApp();
        FrequentFood frequentFood0 = new FrequentFood();
        // Undeclared exception!
        try {
          calorieCount0.createMeal(frequentFood0);
          fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        }
    }
  
    @Test
    public void test3()  throws Throwable  {
        CalorieCount calorieCount0 = new CalorieCount();
        calorieCount0.getUIThread();
        assertEquals("caloriecount.txt", calorieCount0.getShortPropertyFileName());
        assertEquals("CalorieCount", calorieCount0.getTempFilePrefix());
    }
  
    @Test
    public void test4()  throws Throwable  {
        // Undeclared exception!
        try {
          CalorieCount.getMeals();
          fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        }
    }
  
    @Test
    public void test5()  throws Throwable  {
        CalorieCountProperties calorieCountProperties0 = CalorieCount.getProps();
        assertEquals("{}", calorieCountProperties0.toString());
    }
  
    @Test
    public void test6()  throws Throwable  {
        CalorieCount calorieCount0 = new CalorieCount();
        calorieCount0.setUIThread((GatherUIThread) null);
        assertEquals("caloriecount.txt", calorieCount0.getShortPropertyFileName());
        assertEquals("CalorieCount", calorieCount0.getApplicationName());
    }
  
    @Test
    public void test7()  throws Throwable  {
        // Undeclared exception!
        try {
          CalorieCount.setData((CalorieCountData) null);
          fail("Expecting exception: NullPointerException");
        } catch(NullPointerException e) {
        }
    }
  
    @Test
    public void test8()  throws Throwable  {
        CalorieCount calorieCount0 = new CalorieCount();
        CalorieCountData calorieCountData0 = (CalorieCountData)calorieCount0.createApplicationData();
        assertEquals("caloriecount.txt", calorieCount0.getShortPropertyFileName());
        assertNotNull(calorieCountData0);
        assertEquals("CalorieCount", calorieCount0.getApplicationName());
    }
  
    @Test
    public void test9()  throws Throwable  {
        CalorieCount calorieCount0 = (CalorieCount)Pest.getApp();
        calorieCount0.wasRecording();
        FrequentFoodList frequentFoodList0 = new FrequentFoodList();
        calorieCount0.loadApplicationProperties();
        Food food0 = new Food(0);
        frequentFoodList0.getEntryForFood(food0);
        Pest.getApp();
        calorieCount0.dataIsDirty();
        FrequentFood frequentFood0 = new FrequentFood();
        assertEquals(0, frequentFood0.getId());
    }
  }
  