select_edgex_condition_rule.jmx 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ Copyright 2021 EMQ Technologies Co., Ltd.
  4. ~
  5. ~ Licensed under the Apache License, Version 2.0 (the "License");
  6. ~ you may not use this file except in compliance with the License.
  7. ~ You may obtain a copy of the License at
  8. ~
  9. ~ http://www.apache.org/licenses/LICENSE-2.0
  10. ~
  11. ~ Unless required by applicable law or agreed to in writing, software
  12. ~ distributed under the License is distributed on an "AS IS" BASIS,
  13. ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. ~ See the License for the specific language governing permissions and
  15. ~ limitations under the License.
  16. -->
  17. <jmeterTestPlan version="1.2" properties="4.0" jmeter="4.0 r1823414">
  18. <hashTree>
  19. <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
  20. <stringProp name="TestPlan.comments"></stringProp>
  21. <boolProp name="TestPlan.functional_mode">false</boolProp>
  22. <boolProp name="TestPlan.tearDown_on_shutdown">true</boolProp>
  23. <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
  24. <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  25. <collectionProp name="Arguments.arguments"/>
  26. </elementProp>
  27. <stringProp name="TestPlan.user_define_classpath"></stringProp>
  28. </TestPlan>
  29. <hashTree>
  30. <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  31. <collectionProp name="Arguments.arguments">
  32. <elementProp name="srv" elementType="Argument">
  33. <stringProp name="Argument.name">srv</stringProp>
  34. <stringProp name="Argument.value">127.0.0.1</stringProp>
  35. <stringProp name="Argument.metadata">=</stringProp>
  36. </elementProp>
  37. <elementProp name="rest_port" elementType="Argument">
  38. <stringProp name="Argument.name">rest_port</stringProp>
  39. <stringProp name="Argument.value">9081</stringProp>
  40. <stringProp name="Argument.metadata">=</stringProp>
  41. </elementProp>
  42. <elementProp name="fvt" elementType="Argument">
  43. <stringProp name="Argument.name">fvt</stringProp>
  44. <stringProp name="Argument.value">${__property(fvt,,)}</stringProp>
  45. <stringProp name="Argument.metadata">=</stringProp>
  46. </elementProp>
  47. <elementProp name="mqtt_srv" elementType="Argument">
  48. <stringProp name="Argument.name">mqtt_srv</stringProp>
  49. <stringProp name="Argument.value">127.0.0.1</stringProp>
  50. <stringProp name="Argument.metadata">=</stringProp>
  51. </elementProp>
  52. </collectionProp>
  53. </Arguments>
  54. <hashTree/>
  55. <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Rules" enabled="true">
  56. <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
  57. <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
  58. <boolProp name="LoopController.continue_forever">false</boolProp>
  59. <stringProp name="LoopController.loops">1</stringProp>
  60. </elementProp>
  61. <stringProp name="ThreadGroup.num_threads">1</stringProp>
  62. <stringProp name="ThreadGroup.ramp_time">1</stringProp>
  63. <boolProp name="ThreadGroup.scheduler">false</boolProp>
  64. <stringProp name="ThreadGroup.duration"></stringProp>
  65. <stringProp name="ThreadGroup.delay"></stringProp>
  66. </ThreadGroup>
  67. <hashTree>
  68. <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
  69. <boolProp name="ResultCollector.error_logging">false</boolProp>
  70. <objProp>
  71. <name>saveConfig</name>
  72. <value class="SampleSaveConfiguration">
  73. <time>true</time>
  74. <latency>true</latency>
  75. <timestamp>true</timestamp>
  76. <success>true</success>
  77. <label>true</label>
  78. <code>true</code>
  79. <message>true</message>
  80. <threadName>true</threadName>
  81. <dataType>true</dataType>
  82. <encoding>false</encoding>
  83. <assertions>true</assertions>
  84. <subresults>true</subresults>
  85. <responseData>false</responseData>
  86. <samplerData>false</samplerData>
  87. <xml>false</xml>
  88. <fieldNames>true</fieldNames>
  89. <responseHeaders>false</responseHeaders>
  90. <requestHeaders>false</requestHeaders>
  91. <responseDataOnError>false</responseDataOnError>
  92. <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
  93. <assertionsResultsToSave>0</assertionsResultsToSave>
  94. <bytes>true</bytes>
  95. <sentBytes>true</sentBytes>
  96. <threadCounts>true</threadCounts>
  97. <idleTime>true</idleTime>
  98. <connectTime>true</connectTime>
  99. </value>
  100. </objProp>
  101. <stringProp name="filename"></stringProp>
  102. </ResultCollector>
  103. <hashTree/>
  104. <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="API" enabled="true">
  105. <boolProp name="TransactionController.includeTimers">false</boolProp>
  106. <boolProp name="TransactionController.parent">false</boolProp>
  107. </TransactionController>
  108. <hashTree>
  109. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_CreateStream" enabled="true">
  110. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  111. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  112. <collectionProp name="Arguments.arguments">
  113. <elementProp name="" elementType="HTTPArgument">
  114. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  115. <stringProp name="Argument.value">{&#xd;
  116. &quot;sql&quot; : &quot;create stream demo () WITH (FORMAT=\&quot;JSON\&quot;, TYPE=\&quot;edgex\&quot;,Conf_key=\&quot;zmq_conf\&quot;)&quot;&#xd;
  117. }</stringProp>
  118. <stringProp name="Argument.metadata">=</stringProp>
  119. </elementProp>
  120. </collectionProp>
  121. </elementProp>
  122. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  123. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  124. <stringProp name="HTTPSampler.protocol"></stringProp>
  125. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  126. <stringProp name="HTTPSampler.path">/streams</stringProp>
  127. <stringProp name="HTTPSampler.method">POST</stringProp>
  128. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  129. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  130. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  131. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  132. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  133. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  134. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  135. </HTTPSamplerProxy>
  136. <hashTree>
  137. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  138. <collectionProp name="Asserion.test_strings">
  139. <stringProp name="-1754954177">Stream demo is created.</stringProp>
  140. </collectionProp>
  141. <stringProp name="Assertion.custom_message"></stringProp>
  142. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  143. <boolProp name="Assertion.assume_success">true</boolProp>
  144. <intProp name="Assertion.test_type">16</intProp>
  145. </ResponseAssertion>
  146. <hashTree/>
  147. </hashTree>
  148. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_CreateRule" enabled="true">
  149. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  150. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  151. <collectionProp name="Arguments.arguments">
  152. <elementProp name="" elementType="HTTPArgument">
  153. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  154. <stringProp name="Argument.value">{&#xd;
  155. &quot;id&quot;: &quot;rule1&quot;,&#xd;
  156. &quot;sql&quot;: &quot;SELECT * FROM demo WHERE temperature &gt; 30&quot;,&#xd;
  157. &quot;actions&quot;: [&#xd;
  158. {&#xd;
  159. &quot;mqtt&quot;: {&#xd;
  160. &quot;server&quot;: &quot;tcp://${mqtt_srv}:1883&quot;,&#xd;
  161. &quot;topic&quot;: &quot;devices/result&quot;,&#xd;
  162. &quot;qos&quot;: 1,&#xd;
  163. &quot;clientId&quot;: &quot;demo_001&quot;&#xd;
  164. }&#xd;
  165. }&#xd;
  166. ]&#xd;
  167. }</stringProp>
  168. <stringProp name="Argument.metadata">=</stringProp>
  169. </elementProp>
  170. </collectionProp>
  171. </elementProp>
  172. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  173. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  174. <stringProp name="HTTPSampler.protocol"></stringProp>
  175. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  176. <stringProp name="HTTPSampler.path">/rules</stringProp>
  177. <stringProp name="HTTPSampler.method">POST</stringProp>
  178. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  179. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  180. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  181. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  182. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  183. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  184. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  185. </HTTPSamplerProxy>
  186. <hashTree>
  187. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  188. <collectionProp name="Asserion.test_strings">
  189. <stringProp name="-2022196798">Rule rule1 was created</stringProp>
  190. </collectionProp>
  191. <stringProp name="Assertion.custom_message"></stringProp>
  192. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  193. <boolProp name="Assertion.assume_success">true</boolProp>
  194. <intProp name="Assertion.test_type">16</intProp>
  195. </ResponseAssertion>
  196. <hashTree/>
  197. </hashTree>
  198. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_GetRuleStatus" enabled="true">
  199. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  200. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  201. <collectionProp name="Arguments.arguments">
  202. <elementProp name="" elementType="HTTPArgument">
  203. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  204. <stringProp name="Argument.value"></stringProp>
  205. <stringProp name="Argument.metadata">=</stringProp>
  206. </elementProp>
  207. </collectionProp>
  208. </elementProp>
  209. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  210. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  211. <stringProp name="HTTPSampler.protocol"></stringProp>
  212. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  213. <stringProp name="HTTPSampler.path">/rules/rule1/status</stringProp>
  214. <stringProp name="HTTPSampler.method">GET</stringProp>
  215. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  216. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  217. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  218. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  219. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  220. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  221. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  222. </HTTPSamplerProxy>
  223. <hashTree>
  224. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  225. <stringProp name="JSON_PATH">$.source_demo_0_records_in_total</stringProp>
  226. <stringProp name="EXPECTED_VALUE">0</stringProp>
  227. <boolProp name="JSONVALIDATION">true</boolProp>
  228. <boolProp name="EXPECT_NULL">false</boolProp>
  229. <boolProp name="INVERT">false</boolProp>
  230. <boolProp name="ISREGEX">false</boolProp>
  231. </JSONPathAssertion>
  232. <hashTree/>
  233. </hashTree>
  234. <SystemSampler guiclass="SystemSamplerGui" testclass="SystemSampler" testname="OS Process Sampler" enabled="true">
  235. <boolProp name="SystemSampler.checkReturnCode">false</boolProp>
  236. <stringProp name="SystemSampler.expectedReturnCode">0</stringProp>
  237. <stringProp name="SystemSampler.command">test/edgex/pub</stringProp>
  238. <elementProp name="SystemSampler.arguments" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  239. <collectionProp name="Arguments.arguments"/>
  240. </elementProp>
  241. <elementProp name="SystemSampler.environment" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  242. <collectionProp name="Arguments.arguments"/>
  243. </elementProp>
  244. <stringProp name="SystemSampler.directory">${__property(fvt,,)}</stringProp>
  245. </SystemSampler>
  246. <hashTree/>
  247. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_GetRuleStatus" enabled="true">
  248. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  249. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  250. <collectionProp name="Arguments.arguments">
  251. <elementProp name="" elementType="HTTPArgument">
  252. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  253. <stringProp name="Argument.value"></stringProp>
  254. <stringProp name="Argument.metadata">=</stringProp>
  255. </elementProp>
  256. </collectionProp>
  257. </elementProp>
  258. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  259. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  260. <stringProp name="HTTPSampler.protocol"></stringProp>
  261. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  262. <stringProp name="HTTPSampler.path">/rules/rule1/status</stringProp>
  263. <stringProp name="HTTPSampler.method">GET</stringProp>
  264. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  265. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  266. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  267. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  268. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  269. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  270. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  271. </HTTPSamplerProxy>
  272. <hashTree>
  273. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  274. <stringProp name="JSON_PATH">$.source_demo_0_records_in_total</stringProp>
  275. <stringProp name="EXPECTED_VALUE">10</stringProp>
  276. <boolProp name="JSONVALIDATION">true</boolProp>
  277. <boolProp name="EXPECT_NULL">false</boolProp>
  278. <boolProp name="INVERT">false</boolProp>
  279. <boolProp name="ISREGEX">false</boolProp>
  280. </JSONPathAssertion>
  281. <hashTree/>
  282. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="false">
  283. <stringProp name="JSON_PATH">$.sink_mqtt_0_0_records_in_total</stringProp>
  284. <stringProp name="EXPECTED_VALUE">6</stringProp>
  285. <boolProp name="JSONVALIDATION">true</boolProp>
  286. <boolProp name="EXPECT_NULL">false</boolProp>
  287. <boolProp name="INVERT">false</boolProp>
  288. <boolProp name="ISREGEX">false</boolProp>
  289. </JSONPathAssertion>
  290. <hashTree/>
  291. <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true">
  292. <stringProp name="ConstantTimer.delay">5000</stringProp>
  293. </ConstantTimer>
  294. <hashTree/>
  295. </hashTree>
  296. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_DropRule" enabled="true">
  297. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  298. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  299. <collectionProp name="Arguments.arguments">
  300. <elementProp name="" elementType="HTTPArgument">
  301. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  302. <stringProp name="Argument.value"></stringProp>
  303. <stringProp name="Argument.metadata">=</stringProp>
  304. </elementProp>
  305. </collectionProp>
  306. </elementProp>
  307. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  308. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  309. <stringProp name="HTTPSampler.protocol"></stringProp>
  310. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  311. <stringProp name="HTTPSampler.path">/rules/rule1</stringProp>
  312. <stringProp name="HTTPSampler.method">DELETE</stringProp>
  313. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  314. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  315. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  316. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  317. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  318. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  319. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  320. </HTTPSamplerProxy>
  321. <hashTree>
  322. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  323. <collectionProp name="Asserion.test_strings">
  324. <stringProp name="717250485">Rule rule1 is dropped.</stringProp>
  325. </collectionProp>
  326. <stringProp name="Assertion.custom_message"></stringProp>
  327. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  328. <boolProp name="Assertion.assume_success">false</boolProp>
  329. <intProp name="Assertion.test_type">16</intProp>
  330. </ResponseAssertion>
  331. <hashTree/>
  332. </hashTree>
  333. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_Drop_Stream" enabled="true">
  334. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  335. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  336. <collectionProp name="Arguments.arguments">
  337. <elementProp name="" elementType="HTTPArgument">
  338. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  339. <stringProp name="Argument.value"></stringProp>
  340. <stringProp name="Argument.metadata">=</stringProp>
  341. </elementProp>
  342. </collectionProp>
  343. </elementProp>
  344. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  345. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  346. <stringProp name="HTTPSampler.protocol"></stringProp>
  347. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  348. <stringProp name="HTTPSampler.path">/streams/demo</stringProp>
  349. <stringProp name="HTTPSampler.method">DELETE</stringProp>
  350. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  351. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  352. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  353. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  354. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  355. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  356. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  357. </HTTPSamplerProxy>
  358. <hashTree>
  359. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  360. <collectionProp name="Asserion.test_strings">
  361. <stringProp name="287881319">Stream demo is dropped.</stringProp>
  362. </collectionProp>
  363. <stringProp name="Assertion.custom_message"></stringProp>
  364. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  365. <boolProp name="Assertion.assume_success">false</boolProp>
  366. <intProp name="Assertion.test_type">16</intProp>
  367. </ResponseAssertion>
  368. <hashTree/>
  369. </hashTree>
  370. <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true">
  371. <stringProp name="ConstantTimer.delay">500</stringProp>
  372. </ConstantTimer>
  373. <hashTree/>
  374. </hashTree>
  375. </hashTree>
  376. <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Result" enabled="true">
  377. <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
  378. <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
  379. <boolProp name="LoopController.continue_forever">false</boolProp>
  380. <stringProp name="LoopController.loops">6</stringProp>
  381. </elementProp>
  382. <stringProp name="ThreadGroup.num_threads">1</stringProp>
  383. <stringProp name="ThreadGroup.ramp_time">1</stringProp>
  384. <boolProp name="ThreadGroup.scheduler">false</boolProp>
  385. <stringProp name="ThreadGroup.duration"></stringProp>
  386. <stringProp name="ThreadGroup.delay"></stringProp>
  387. </ThreadGroup>
  388. <hashTree>
  389. <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
  390. <boolProp name="ResultCollector.error_logging">false</boolProp>
  391. <objProp>
  392. <name>saveConfig</name>
  393. <value class="SampleSaveConfiguration">
  394. <time>true</time>
  395. <latency>true</latency>
  396. <timestamp>true</timestamp>
  397. <success>true</success>
  398. <label>true</label>
  399. <code>true</code>
  400. <message>true</message>
  401. <threadName>true</threadName>
  402. <dataType>true</dataType>
  403. <encoding>false</encoding>
  404. <assertions>true</assertions>
  405. <subresults>true</subresults>
  406. <responseData>false</responseData>
  407. <samplerData>false</samplerData>
  408. <xml>false</xml>
  409. <fieldNames>true</fieldNames>
  410. <responseHeaders>false</responseHeaders>
  411. <requestHeaders>false</requestHeaders>
  412. <responseDataOnError>false</responseDataOnError>
  413. <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
  414. <assertionsResultsToSave>0</assertionsResultsToSave>
  415. <bytes>true</bytes>
  416. <sentBytes>true</sentBytes>
  417. <threadCounts>true</threadCounts>
  418. <idleTime>true</idleTime>
  419. <connectTime>true</connectTime>
  420. </value>
  421. </objProp>
  422. <stringProp name="filename"></stringProp>
  423. </ResultCollector>
  424. <hashTree/>
  425. <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Once Only Controller" enabled="true"/>
  426. <hashTree>
  427. <net.xmeter.samplers.ConnectSampler guiclass="net.xmeter.gui.ConnectSamplerUI" testclass="net.xmeter.samplers.ConnectSampler" testname="MQTT Connect" enabled="true">
  428. <stringProp name="mqtt.server">${mqtt_srv}</stringProp>
  429. <stringProp name="mqtt.port">1883</stringProp>
  430. <stringProp name="mqtt.version">3.1</stringProp>
  431. <stringProp name="mqtt.conn_timeout">10</stringProp>
  432. <boolProp name="mqtt.private_protocol">false</boolProp>
  433. <stringProp name="mqtt.listener_timeout">10</stringProp>
  434. <stringProp name="mqtt.protocol">TCP</stringProp>
  435. <boolProp name="mqtt.dual_ssl_authentication">false</boolProp>
  436. <stringProp name="mqtt.keystore_file_path"></stringProp>
  437. <stringProp name="mqtt.keystore_password"></stringProp>
  438. <stringProp name="mqtt.clientcert_file_path"></stringProp>
  439. <stringProp name="mqtt.clientcert_password"></stringProp>
  440. <stringProp name="mqtt.user_name"></stringProp>
  441. <stringProp name="mqtt.password"></stringProp>
  442. <stringProp name="mqtt.client_id_prefix">conn_</stringProp>
  443. <boolProp name="mqtt.client_id_suffix">true</boolProp>
  444. <stringProp name="mqtt.conn_keep_alive">300</stringProp>
  445. <stringProp name="mqtt.conn_attampt_max">0</stringProp>
  446. <stringProp name="mqtt.reconn_attampt_max">0</stringProp>
  447. </net.xmeter.samplers.ConnectSampler>
  448. <hashTree/>
  449. </hashTree>
  450. <net.xmeter.samplers.SubSampler guiclass="net.xmeter.gui.SubSamplerUI" testclass="net.xmeter.samplers.SubSampler" testname="AnalysisResult" enabled="true">
  451. <stringProp name="mqtt.topic_name">devices/result</stringProp>
  452. <stringProp name="mqtt.qos_level">0</stringProp>
  453. <boolProp name="mqtt.add_timestamp">false</boolProp>
  454. <boolProp name="mqtt.debug_response">true</boolProp>
  455. <stringProp name="mqtt.sample_condition">number of received messages</stringProp>
  456. <stringProp name="mqtt.sample_condition_value">1</stringProp>
  457. </net.xmeter.samplers.SubSampler>
  458. <hashTree>
  459. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="temperature Assertion" enabled="true">
  460. <stringProp name="JSON_PATH">$[0].Temperature</stringProp>
  461. <stringProp name="EXPECTED_VALUE"></stringProp>
  462. <boolProp name="JSONVALIDATION">false</boolProp>
  463. <boolProp name="EXPECT_NULL">false</boolProp>
  464. <boolProp name="INVERT">false</boolProp>
  465. <boolProp name="ISREGEX">false</boolProp>
  466. </JSONPathAssertion>
  467. <hashTree/>
  468. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="humidity Assertion" enabled="true">
  469. <stringProp name="JSON_PATH">$[0].Humidity</stringProp>
  470. <stringProp name="EXPECTED_VALUE"></stringProp>
  471. <boolProp name="JSONVALIDATION">false</boolProp>
  472. <boolProp name="EXPECT_NULL">false</boolProp>
  473. <boolProp name="INVERT">false</boolProp>
  474. <boolProp name="ISREGEX">false</boolProp>
  475. </JSONPathAssertion>
  476. <hashTree/>
  477. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="uint64 Assertion" enabled="true">
  478. <stringProp name="JSON_PATH">$[0].ui64</stringProp>
  479. <stringProp name="EXPECTED_VALUE">10796529505058023104</stringProp>
  480. <boolProp name="JSONVALIDATION">true</boolProp>
  481. <boolProp name="EXPECT_NULL">false</boolProp>
  482. <boolProp name="INVERT">false</boolProp>
  483. <boolProp name="ISREGEX">false</boolProp>
  484. </JSONPathAssertion>
  485. <hashTree/>
  486. <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="temperature value assertion" enabled="true">
  487. <stringProp name="BeanShellAssertion.query">import net.sf.json.JSONArray;
  488. import net.sf.json.JSONObject;
  489. String response = SampleResult.getResponseDataAsString();
  490. JSONArray arr = JSONArray.fromObject(response);
  491. JSONObject json = arr.getJSONObject(0);
  492. int temp = json.getInt(&quot;Temperature&quot;);
  493. if(temp &lt;= 30) {
  494. Failure = true;
  495. FailureMessage = &quot;The Temperature result should not be less than 30!&quot;;
  496. }</stringProp>
  497. <stringProp name="BeanShellAssertion.filename"></stringProp>
  498. <stringProp name="BeanShellAssertion.parameters"></stringProp>
  499. <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp>
  500. </BeanShellAssertion>
  501. <hashTree/>
  502. </hashTree>
  503. </hashTree>
  504. </hashTree>
  505. </hashTree>
  506. </jmeterTestPlan>