2 * Scaffolding file used to store all the setups needed to run
3 * tests automatically generated by EvoSuite
4 * Fri Nov 25 13:37:00 GMT 2016
7 package org.openecomp.mso.asdc.installer;
9 import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
10 import org.junit.BeforeClass;
11 import org.junit.Before;
12 import org.junit.After;
13 import org.junit.AfterClass;
14 import org.evosuite.runtime.sandbox.Sandbox;
17 public class VfModuleStructureESTestscaffolding {
20 public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
22 private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
24 private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
27 public static void initEvoSuiteFramework() {
28 org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.asdc.installer.VfModuleStructure";
29 org.evosuite.runtime.GuiSupport.initialize();
30 org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
31 org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
32 org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
33 org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
34 org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
35 org.evosuite.runtime.classhandling.JDKClassResetter.init();
37 org.evosuite.runtime.Runtime.getInstance().resetRuntime();
41 public static void clearEvoSuiteFramework(){
42 Sandbox.resetDefaultSecurityManager();
43 java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
47 public void initTestCase(){
48 threadStopper.storeCurrentThreads();
49 threadStopper.startRecordingTime();
50 org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
51 org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
53 org.evosuite.runtime.GuiSupport.setHeadless();
54 org.evosuite.runtime.Runtime.getInstance().resetRuntime();
55 org.evosuite.runtime.agent.InstrumentingAgent.activate();
59 public void doneWithTestCase(){
60 threadStopper.killAndJoinClientThreads();
61 org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
62 org.evosuite.runtime.classhandling.JDKClassResetter.reset();
64 org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
65 org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
66 org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
69 private static void initializeClasses() {
70 org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(VfModuleStructureESTestscaffolding.class.getClassLoader() ,
71 "org.openecomp.sdc.api.IDistributionClient",
72 "org.openecomp.mso.db.catalog.utils.MavenLikeVersioning",
73 "org.openecomp.mso.asdc.installer.VfResourceStructure",
74 "org.openecomp.mso.asdc.client.exceptions.ArtifactInstallerException",
75 "org.openecomp.mso.db.catalog.beans.VnfResource",
76 "org.openecomp.sdc.api.notification.IVfModuleMetadata",
77 "org.openecomp.mso.db.catalog.beans.VfModule",
78 "org.openecomp.sdc.api.results.IDistributionClientResult",
79 "org.openecomp.sdc.api.notification.IArtifactInfo",
80 "org.openecomp.mso.db.catalog.beans.Service",
81 "org.openecomp.mso.asdc.installer.VfModuleStructure",
82 "org.openecomp.sdc.api.notification.INotificationData",
83 "org.openecomp.mso.asdc.installer.VfModuleArtifact",
84 "org.openecomp.sdc.api.notification.IResourceInstance",
85 "org.openecomp.sdc.api.results.IDistributionClientDownloadResult"
89 private static void resetClasses() {
90 org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(VfModuleStructureESTestscaffolding.class.getClassLoader());
92 org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
93 "org.openecomp.mso.asdc.client.exceptions.ArtifactInstallerException"