59f09a0bc9a68530cd3c1f8962cea9aa7890f8f2
[so.git] / bpmn / MSORESTClient / src / test / java / org / openecomp / mso / rest / APIResponseESTestscaffolding.java
1 /**
2  * Scaffolding file used to store all the setups needed to run 
3  * tests automatically generated by EvoSuite
4  * Mon Nov 14 11:46:25 GMT 2016
5  */
6
7 package org.openecomp.mso.rest;
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 APIResponseESTestscaffolding {
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.rest.APIResponse"; 
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(APIResponseESTestscaffolding.class.getClassLoader() ,
72       "org.apache.http.HttpVersion",
73       "org.apache.http.message.BasicNameValuePair",
74       "org.apache.http.message.HeaderGroup",
75       "org.apache.http.message.HeaderValueParser",
76       "org.apache.http.message.BasicStatusLine",
77       "org.apache.http.message.BasicHeaderValueParser",
78       "org.apache.http.message.BasicLineFormatter",
79       "org.apache.http.entity.ByteArrayEntity",
80       "org.apache.http.Header",
81       "org.apache.http.StatusLine",
82       "org.apache.http.util.EntityUtils",
83       "org.apache.http.message.BasicHttpResponse",
84       "org.apache.http.FormattedHeader",
85       "org.apache.http.RequestLine",
86       "org.apache.http.HttpMessage",
87       "org.apache.http.message.AbstractHttpMessage",
88       "org.apache.http.Consts",
89       "org.apache.http.protocol.HTTP",
90       "org.apache.http.util.ByteArrayBuffer",
91       "org.apache.http.ParseException",
92       "org.apache.http.HeaderIterator",
93       "org.apache.http.entity.AbstractHttpEntity",
94       "org.openecomp.mso.rest.RESTException",
95       "org.apache.http.util.Args",
96       "org.apache.http.ReasonPhraseCatalog",
97       "org.apache.http.HttpEntity",
98       "org.apache.http.entity.ContentType",
99       "org.apache.http.message.LineFormatter",
100       "org.apache.http.entity.StringEntity",
101       "org.openecomp.mso.rest.HttpHeader",
102       "org.apache.http.HeaderElement",
103       "org.apache.http.message.BufferedHeader",
104       "org.openecomp.mso.rest.APIResponse",
105       "org.apache.http.util.CharArrayBuffer",
106       "org.apache.http.ProtocolVersion",
107       "org.apache.http.util.TextUtils",
108       "org.apache.http.impl.EnglishReasonPhraseCatalog",
109       "org.apache.http.params.HttpParams",
110       "org.apache.http.message.BasicHeader",
111       "org.apache.http.HttpResponse",
112       "org.apache.http.NameValuePair",
113       "org.apache.http.message.ParserCursor"
114     );
115   } 
116
117   private static void resetClasses() {
118     org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(APIResponseESTestscaffolding.class.getClassLoader());
119
120     org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
121       "org.apache.http.message.HeaderGroup",
122       "org.apache.http.ProtocolVersion",
123       "org.apache.http.message.BasicStatusLine",
124       "org.apache.http.message.BasicLineFormatter",
125       "org.apache.http.util.CharArrayBuffer",
126       "org.apache.http.HttpVersion",
127       "org.apache.http.impl.EnglishReasonPhraseCatalog",
128       "org.apache.http.message.BasicHeader",
129       "org.apache.http.message.BasicHeaderValueParser",
130       "org.apache.http.Consts",
131       "org.apache.http.protocol.HTTP",
132       "org.apache.http.message.BasicNameValuePair",
133       "org.apache.http.message.BufferedHeader",
134       "org.apache.http.ParseException",
135       "org.apache.http.entity.AbstractHttpEntity",
136       "org.apache.http.util.ByteArrayBuffer",
137       "org.apache.http.entity.ContentType"
138     );
139   }
140 }