2 * Scaffolding file used to store all the setups needed to run
3 * tests automatically generated by EvoSuite
4 * Mon Nov 14 11:47:07 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 HttpHeaderESTestscaffolding {
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.HttpHeader";
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(HttpHeaderESTestscaffolding.class.getClassLoader() ,
92 "org.openecomp.mso.rest.HttpHeader"
96 private static void resetClasses() {