48e800ff5bf911b8c16509ee4b5f03402b484dc1
[so.git] / adapters / mso-adapter-utils / src / test / java / org / openecomp / mso / cloud / CloudSiteESTestscaffolding.java
1 /**
2  * Scaffolding file used to store all the setups needed to run 
3  * tests automatically generated by EvoSuite
4  * Mon Nov 14 08:42:36 GMT 2016
5  */
6
7 package org.openecomp.mso.cloud;
8
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;
15
16 @EvoSuiteClassExclude
17 public class CloudSiteESTestscaffolding {
18
19   @org.junit.Rule 
20   public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
21
22   private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); 
23
24   private org.evosuite.runtime.thread.ThreadStopper threadStopper =  new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
25
26   @BeforeClass 
27   public static void initEvoSuiteFramework() { 
28     org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.cloud.CloudSite"; 
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(); 
36     initializeClasses();
37     org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 
38   } 
39
40   @AfterClass 
41   public static void clearEvoSuiteFramework(){ 
42     Sandbox.resetDefaultSecurityManager(); 
43     java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); 
44   } 
45
46   @Before 
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(); 
52      
53     org.evosuite.runtime.GuiSupport.setHeadless(); 
54     org.evosuite.runtime.Runtime.getInstance().resetRuntime(); 
55     org.evosuite.runtime.agent.InstrumentingAgent.activate(); 
56   } 
57
58   @After 
59   public void doneWithTestCase(){ 
60     threadStopper.killAndJoinClientThreads();
61     org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); 
62     org.evosuite.runtime.classhandling.JDKClassResetter.reset(); 
63     resetClasses(); 
64     org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); 
65     org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); 
66     org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); 
67   } 
68
69
70   private static void initializeClasses() {
71     org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(CloudSiteESTestscaffolding.class.getClassLoader() ,
72       "org.openecomp.mso.logger.MsoLogger",
73       "org.openecomp.mso.logger.MessageEnum",
74       "com.att.eelf.i18n.EELFResolvableErrorEnum",
75       "org.openecomp.mso.logger.MsoLogger$ResponseCode",
76       "org.openecomp.mso.entity.MsoRequest",
77       "org.openecomp.mso.cloud.CloudSite",
78       "org.openecomp.mso.logger.MsoLogger$StatusCode",
79       "com.att.eelf.i18n.EELFResourceManager$RESOURCE_TYPES",
80       "com.att.eelf.configuration.EELFManager",
81       "org.openecomp.mso.cloud.CloudIdentity$IdentityServerType",
82       "org.openecomp.mso.logger.MsoLogger$ErrorCode",
83       "com.att.eelf.configuration.EELFLogger",
84       "com.att.eelf.i18n.EELFMsgs",
85       "org.openecomp.mso.openstack.exceptions.MsoException",
86       "com.att.eelf.configuration.EELFLogger$Level",
87       "org.openecomp.mso.logger.MsoLogger$Catalog",
88       "com.att.eelf.configuration.SLF4jWrapper",
89       "com.att.eelf.i18n.EELFResourceManager",
90       "org.openecomp.mso.cloud.CloudIdentity"
91     );
92   } 
93
94   private static void resetClasses() {
95     org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(CloudSiteESTestscaffolding.class.getClassLoader());
96
97     org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
98       "org.openecomp.mso.logger.MsoLogger$Catalog",
99       "org.openecomp.mso.logger.MsoLogger",
100       "com.att.eelf.i18n.EELFResourceManager",
101       "com.att.eelf.i18n.EELFMsgs",
102       "com.att.eelf.i18n.EELFResourceManager$RESOURCE_TYPES",
103       "org.apache.xerces.jaxp.SAXParserFactoryImpl",
104       "org.apache.xerces.jaxp.SAXParserImpl",
105       "org.apache.xerces.parsers.XMLParser",
106       "org.apache.xerces.parsers.AbstractSAXParser",
107       "org.apache.xerces.parsers.SAXParser",
108       "org.apache.xerces.parsers.ObjectFactory",
109       "org.apache.xerces.util.ParserConfigurationSettings",
110       "org.apache.xerces.parsers.XML11Configuration",
111       "org.apache.xerces.parsers.XIncludeAwareParserConfiguration",
112       "org.apache.xerces.util.SymbolTable",
113       "org.apache.xerces.impl.XMLEntityManager",
114       "org.apache.xerces.util.AugmentationsImpl$SmallContainer",
115       "org.apache.xerces.impl.XMLEntityManager$ByteBufferPool",
116       "org.apache.xerces.impl.XMLEntityManager$CharacterBufferPool",
117       "org.apache.xerces.impl.XMLEntityScanner$1",
118       "org.apache.xerces.impl.XMLEntityScanner",
119       "org.apache.xerces.impl.XMLErrorReporter",
120       "org.apache.xerces.impl.XMLScanner",
121       "org.apache.xerces.impl.XMLDocumentFragmentScannerImpl",
122       "org.apache.xerces.impl.XMLDocumentScannerImpl",
123       "org.apache.xerces.util.XMLStringBuffer",
124       "org.apache.xerces.util.XMLAttributesImpl",
125       "org.apache.xerces.impl.XMLDTDScannerImpl",
126       "org.apache.xerces.impl.dtd.XMLDTDProcessor",
127       "org.apache.xerces.impl.dtd.XMLDTDValidator",
128       "org.apache.xerces.impl.validation.ValidationState",
129       "org.apache.xerces.impl.dtd.XMLElementDecl",
130       "org.apache.xerces.impl.dtd.XMLSimpleType",
131       "org.apache.xerces.impl.dv.DTDDVFactory",
132       "org.apache.xerces.impl.dv.ObjectFactory",
133       "org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl",
134       "org.apache.xerces.impl.XMLVersionDetector",
135       "org.apache.xerces.impl.msg.XMLMessageFormatter",
136       "org.apache.xerces.impl.io.UTF8Reader",
137       "org.apache.xerces.util.XMLSymbols",
138       "org.apache.xerces.xni.NamespaceContext",
139       "org.apache.xerces.util.XMLChar",
140       "org.apache.xerces.impl.Constants",
141       "com.att.eelf.configuration.EELFLogger$Level",
142       "com.att.eelf.configuration.EELFManager",
143       "org.openecomp.mso.logger.MessageEnum",
144       "org.openecomp.mso.cloud.CloudIdentity",
145       "org.openecomp.mso.utils.CryptoUtils",
146       "org.openecomp.mso.logger.MsoAlarmLogger",
147       "org.openecomp.mso.openstack.utils.MsoCommonUtils"
148     );
149   }
150 }