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
8 * ============LICENSE_START=======================================================
10 * ================================================================================
11 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
12 * ================================================================================
13 * Licensed under the Apache License, Version 2.0 (the "License");
14 * you may not use this file except in compliance with the License.
15 * You may obtain a copy of the License at
17 * http://www.apache.org/licenses/LICENSE-2.0
19 * Unless required by applicable law or agreed to in writing, software
20 * distributed under the License is distributed on an "AS IS" BASIS,
21 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22 * See the License for the specific language governing permissions and
23 * limitations under the License.
24 * ============LICENSE_END=========================================================
27 package org.openecomp.mso.rest;
29 import org.evosuite.runtime.annotation.EvoSuiteClassExclude;
30 import org.junit.BeforeClass;
31 import org.junit.Before;
32 import org.junit.After;
33 import org.junit.AfterClass;
34 import org.evosuite.runtime.sandbox.Sandbox;
37 public class APIResponseESTestscaffolding {
40 public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();
42 private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone();
44 private org.evosuite.runtime.thread.ThreadStopper threadStopper = new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);
47 public static void initEvoSuiteFramework() {
48 org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.mso.rest.APIResponse";
49 org.evosuite.runtime.GuiSupport.initialize();
50 org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100;
51 org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000;
52 org.evosuite.runtime.RuntimeSettings.mockSystemIn = true;
53 org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED;
54 org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT();
55 org.evosuite.runtime.classhandling.JDKClassResetter.init();
57 org.evosuite.runtime.Runtime.getInstance().resetRuntime();
61 public static void clearEvoSuiteFramework(){
62 Sandbox.resetDefaultSecurityManager();
63 java.lang.System.setProperties((java.util.Properties) defaultProperties.clone());
67 public void initTestCase(){
68 threadStopper.storeCurrentThreads();
69 threadStopper.startRecordingTime();
70 org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler();
71 org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode();
73 org.evosuite.runtime.GuiSupport.setHeadless();
74 org.evosuite.runtime.Runtime.getInstance().resetRuntime();
75 org.evosuite.runtime.agent.InstrumentingAgent.activate();
79 public void doneWithTestCase(){
80 threadStopper.killAndJoinClientThreads();
81 org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks();
82 org.evosuite.runtime.classhandling.JDKClassResetter.reset();
84 org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode();
85 org.evosuite.runtime.agent.InstrumentingAgent.deactivate();
86 org.evosuite.runtime.GuiSupport.restoreHeadlessMode();
90 private static void initializeClasses() {
91 org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(APIResponseESTestscaffolding.class.getClassLoader() ,
92 "org.apache.http.HttpVersion",
93 "org.apache.http.message.BasicNameValuePair",
94 "org.apache.http.message.HeaderGroup",
95 "org.apache.http.message.HeaderValueParser",
96 "org.apache.http.message.BasicStatusLine",
97 "org.apache.http.message.BasicHeaderValueParser",
98 "org.apache.http.message.BasicLineFormatter",
99 "org.apache.http.entity.ByteArrayEntity",
100 "org.apache.http.Header",
101 "org.apache.http.StatusLine",
102 "org.apache.http.util.EntityUtils",
103 "org.apache.http.message.BasicHttpResponse",
104 "org.apache.http.FormattedHeader",
105 "org.apache.http.RequestLine",
106 "org.apache.http.HttpMessage",
107 "org.apache.http.message.AbstractHttpMessage",
108 "org.apache.http.Consts",
109 "org.apache.http.protocol.HTTP",
110 "org.apache.http.util.ByteArrayBuffer",
111 "org.apache.http.ParseException",
112 "org.apache.http.HeaderIterator",
113 "org.apache.http.entity.AbstractHttpEntity",
114 "org.openecomp.mso.rest.RESTException",
115 "org.apache.http.util.Args",
116 "org.apache.http.ReasonPhraseCatalog",
117 "org.apache.http.HttpEntity",
118 "org.apache.http.entity.ContentType",
119 "org.apache.http.message.LineFormatter",
120 "org.apache.http.entity.StringEntity",
121 "org.openecomp.mso.rest.HttpHeader",
122 "org.apache.http.HeaderElement",
123 "org.apache.http.message.BufferedHeader",
124 "org.openecomp.mso.rest.APIResponse",
125 "org.apache.http.util.CharArrayBuffer",
126 "org.apache.http.ProtocolVersion",
127 "org.apache.http.util.TextUtils",
128 "org.apache.http.impl.EnglishReasonPhraseCatalog",
129 "org.apache.http.params.HttpParams",
130 "org.apache.http.message.BasicHeader",
131 "org.apache.http.HttpResponse",
132 "org.apache.http.NameValuePair",
133 "org.apache.http.message.ParserCursor"
137 private static void resetClasses() {
138 org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(APIResponseESTestscaffolding.class.getClassLoader());
140 org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
141 "org.apache.http.message.HeaderGroup",
142 "org.apache.http.ProtocolVersion",
143 "org.apache.http.message.BasicStatusLine",
144 "org.apache.http.message.BasicLineFormatter",
145 "org.apache.http.util.CharArrayBuffer",
146 "org.apache.http.HttpVersion",
147 "org.apache.http.impl.EnglishReasonPhraseCatalog",
148 "org.apache.http.message.BasicHeader",
149 "org.apache.http.message.BasicHeaderValueParser",
150 "org.apache.http.Consts",
151 "org.apache.http.protocol.HTTP",
152 "org.apache.http.message.BasicNameValuePair",
153 "org.apache.http.message.BufferedHeader",
154 "org.apache.http.ParseException",
155 "org.apache.http.entity.AbstractHttpEntity",
156 "org.apache.http.util.ByteArrayBuffer",
157 "org.apache.http.entity.ContentType"