Merge "updated ARIA version"
[so.git] / bpmn / MSOURN-plugin / src / test / java / org / openecomp / camunda / bpmn / plugin / urnmap / resources / ProcessInstanceResourceESTestscaffolding.java
1 /**\r
2  * Scaffolding file used to store all the setups needed to run \r
3  * tests automatically generated by EvoSuite\r
4  * Mon Nov 14 13:45:16 GMT 2016\r
5  */\r
6 \r
7 package org.openecomp.camunda.bpmn.plugin.urnmap.resources;\r
8 \r
9 import org.evosuite.runtime.annotation.EvoSuiteClassExclude;\r
10 import org.junit.BeforeClass;\r
11 import org.junit.Before;\r
12 import org.junit.After;\r
13 import org.junit.AfterClass;\r
14 import org.evosuite.runtime.sandbox.Sandbox;\r
15 \r
16 @EvoSuiteClassExclude\r
17 public class ProcessInstanceResourceESTestscaffolding {\r
18 \r
19   @org.junit.Rule \r
20   public org.evosuite.runtime.vnet.NonFunctionalRequirementRule nfr = new org.evosuite.runtime.vnet.NonFunctionalRequirementRule();\r
21 \r
22   private static final java.util.Properties defaultProperties = (java.util.Properties) java.lang.System.getProperties().clone(); \r
23 \r
24   private org.evosuite.runtime.thread.ThreadStopper threadStopper =  new org.evosuite.runtime.thread.ThreadStopper (org.evosuite.runtime.thread.KillSwitchHandler.getInstance(), 3000);\r
25 \r
26   @BeforeClass \r
27   public static void initEvoSuiteFramework() { \r
28     org.evosuite.runtime.RuntimeSettings.className = "org.openecomp.camunda.bpmn.plugin.urnmap.resources.ProcessInstanceResource"; \r
29     org.evosuite.runtime.GuiSupport.initialize(); \r
30     org.evosuite.runtime.RuntimeSettings.maxNumberOfThreads = 100; \r
31     org.evosuite.runtime.RuntimeSettings.maxNumberOfIterationsPerLoop = 10000; \r
32     org.evosuite.runtime.RuntimeSettings.mockSystemIn = true; \r
33     org.evosuite.runtime.RuntimeSettings.sandboxMode = org.evosuite.runtime.sandbox.Sandbox.SandboxMode.RECOMMENDED; \r
34     org.evosuite.runtime.sandbox.Sandbox.initializeSecurityManagerForSUT(); \r
35     org.evosuite.runtime.classhandling.JDKClassResetter.init(); \r
36     initializeClasses();\r
37     org.evosuite.runtime.Runtime.getInstance().resetRuntime(); \r
38   } \r
39 \r
40   @AfterClass \r
41   public static void clearEvoSuiteFramework(){ \r
42     Sandbox.resetDefaultSecurityManager(); \r
43     java.lang.System.setProperties((java.util.Properties) defaultProperties.clone()); \r
44   } \r
45 \r
46   @Before \r
47   public void initTestCase(){ \r
48     threadStopper.storeCurrentThreads();\r
49     threadStopper.startRecordingTime();\r
50     org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().initHandler(); \r
51     org.evosuite.runtime.sandbox.Sandbox.goingToExecuteSUTCode(); \r
52      \r
53     org.evosuite.runtime.GuiSupport.setHeadless(); \r
54     org.evosuite.runtime.Runtime.getInstance().resetRuntime(); \r
55     org.evosuite.runtime.agent.InstrumentingAgent.activate(); \r
56   } \r
57 \r
58   @After \r
59   public void doneWithTestCase(){ \r
60     threadStopper.killAndJoinClientThreads();\r
61     org.evosuite.runtime.jvm.ShutdownHookHandler.getInstance().safeExecuteAddedHooks(); \r
62     org.evosuite.runtime.classhandling.JDKClassResetter.reset(); \r
63     resetClasses(); \r
64     org.evosuite.runtime.sandbox.Sandbox.doneWithExecutingSUTCode(); \r
65     org.evosuite.runtime.agent.InstrumentingAgent.deactivate(); \r
66     org.evosuite.runtime.GuiSupport.restoreHeadlessMode(); \r
67   } \r
68 \r
69 \r
70   private static void initializeClasses() {\r
71     org.evosuite.runtime.classhandling.ClassStateSupport.initializeClasses(ProcessInstanceResourceESTestscaffolding.class.getClassLoader() ,\r
72       "org.camunda.bpm.cockpit.plugin.resource.AbstractCockpitPluginResource",\r
73       "org.camunda.bpm.cockpit.CockpitRuntimeDelegate",\r
74       "org.camunda.bpm.webapp.plugin.resource.AbstractAppPluginResource",\r
75       "org.camunda.bpm.webapp.AppRuntimeDelegate",\r
76       "org.camunda.bpm.cockpit.plugin.resource.AbstractPluginResource",\r
77       "org.camunda.bpm.cockpit.db.QueryService",\r
78       "org.camunda.bpm.engine.ProcessEngine",\r
79       "org.openecomp.camunda.bpmn.plugin.urnmap.resources.ProcessInstanceResource",\r
80       "org.camunda.bpm.engine.ProcessEngineServices",\r
81       "org.camunda.bpm.cockpit.db.CommandExecutor",\r
82       "org.camunda.bpm.cockpit.Cockpit",\r
83       "org.openecomp.camunda.bpmn.plugin.urnmap.db.URNData"\r
84     );\r
85   } \r
86 \r
87   private static void resetClasses() {\r
88     org.evosuite.runtime.classhandling.ClassResetter.getInstance().setClassLoader(ProcessInstanceResourceESTestscaffolding.class.getClassLoader());\r
89 \r
90     org.evosuite.runtime.classhandling.ClassStateSupport.resetClasses(\r
91       "org.camunda.bpm.cockpit.Cockpit"\r
92     );\r
93   }\r
94 }\r