Guest User

Untitled

a guest
Mar 22nd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.96 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <jmeterTestPlan version="1.2" properties="4.0" jmeter="4.0 r1823414">
  3. <hashTree>
  4. <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
  5. <stringProp name="TestPlan.comments"></stringProp>
  6. <boolProp name="TestPlan.functional_mode">false</boolProp>
  7. <boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
  8. <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
  9. <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  10. <collectionProp name="Arguments.arguments">
  11. <elementProp name="setupDone" elementType="Argument">
  12. <stringProp name="Argument.name">setupDone</stringProp>
  13. <stringProp name="Argument.value">false</stringProp>
  14. <stringProp name="Argument.metadata">=</stringProp>
  15. </elementProp>
  16. <elementProp name="stopDone" elementType="Argument">
  17. <stringProp name="Argument.name">stopDone</stringProp>
  18. <stringProp name="Argument.value">false</stringProp>
  19. <stringProp name="Argument.metadata">=</stringProp>
  20. </elementProp>
  21. </collectionProp>
  22. </elementProp>
  23. <stringProp name="TestPlan.user_define_classpath"></stringProp>
  24. </TestPlan>
  25. <hashTree>
  26. <SetupThreadGroup guiclass="SetupThreadGroupGui" testclass="SetupThreadGroup" testname="setUp Thread Group" enabled="true">
  27. <stringProp name="ThreadGroup.on_sample_error">stoptestnow</stringProp>
  28. <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
  29. <boolProp name="LoopController.continue_forever">false</boolProp>
  30. <stringProp name="LoopController.loops">1</stringProp>
  31. </elementProp>
  32. <stringProp name="ThreadGroup.num_threads">1</stringProp>
  33. <stringProp name="ThreadGroup.ramp_time">1</stringProp>
  34. <boolProp name="ThreadGroup.scheduler">false</boolProp>
  35. <stringProp name="ThreadGroup.duration"></stringProp>
  36. <stringProp name="ThreadGroup.delay"></stringProp>
  37. </SetupThreadGroup>
  38. <hashTree>
  39. <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Create MQ Connection" enabled="true">
  40. <stringProp name="scriptLanguage">groovy</stringProp>
  41. <stringProp name="parameters"></stringProp>
  42. <stringProp name="filename"></stringProp>
  43. <stringProp name="cacheKey">true</stringProp>
  44. <stringProp name="script">import com.ibm.msg.client.jms.JmsConnectionFactory
  45. import com.ibm.msg.client.jms.JmsFactoryFactory
  46. import com.ibm.msg.client.wmq.WMQConstants
  47.  
  48. import javax.jms.Session
  49.  
  50. // 1
  51. def hostName = "127.0.0.1"
  52. def hostPort = 1414
  53. def channelName = "DEV.APP.SVRCONN"
  54. def queueManagerName = "QM1"
  55. def queueName = "DEV.QUEUE.1"
  56.  
  57. // 2
  58. def ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER)
  59. def cf = ff.createConnectionFactory()
  60.  
  61. // 3
  62. cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, hostName)
  63. cf.setIntProperty(WMQConstants.WMQ_PORT, hostPort)
  64. cf.setStringProperty(WMQConstants.WMQ_CHANNEL, channelName)
  65. cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT)
  66. cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, queueManagerName)
  67.  
  68. // 4
  69. def conn = cf.createConnection("app","")
  70. def sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE)
  71.  
  72. // 5
  73. def destination = sess.createQueue(queueName)
  74.  
  75. conn.start()
  76.  
  77. log.info("#### Start completed!")
  78.  
  79. // 6
  80. System.getProperties().put("Session", sess)
  81. System.getProperties().put("Connection", conn)
  82. System.getProperties().put("Destination", destination)
  83.  
  84. // 7
  85. vars.put("setupDone", "true")</stringProp>
  86. </JSR223Sampler>
  87. <hashTree/>
  88. </hashTree>
  89. <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Producer" enabled="true">
  90. <stringProp name="ThreadGroup.on_sample_error">stoptestnow</stringProp>
  91. <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
  92. <boolProp name="LoopController.continue_forever">false</boolProp>
  93. <intProp name="LoopController.loops">-1</intProp>
  94. </elementProp>
  95. <stringProp name="ThreadGroup.num_threads">20</stringProp>
  96. <stringProp name="ThreadGroup.ramp_time">1</stringProp>
  97. <boolProp name="ThreadGroup.scheduler">false</boolProp>
  98. <stringProp name="ThreadGroup.duration">30</stringProp>
  99. <stringProp name="ThreadGroup.delay"></stringProp>
  100. </ThreadGroup>
  101. <hashTree>
  102. <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Send messages" enabled="true">
  103. <stringProp name="cacheKey">true</stringProp>
  104. <stringProp name="filename"></stringProp>
  105. <stringProp name="parameters"></stringProp>
  106. <stringProp name="script">import java.time.Instant
  107.  
  108. // 1
  109. def sess = System.getProperties().get("Session")
  110. def destination = System.getProperties().get("Destination")
  111.  
  112. // 2
  113. def producer = sess.createProducer(destination)
  114.  
  115. // 3
  116. def rnd = new Random(System.currentTimeMillis())
  117.  
  118. // 4
  119. def payload = String.format("JMeter...IBM MQ...rmoff...test message no. %09d!", rnd.nextInt(Integer.MAX_VALUE))
  120. def msg = sess.createTextMessage(payload)
  121.  
  122. def start = Instant.now()
  123.  
  124. // 5
  125. producer.send(msg)
  126.  
  127. def stop = Instant.now()
  128.  
  129. // 6
  130. producer.close()
  131.  
  132. // 7
  133. SampleResult.setResponseData(msg.toString())
  134. SampleResult.setDataType( org.apache.jmeter.samplers.SampleResult.TEXT )
  135. SampleResult.setLatency( stop.toEpochMilli() - start.toEpochMilli() )</stringProp>
  136. <stringProp name="scriptLanguage">groovy</stringProp>
  137. </JSR223Sampler>
  138. <hashTree/>
  139. <UniformRandomTimer guiclass="UniformRandomTimerGui" testclass="UniformRandomTimer" testname="Uniform Random Timer" enabled="true">
  140. <stringProp name="ConstantTimer.delay">0</stringProp>
  141. <stringProp name="RandomTimer.range">1000.0</stringProp>
  142. </UniformRandomTimer>
  143. <hashTree/>
  144. <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Sleep" enabled="true">
  145. <stringProp name="ConstantTimer.delay">500</stringProp>
  146. </ConstantTimer>
  147. <hashTree/>
  148. </hashTree>
  149. <PostThreadGroup guiclass="PostThreadGroupGui" testclass="PostThreadGroup" testname="tearDown Thread Group" enabled="true">
  150. <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
  151. <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
  152. <boolProp name="LoopController.continue_forever">false</boolProp>
  153. <stringProp name="LoopController.loops">1</stringProp>
  154. </elementProp>
  155. <stringProp name="ThreadGroup.num_threads">1</stringProp>
  156. <stringProp name="ThreadGroup.ramp_time">1</stringProp>
  157. <boolProp name="ThreadGroup.scheduler">false</boolProp>
  158. <stringProp name="ThreadGroup.duration"></stringProp>
  159. <stringProp name="ThreadGroup.delay"></stringProp>
  160. </PostThreadGroup>
  161. <hashTree>
  162. <JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="Close MQ Connection" enabled="true">
  163. <stringProp name="scriptLanguage">groovy</stringProp>
  164. <stringProp name="parameters"></stringProp>
  165. <stringProp name="filename"></stringProp>
  166. <stringProp name="cacheKey">true</stringProp>
  167. <stringProp name="script">// 1
  168. System.getProperties().get("Session").close()
  169. System.getProperties().get("Connection").close()
  170.  
  171. log.info("#### Stop completed!")
  172.  
  173. // 2
  174. vars.put("stopDone", "true")</stringProp>
  175. </JSR223Sampler>
  176. <hashTree/>
  177. </hashTree>
  178. <ResultCollector guiclass="StatGraphVisualizer" testclass="ResultCollector" testname="Aggregate Graph" enabled="true">
  179. <boolProp name="ResultCollector.error_logging">false</boolProp>
  180. <objProp>
  181. <name>saveConfig</name>
  182. <value class="SampleSaveConfiguration">
  183. <time>true</time>
  184. <latency>true</latency>
  185. <timestamp>true</timestamp>
  186. <success>true</success>
  187. <label>true</label>
  188. <code>true</code>
  189. <message>true</message>
  190. <threadName>true</threadName>
  191. <dataType>true</dataType>
  192. <encoding>false</encoding>
  193. <assertions>true</assertions>
  194. <subresults>true</subresults>
  195. <responseData>false</responseData>
  196. <samplerData>false</samplerData>
  197. <xml>false</xml>
  198. <fieldNames>true</fieldNames>
  199. <responseHeaders>false</responseHeaders>
  200. <requestHeaders>false</requestHeaders>
  201. <responseDataOnError>false</responseDataOnError>
  202. <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
  203. <assertionsResultsToSave>0</assertionsResultsToSave>
  204. <bytes>true</bytes>
  205. <sentBytes>true</sentBytes>
  206. <threadCounts>true</threadCounts>
  207. <idleTime>true</idleTime>
  208. <connectTime>true</connectTime>
  209. </value>
  210. </objProp>
  211. <stringProp name="filename"></stringProp>
  212. </ResultCollector>
  213. <hashTree/>
  214. <ResultCollector guiclass="GraphVisualizer" testclass="ResultCollector" testname="Graph Results" enabled="true">
  215. <boolProp name="ResultCollector.error_logging">false</boolProp>
  216. <objProp>
  217. <name>saveConfig</name>
  218. <value class="SampleSaveConfiguration">
  219. <time>true</time>
  220. <latency>true</latency>
  221. <timestamp>true</timestamp>
  222. <success>true</success>
  223. <label>true</label>
  224. <code>true</code>
  225. <message>true</message>
  226. <threadName>true</threadName>
  227. <dataType>true</dataType>
  228. <encoding>false</encoding>
  229. <assertions>true</assertions>
  230. <subresults>true</subresults>
  231. <responseData>false</responseData>
  232. <samplerData>false</samplerData>
  233. <xml>false</xml>
  234. <fieldNames>true</fieldNames>
  235. <responseHeaders>false</responseHeaders>
  236. <requestHeaders>false</requestHeaders>
  237. <responseDataOnError>false</responseDataOnError>
  238. <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
  239. <assertionsResultsToSave>0</assertionsResultsToSave>
  240. <bytes>true</bytes>
  241. <sentBytes>true</sentBytes>
  242. <threadCounts>true</threadCounts>
  243. <idleTime>true</idleTime>
  244. <connectTime>true</connectTime>
  245. </value>
  246. </objProp>
  247. <stringProp name="filename"></stringProp>
  248. </ResultCollector>
  249. <hashTree/>
  250. </hashTree>
  251. </hashTree>
  252. </jmeterTestPlan>
Add Comment
Please, Sign In to add comment