Remove unnecessary use of Calendar.getInstance()
[so.git] / bpmn / MSOCoreBPMN / src / test / java / org / openecomp / mso / bpmn / core / URNMappingsTaskESTestscaffolding.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:35:51 GMT 2016
5  */
6
7 package org.openecomp.mso.bpmn.core;
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 URNMappingsTaskESTestscaffolding {
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.bpmn.core.URNMappingsTask"; 
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(URNMappingsTaskESTestscaffolding.class.getClassLoader() ,
72       "org.camunda.bpm.engine.delegate.BpmnModelExecutionContext",
73       "org.camunda.bpm.model.xml.instance.ModelElementInstance",
74       "org.camunda.bpm.engine.delegate.VariableScope",
75       "org.camunda.bpm.engine.delegate.ProcessEngineServicesAware",
76       "org.camunda.bpm.engine.variable.value.TypedValue",
77       "org.camunda.bpm.engine.delegate.DelegateExecution",
78       "org.camunda.bpm.engine.delegate.Expression",
79       "org.openecomp.mso.bpmn.core.BadInjectedFieldException",
80       "org.camunda.bpm.model.bpmn.instance.BpmnModelElementInstance",
81       "org.openecomp.mso.bpmn.core.URNMappingsTask",
82       "org.openecomp.mso.bpmn.core.MissingInjectedFieldException",
83       "org.openecomp.mso.bpmn.core.BaseTask",
84       "org.camunda.bpm.engine.delegate.BaseDelegateExecution",
85       "org.camunda.bpm.engine.variable.VariableMap",
86       "org.camunda.bpm.engine.delegate.JavaDelegate",
87       "org.camunda.bpm.engine.ProcessEngineServices",
88       "org.camunda.bpm.model.bpmn.BpmnModelInstance",
89       "org.camunda.bpm.model.bpmn.instance.BaseElement",
90       "org.camunda.bpm.model.xml.ModelInstance",
91       "org.camunda.bpm.model.bpmn.instance.FlowElement"
92     );
93   } 
94
95   private static void resetClasses() {
96     org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(URNMappingsTaskESTestscaffolding.class.getClassLoader());
97
98     org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(
99       "org.openecomp.mso.bpmn.core.BadInjectedFieldException",
100       "org.openecomp.mso.bpmn.core.MissingInjectedFieldException"
101     );
102   }
103 }