Skip to content
This repository was archived by the owner on Jun 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions src/evosuitetests/java/MakeItFit/Main_ESTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* This file was automatically generated by EvoSuite
* Wed Jun 04 20:34:16 GMT 2025
*/

package MakeItFit;

import java.util.NoSuchElementException;

import MakeItFit.Main;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.util.SystemInUtil;
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.evosuite.runtime.EvoAssertions.*;
import static org.junit.Assert.*;

@RunWith(EvoRunner.class)
@EvoRunnerParameters(mockJVMNonDeterminism = true,
useVFS = true,
useVNET = true,
resetStaticState = true,
useJEE = true)
public class Main_ESTest extends Main_ESTest_scaffolding {

@Test(timeout = 4000)
public void test0() throws Throwable {
SystemInUtil.addInputLine("4");
String[] stringArray0 = new String[1];
Main.main(stringArray0);
assertEquals(1, stringArray0.length);
}

@Test(timeout = 4000)
public void test1() throws Throwable {
Main main0 = new Main();
}

@Test(timeout = 4000)
public void test2() throws Throwable {
String[] stringArray0 = new String[1];
// Undeclared exception!
try {
Main.main(stringArray0);
fail("Expecting exception: NoSuchElementException");

} catch (NoSuchElementException e) {
//
// No line found
//
verifyException("java.util.Scanner", e);
}
}
}
166 changes: 166 additions & 0 deletions src/evosuitetests/java/MakeItFit/Main_ESTest_scaffolding.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
/**
* Scaffolding file used to store all the setups needed to run
* tests automatically generated by EvoSuite
* Wed Jun 04 20:34:16 GMT 2025
*/

package MakeItFit;

import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
import org.evosuite.runtime.sandbox.Sandbox;
import org.evosuite.runtime.sandbox.Sandbox.SandboxMode;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;

@EvoSuiteClassExclude
public class Main_ESTest_scaffolding {

@org.junit.Rule
public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr =
new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();

private static final java.util.Properties defaultProperties =
(java.util.Properties) java.lang.System.getProperties().clone();

private org.evosuite.runtime.thread.ThreadStopper threadStopper =
new org.evosuite.runtime.thread.ThreadStopper(
org.evosuite.runtime.thread.KillSwitchHandler.getInstance(),
3000);

@BeforeClass
public static void initEvoSuiteFramework() {
org.evosuite.runtime.RuntimeSettings.className = "MakeItFit.Main";
org.evosuite.runtime.GuiSupport.initialize();
org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
org.evosuite.runtime.RuntimeSettings.sandboxMode =
org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
org.evosuite.runtime.classhandling.JDKClassResetter.init();
setSystemProperties();
initializeClasses();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
}

@AfterClass
public static void clearEvoSuiteFramework() {
Sandbox.resetDefaultSecurityManager();
java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
}

@Before
public void initTestCase() {
threadStopper.storeCurrentThreads();
threadStopper.startRecordingTime();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
setSystemProperties();
org.evosuite.runtime.GuiSupport.setHeadless();
org.evosuite.runtime.Runtime.getInstance().resetRuntime();
org.evosuite.runtime.agent.InstrumentingAgent.activate();
org.evosuite.runtime.util.SystemInUtil.getInstance().initForTestCase();
}

@After
public void doneWithTestCase() {
threadStopper.killAndJoinClientThreads();
org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
org.evosuite.runtime.classhandling.JDKClassResetter.reset();
resetClasses();
org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
}

public static void setSystemProperties() {

java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
java.lang.System.setProperty("file.encoding", "UTF-8");
java.lang.System.setProperty("java.awt.headless", "true");
java.lang.System.setProperty("java.io.tmpdir", "/tmp");
java.lang.System.setProperty("user.country", "US");
java.lang.System.setProperty("user.dir", "/home/voidbert/ATS");
java.lang.System.setProperty("user.home", "/home/voidbert");
java.lang.System.setProperty("user.language", "en");
java.lang.System.setProperty("user.name", "voidbert");
java.lang.System.setProperty("user.timezone", "Europe/Lisbon");
}

private static void initializeClasses() {
org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(
Main_ESTest_scaffolding.class.getClassLoader(),
"MakeItFit.exceptions.InvalidTypeException",
"MakeItFit.views.MakeItFitView",
"MakeItFit.activities.ActivityInterface",
"MakeItFit.activities.types.DistanceWithAltimetry",
"MakeItFit.trainingPlan.TrainingPlan",
"MakeItFit.views.AdminView",
"MakeItFit.exceptions.EntityDoesNotExistException",
"MakeItFit.activities.implementation.PushUp",
"MakeItFit.users.types.Amateur",
"MakeItFit.queries.QueriesManager",
"MakeItFit.activities.types.Repetitions",
"MakeItFit.menu.MenuItem$PreCondition",
"MakeItFit.queries.MostDemandingTrainingPlan",
"MakeItFit.activities.types.Distance",
"MakeItFit.users.User",
"MakeItFit.MakeItFitController",
"MakeItFit.activities.HardInterface",
"MakeItFit.menu.Menu",
"MakeItFit.users.types.Professional",
"MakeItFit.MakeItFitApplication",
"MakeItFit.menu.MenuItem",
"MakeItFit.MakeItFit",
"MakeItFit.users.UserInterface",
"MakeItFit.users.Gender",
"MakeItFit.trainingPlan.TrainingPlanManager",
"MakeItFit.utils.MakeItFitDate",
"MakeItFit.menu.MenuItem$Handler",
"MakeItFit.exceptions.ExistingEntityConflictException",
"MakeItFit.Main",
"MakeItFit.queries.WhoDidTheMostActivities",
"MakeItFit.users.types.Occasional",
"MakeItFit.activities.Activity",
"MakeItFit.queries.MostDoneActivity",
"MakeItFit.activities.types.RepetitionsWithWeights",
"MakeItFit.activities.implementation.Trail",
"MakeItFit.queries.WhoBurnsMoreCalories",
"MakeItFit.time.TimeManager",
"MakeItFit.views.UserView",
"MakeItFit.queries.HowManyKMsDone",
"MakeItFit.users.UserManager",
"MakeItFit.activities.implementation.Running",
"MakeItFit.queries.HowManyAltimetryDone",
"MakeItFit.activities.implementation.WeightSquat");
}

private static void resetClasses() {
org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(
Main_ESTest_scaffolding.class.getClassLoader());

org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
"MakeItFit.Main",
"MakeItFit.MakeItFitApplication",
"MakeItFit.views.MakeItFitView",
"MakeItFit.views.UserView",
"MakeItFit.MakeItFitController",
"MakeItFit.MakeItFit",
"MakeItFit.users.UserManager",
"MakeItFit.trainingPlan.TrainingPlanManager",
"MakeItFit.queries.QueriesManager",
"MakeItFit.queries.HowManyAltimetryDone",
"MakeItFit.queries.HowManyKMsDone",
"MakeItFit.queries.MostDoneActivity",
"MakeItFit.queries.MostDemandingTrainingPlan",
"MakeItFit.queries.WhoBurnsMoreCalories",
"MakeItFit.queries.WhoDidTheMostActivities",
"MakeItFit.time.TimeManager",
"MakeItFit.utils.MakeItFitDate",
"MakeItFit.views.AdminView",
"MakeItFit.menu.MenuItem",
"MakeItFit.menu.Menu");
}
}
105 changes: 105 additions & 0 deletions src/evosuitetests/java/MakeItFit/MakeItFitApplication_ESTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/*
* This file was automatically generated by EvoSuite
* Wed Jun 04 19:55:27 GMT 2025
*/

package MakeItFit;

import java.util.NoSuchElementException;

import MakeItFit.MakeItFitApplication;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.util.SystemInUtil;
import org.junit.Test;
import org.junit.runner.RunWith;

import static org.evosuite.runtime.EvoAssertions.*;
import static org.junit.Assert.*;

@RunWith(EvoRunner.class)
@EvoRunnerParameters(mockJVMNonDeterminism = true,
useVFS = true,
useVNET = true,
resetStaticState = true,
useJEE = true)
public class MakeItFitApplication_ESTest extends MakeItFitApplication_ESTest_scaffolding {

@Test(timeout = 4000)
public void test0() throws Throwable {
SystemInUtil.addInputLine("4");
MakeItFitApplication makeItFitApplication0 = new MakeItFitApplication();
makeItFitApplication0.init();
makeItFitApplication0.start();
}

@Test(timeout = 4000)
public void test1() throws Throwable {
SystemInUtil.addInputLine("1");
MakeItFitApplication makeItFitApplication0 = new MakeItFitApplication();
makeItFitApplication0.init();
// Undeclared exception!
try {
makeItFitApplication0.start();
fail("Expecting exception: NoSuchElementException");

} catch (NoSuchElementException e) {
//
// No line found
//
verifyException("java.util.Scanner", e);
}
}

@Test(timeout = 4000)
public void test2() throws Throwable {
MakeItFitApplication makeItFitApplication0 = new MakeItFitApplication();
// Undeclared exception!
try {
makeItFitApplication0.start();
fail("Expecting exception: NullPointerException");

} catch (NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("MakeItFit.MakeItFitApplication", e);
}
}

@Test(timeout = 4000)
public void test3() throws Throwable {
SystemInUtil.addInputLine("2");
MakeItFitApplication makeItFitApplication0 = new MakeItFitApplication();
makeItFitApplication0.init();
// Undeclared exception!
try {
makeItFitApplication0.start();
fail("Expecting exception: NoSuchElementException");

} catch (NoSuchElementException e) {
//
// No line found
//
verifyException("java.util.Scanner", e);
}
}

@Test(timeout = 4000)
public void test4() throws Throwable {
SystemInUtil.addInputLine("03");
MakeItFitApplication makeItFitApplication0 = new MakeItFitApplication();
makeItFitApplication0.init();
// Undeclared exception!
try {
makeItFitApplication0.start();
fail("Expecting exception: NoSuchElementException");

} catch (NoSuchElementException e) {
//
// No line found
//
verifyException("java.util.Scanner", e);
}
}
}
Loading