select_edgex_condition_rule.jmx 28 KB

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