@BeforeClass public static void initEvoSuiteFramework() { org.evosuite.runtime.RuntimeSettings.className = "com.examples.with.different.packagename.Euclidean"; 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(); initializeClasses(); org.evosuite.runtime.Runtime.getInstance().resetRuntime(); }
@Test public void testReset() throws Exception { JDKClassResetter.init(); int keyValue = 1234567; //this should be fine FooKey first = new FooKey(keyValue); try{ FooKey copy = new FooKey(keyValue); fail(); } catch(Exception e){ //expected, as cannot make a copy } JDKClassResetter.reset(); //after reset, copy should be fine FooKey copy = new FooKey(keyValue); } }
setupRuntimeProperties(); handleShadingSpecialCases(); JDKClassResetter.init(); Sandbox.setCheckForInitialization(Properties.SANDBOX); MockFramework.enable();