select_aggr_rule_order.jmx 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  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="k_home" elementType="Argument">
  43. <stringProp name="Argument.name">k_home</stringProp>
  44. <stringProp name="Argument.value">${__property(base,,)}</stringProp>
  45. <stringProp name="Argument.metadata">=</stringProp>
  46. </elementProp>
  47. <elementProp name="fvt" elementType="Argument">
  48. <stringProp name="Argument.name">fvt</stringProp>
  49. <stringProp name="Argument.value">${__property(fvt,,)}</stringProp>
  50. <stringProp name="Argument.metadata">=</stringProp>
  51. </elementProp>
  52. <elementProp name="mqtt_srv" elementType="Argument">
  53. <stringProp name="Argument.name">mqtt_srv</stringProp>
  54. <stringProp name="Argument.value">127.0.0.1</stringProp>
  55. <stringProp name="Argument.metadata">=</stringProp>
  56. </elementProp>
  57. </collectionProp>
  58. </Arguments>
  59. <hashTree/>
  60. <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Rules" enabled="true">
  61. <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
  62. <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
  63. <boolProp name="LoopController.continue_forever">false</boolProp>
  64. <stringProp name="LoopController.loops">1</stringProp>
  65. </elementProp>
  66. <stringProp name="ThreadGroup.num_threads">1</stringProp>
  67. <stringProp name="ThreadGroup.ramp_time">1</stringProp>
  68. <boolProp name="ThreadGroup.scheduler">false</boolProp>
  69. <stringProp name="ThreadGroup.duration"></stringProp>
  70. <stringProp name="ThreadGroup.delay"></stringProp>
  71. </ThreadGroup>
  72. <hashTree>
  73. <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
  74. <boolProp name="ResultCollector.error_logging">false</boolProp>
  75. <objProp>
  76. <name>saveConfig</name>
  77. <value class="SampleSaveConfiguration">
  78. <time>true</time>
  79. <latency>true</latency>
  80. <timestamp>true</timestamp>
  81. <success>true</success>
  82. <label>true</label>
  83. <code>true</code>
  84. <message>true</message>
  85. <threadName>true</threadName>
  86. <dataType>true</dataType>
  87. <encoding>false</encoding>
  88. <assertions>true</assertions>
  89. <subresults>true</subresults>
  90. <responseData>false</responseData>
  91. <samplerData>false</samplerData>
  92. <xml>false</xml>
  93. <fieldNames>true</fieldNames>
  94. <responseHeaders>false</responseHeaders>
  95. <requestHeaders>false</requestHeaders>
  96. <responseDataOnError>false</responseDataOnError>
  97. <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
  98. <assertionsResultsToSave>0</assertionsResultsToSave>
  99. <bytes>true</bytes>
  100. <sentBytes>true</sentBytes>
  101. <threadCounts>true</threadCounts>
  102. <idleTime>true</idleTime>
  103. <connectTime>true</connectTime>
  104. </value>
  105. </objProp>
  106. <stringProp name="filename"></stringProp>
  107. </ResultCollector>
  108. <hashTree/>
  109. <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="API" enabled="true">
  110. <boolProp name="TransactionController.includeTimers">false</boolProp>
  111. <boolProp name="TransactionController.parent">false</boolProp>
  112. </TransactionController>
  113. <hashTree>
  114. <net.xmeter.samplers.ConnectSampler guiclass="net.xmeter.gui.ConnectSamplerUI" testclass="net.xmeter.samplers.ConnectSampler" testname="MQTT Connect" enabled="true">
  115. <stringProp name="mqtt.server">${mqtt_srv}</stringProp>
  116. <stringProp name="mqtt.port">1883</stringProp>
  117. <stringProp name="mqtt.version">3.1</stringProp>
  118. <stringProp name="mqtt.conn_timeout">10</stringProp>
  119. <boolProp name="mqtt.private_protocol">false</boolProp>
  120. <stringProp name="mqtt.listener_timeout">10</stringProp>
  121. <stringProp name="mqtt.protocol">TCP</stringProp>
  122. <boolProp name="mqtt.dual_ssl_authentication">false</boolProp>
  123. <stringProp name="mqtt.keystore_file_path"></stringProp>
  124. <stringProp name="mqtt.keystore_password"></stringProp>
  125. <stringProp name="mqtt.clientcert_file_path"></stringProp>
  126. <stringProp name="mqtt.clientcert_password"></stringProp>
  127. <stringProp name="mqtt.user_name"></stringProp>
  128. <stringProp name="mqtt.password"></stringProp>
  129. <stringProp name="mqtt.client_id_prefix">conn_</stringProp>
  130. <boolProp name="mqtt.client_id_suffix">true</boolProp>
  131. <stringProp name="mqtt.conn_keep_alive">300</stringProp>
  132. <stringProp name="mqtt.conn_attampt_max">0</stringProp>
  133. <stringProp name="mqtt.reconn_attampt_max">0</stringProp>
  134. </net.xmeter.samplers.ConnectSampler>
  135. <hashTree/>
  136. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_CreateStream" enabled="true">
  137. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  138. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  139. <collectionProp name="Arguments.arguments">
  140. <elementProp name="" elementType="HTTPArgument">
  141. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  142. <stringProp name="Argument.value">{&#xd;
  143. &quot;sql&quot; : &quot;create stream demo (temperature float, humidity bigint) WITH (FORMAT=\&quot;JSON\&quot;, DATASOURCE=\&quot;devices/+/messages\&quot; )&quot;&#xd;
  144. }</stringProp>
  145. <stringProp name="Argument.metadata">=</stringProp>
  146. </elementProp>
  147. </collectionProp>
  148. </elementProp>
  149. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  150. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  151. <stringProp name="HTTPSampler.protocol"></stringProp>
  152. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  153. <stringProp name="HTTPSampler.path">/streams</stringProp>
  154. <stringProp name="HTTPSampler.method">POST</stringProp>
  155. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  156. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  157. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  158. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  159. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  160. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  161. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  162. </HTTPSamplerProxy>
  163. <hashTree>
  164. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  165. <collectionProp name="Asserion.test_strings">
  166. <stringProp name="-1754954177">Stream demo is created.</stringProp>
  167. </collectionProp>
  168. <stringProp name="Assertion.custom_message"></stringProp>
  169. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  170. <boolProp name="Assertion.assume_success">true</boolProp>
  171. <intProp name="Assertion.test_type">16</intProp>
  172. </ResponseAssertion>
  173. <hashTree/>
  174. </hashTree>
  175. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_CreateRule" enabled="true">
  176. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  177. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  178. <collectionProp name="Arguments.arguments">
  179. <elementProp name="" elementType="HTTPArgument">
  180. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  181. <stringProp name="Argument.value">{&#xd;
  182. &quot;id&quot;: &quot;rule1&quot;,&#xd;
  183. &quot;sql&quot;: &quot;SELECT temperature, humidity, split_value(mqtt(topic), \&quot;/\&quot;, 1) AS device_id FROM demo GROUP BY TUMBLINGWINDOW(ss, 10) ORDER BY device_id DESC, temperature&quot;,&#xd;
  184. &quot;actions&quot;: [&#xd;
  185. {&#xd;
  186. &quot;mqtt&quot;: {&#xd;
  187. &quot;server&quot;: &quot;tcp://${mqtt_srv}:1883&quot;,&#xd;
  188. &quot;topic&quot;: &quot;devices/result&quot;,&#xd;
  189. &quot;qos&quot;: 1,&#xd;
  190. &quot;clientId&quot;: &quot;demo_001&quot;&#xd;
  191. }&#xd;
  192. }&#xd;
  193. ]&#xd;
  194. }</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</stringProp>
  204. <stringProp name="HTTPSampler.method">POST</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. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  215. <collectionProp name="Asserion.test_strings">
  216. <stringProp name="-2022196798">Rule rule1 was created</stringProp>
  217. </collectionProp>
  218. <stringProp name="Assertion.custom_message"></stringProp>
  219. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  220. <boolProp name="Assertion.assume_success">true</boolProp>
  221. <intProp name="Assertion.test_type">16</intProp>
  222. </ResponseAssertion>
  223. <hashTree/>
  224. </hashTree>
  225. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_GetRuleStatus" enabled="true">
  226. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  227. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  228. <collectionProp name="Arguments.arguments">
  229. <elementProp name="" elementType="HTTPArgument">
  230. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  231. <stringProp name="Argument.value"></stringProp>
  232. <stringProp name="Argument.metadata">=</stringProp>
  233. </elementProp>
  234. </collectionProp>
  235. </elementProp>
  236. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  237. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  238. <stringProp name="HTTPSampler.protocol"></stringProp>
  239. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  240. <stringProp name="HTTPSampler.path">/rules/rule1/status</stringProp>
  241. <stringProp name="HTTPSampler.method">GET</stringProp>
  242. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  243. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  244. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  245. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  246. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  247. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  248. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  249. </HTTPSamplerProxy>
  250. <hashTree>
  251. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  252. <stringProp name="JSON_PATH">$.source_demo_0_records_in_total</stringProp>
  253. <stringProp name="EXPECTED_VALUE">0</stringProp>
  254. <boolProp name="JSONVALIDATION">true</boolProp>
  255. <boolProp name="EXPECT_NULL">false</boolProp>
  256. <boolProp name="INVERT">false</boolProp>
  257. <boolProp name="ISREGEX">false</boolProp>
  258. </JSONPathAssertion>
  259. <hashTree/>
  260. </hashTree>
  261. <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="loop_controller" enabled="true">
  262. <boolProp name="LoopController.continue_forever">true</boolProp>
  263. <stringProp name="LoopController.loops">10</stringProp>
  264. </LoopController>
  265. <hashTree>
  266. <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true">
  267. <stringProp name="delimiter">,</stringProp>
  268. <stringProp name="fileEncoding"></stringProp>
  269. <stringProp name="filename">iot_data.txt</stringProp>
  270. <boolProp name="ignoreFirstLine">false</boolProp>
  271. <boolProp name="quotedData">false</boolProp>
  272. <boolProp name="recycle">true</boolProp>
  273. <stringProp name="shareMode">shareMode.thread</stringProp>
  274. <boolProp name="stopThread">false</boolProp>
  275. <stringProp name="variableNames">device_id,temperature,humidity</stringProp>
  276. </CSVDataSet>
  277. <hashTree/>
  278. <net.xmeter.samplers.PubSampler guiclass="net.xmeter.gui.PubSamplerUI" testclass="net.xmeter.samplers.PubSampler" testname="MQTT Pub Sampler" enabled="true">
  279. <stringProp name="mqtt.topic_name">devices/${device_id}/messages</stringProp>
  280. <stringProp name="mqtt.qos_level">0</stringProp>
  281. <boolProp name="mqtt.add_timestamp">false</boolProp>
  282. <stringProp name="mqtt.message_type">String</stringProp>
  283. <stringProp name="mqtt.message_type_fixed_length">1024</stringProp>
  284. <stringProp name="mqtt.message_to_sent">{&quot;temperature&quot;: ${temperature}, &quot;humidity&quot; : ${humidity}}</stringProp>
  285. </net.xmeter.samplers.PubSampler>
  286. <hashTree/>
  287. </hashTree>
  288. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_GetRuleStatus" enabled="true">
  289. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  290. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  291. <collectionProp name="Arguments.arguments">
  292. <elementProp name="" elementType="HTTPArgument">
  293. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  294. <stringProp name="Argument.value"></stringProp>
  295. <stringProp name="Argument.metadata">=</stringProp>
  296. </elementProp>
  297. </collectionProp>
  298. </elementProp>
  299. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  300. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  301. <stringProp name="HTTPSampler.protocol"></stringProp>
  302. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  303. <stringProp name="HTTPSampler.path">/rules/rule1/status</stringProp>
  304. <stringProp name="HTTPSampler.method">GET</stringProp>
  305. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  306. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  307. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  308. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  309. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  310. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  311. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  312. </HTTPSamplerProxy>
  313. <hashTree>
  314. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  315. <stringProp name="JSON_PATH">$.source_demo_0_records_in_total</stringProp>
  316. <stringProp name="EXPECTED_VALUE">10</stringProp>
  317. <boolProp name="JSONVALIDATION">true</boolProp>
  318. <boolProp name="EXPECT_NULL">false</boolProp>
  319. <boolProp name="INVERT">false</boolProp>
  320. <boolProp name="ISREGEX">false</boolProp>
  321. </JSONPathAssertion>
  322. <hashTree/>
  323. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="false">
  324. <stringProp name="JSON_PATH">$.sink_mqtt_0_0_records_in_total</stringProp>
  325. <stringProp name="EXPECTED_VALUE">6</stringProp>
  326. <boolProp name="JSONVALIDATION">true</boolProp>
  327. <boolProp name="EXPECT_NULL">false</boolProp>
  328. <boolProp name="INVERT">false</boolProp>
  329. <boolProp name="ISREGEX">false</boolProp>
  330. </JSONPathAssertion>
  331. <hashTree/>
  332. <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true">
  333. <stringProp name="ConstantTimer.delay">5000</stringProp>
  334. </ConstantTimer>
  335. <hashTree/>
  336. </hashTree>
  337. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_DropRule" enabled="true">
  338. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  339. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  340. <collectionProp name="Arguments.arguments">
  341. <elementProp name="" elementType="HTTPArgument">
  342. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  343. <stringProp name="Argument.value"></stringProp>
  344. <stringProp name="Argument.metadata">=</stringProp>
  345. </elementProp>
  346. </collectionProp>
  347. </elementProp>
  348. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  349. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  350. <stringProp name="HTTPSampler.protocol"></stringProp>
  351. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  352. <stringProp name="HTTPSampler.path">/rules/rule1</stringProp>
  353. <stringProp name="HTTPSampler.method">DELETE</stringProp>
  354. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  355. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  356. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  357. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  358. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  359. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  360. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  361. </HTTPSamplerProxy>
  362. <hashTree>
  363. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  364. <collectionProp name="Asserion.test_strings">
  365. <stringProp name="717250485">Rule rule1 is dropped.</stringProp>
  366. </collectionProp>
  367. <stringProp name="Assertion.custom_message"></stringProp>
  368. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  369. <boolProp name="Assertion.assume_success">false</boolProp>
  370. <intProp name="Assertion.test_type">16</intProp>
  371. </ResponseAssertion>
  372. <hashTree/>
  373. </hashTree>
  374. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_Drop_Stream" enabled="true">
  375. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  376. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  377. <collectionProp name="Arguments.arguments">
  378. <elementProp name="" elementType="HTTPArgument">
  379. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  380. <stringProp name="Argument.value"></stringProp>
  381. <stringProp name="Argument.metadata">=</stringProp>
  382. </elementProp>
  383. </collectionProp>
  384. </elementProp>
  385. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  386. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  387. <stringProp name="HTTPSampler.protocol"></stringProp>
  388. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  389. <stringProp name="HTTPSampler.path">/streams/demo</stringProp>
  390. <stringProp name="HTTPSampler.method">DELETE</stringProp>
  391. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  392. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  393. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  394. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  395. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  396. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  397. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  398. </HTTPSamplerProxy>
  399. <hashTree>
  400. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  401. <collectionProp name="Asserion.test_strings">
  402. <stringProp name="287881319">Stream demo is dropped.</stringProp>
  403. </collectionProp>
  404. <stringProp name="Assertion.custom_message"></stringProp>
  405. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  406. <boolProp name="Assertion.assume_success">false</boolProp>
  407. <intProp name="Assertion.test_type">16</intProp>
  408. </ResponseAssertion>
  409. <hashTree/>
  410. </hashTree>
  411. <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true">
  412. <stringProp name="ConstantTimer.delay">500</stringProp>
  413. </ConstantTimer>
  414. <hashTree/>
  415. </hashTree>
  416. </hashTree>
  417. <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Result" enabled="true">
  418. <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
  419. <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
  420. <boolProp name="LoopController.continue_forever">false</boolProp>
  421. <stringProp name="LoopController.loops">1</stringProp>
  422. </elementProp>
  423. <stringProp name="ThreadGroup.num_threads">1</stringProp>
  424. <stringProp name="ThreadGroup.ramp_time">1</stringProp>
  425. <boolProp name="ThreadGroup.scheduler">false</boolProp>
  426. <stringProp name="ThreadGroup.duration"></stringProp>
  427. <stringProp name="ThreadGroup.delay"></stringProp>
  428. </ThreadGroup>
  429. <hashTree>
  430. <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
  431. <boolProp name="ResultCollector.error_logging">false</boolProp>
  432. <objProp>
  433. <name>saveConfig</name>
  434. <value class="SampleSaveConfiguration">
  435. <time>true</time>
  436. <latency>true</latency>
  437. <timestamp>true</timestamp>
  438. <success>true</success>
  439. <label>true</label>
  440. <code>true</code>
  441. <message>true</message>
  442. <threadName>true</threadName>
  443. <dataType>true</dataType>
  444. <encoding>false</encoding>
  445. <assertions>true</assertions>
  446. <subresults>true</subresults>
  447. <responseData>false</responseData>
  448. <samplerData>false</samplerData>
  449. <xml>false</xml>
  450. <fieldNames>true</fieldNames>
  451. <responseHeaders>false</responseHeaders>
  452. <requestHeaders>false</requestHeaders>
  453. <responseDataOnError>false</responseDataOnError>
  454. <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
  455. <assertionsResultsToSave>0</assertionsResultsToSave>
  456. <bytes>true</bytes>
  457. <sentBytes>true</sentBytes>
  458. <threadCounts>true</threadCounts>
  459. <idleTime>true</idleTime>
  460. <connectTime>true</connectTime>
  461. </value>
  462. </objProp>
  463. <stringProp name="filename"></stringProp>
  464. </ResultCollector>
  465. <hashTree/>
  466. <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Once Only Controller" enabled="true"/>
  467. <hashTree>
  468. <net.xmeter.samplers.ConnectSampler guiclass="net.xmeter.gui.ConnectSamplerUI" testclass="net.xmeter.samplers.ConnectSampler" testname="MQTT Connect" enabled="true">
  469. <stringProp name="mqtt.server">${mqtt_srv}</stringProp>
  470. <stringProp name="mqtt.port">1883</stringProp>
  471. <stringProp name="mqtt.version">3.1</stringProp>
  472. <stringProp name="mqtt.conn_timeout">10</stringProp>
  473. <boolProp name="mqtt.private_protocol">false</boolProp>
  474. <stringProp name="mqtt.listener_timeout">10</stringProp>
  475. <stringProp name="mqtt.protocol">TCP</stringProp>
  476. <boolProp name="mqtt.dual_ssl_authentication">false</boolProp>
  477. <stringProp name="mqtt.keystore_file_path"></stringProp>
  478. <stringProp name="mqtt.keystore_password"></stringProp>
  479. <stringProp name="mqtt.clientcert_file_path"></stringProp>
  480. <stringProp name="mqtt.clientcert_password"></stringProp>
  481. <stringProp name="mqtt.user_name"></stringProp>
  482. <stringProp name="mqtt.password"></stringProp>
  483. <stringProp name="mqtt.client_id_prefix">conn_</stringProp>
  484. <boolProp name="mqtt.client_id_suffix">true</boolProp>
  485. <stringProp name="mqtt.conn_keep_alive">300</stringProp>
  486. <stringProp name="mqtt.conn_attampt_max">0</stringProp>
  487. <stringProp name="mqtt.reconn_attampt_max">0</stringProp>
  488. </net.xmeter.samplers.ConnectSampler>
  489. <hashTree/>
  490. </hashTree>
  491. <net.xmeter.samplers.SubSampler guiclass="net.xmeter.gui.SubSamplerUI" testclass="net.xmeter.samplers.SubSampler" testname="AnalysisResult" enabled="true">
  492. <stringProp name="mqtt.topic_name">devices/result</stringProp>
  493. <stringProp name="mqtt.qos_level">0</stringProp>
  494. <boolProp name="mqtt.add_timestamp">false</boolProp>
  495. <boolProp name="mqtt.debug_response">true</boolProp>
  496. <stringProp name="mqtt.sample_condition">specified elapsed time (ms)</stringProp>
  497. <stringProp name="mqtt.sample_condition_value">15000</stringProp>
  498. </net.xmeter.samplers.SubSampler>
  499. <hashTree>
  500. <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="BeanShell Assertion" enabled="true">
  501. <stringProp name="BeanShellAssertion.query">import net.sf.json.JSONArray;
  502. import net.sf.json.JSONObject;
  503. String response = SampleResult.getResponseDataAsString();
  504. JSONArray jsonArr = JSONArray.fromObject(response);
  505. int oldT = 0;
  506. String dId = &quot;2&quot;;
  507. for(int j = 0; j &lt; jsonArr.size(); j++) {
  508. String deviceId = jsonArr.getJSONObject(j).getString(&quot;device_id&quot;);
  509. int temperature = jsonArr.getJSONObject(j).getInt(&quot;temperature&quot;);
  510. if(!dId.equals(deviceId)){
  511. dId = deviceId;
  512. oldT = 0;
  513. }
  514. if(oldT &gt; temperature) {
  515. Failure = true;
  516. FailureMessage = &quot;The analyis result is not by order.&quot;;
  517. break;
  518. }
  519. oldT = temperature;
  520. }</stringProp>
  521. <stringProp name="BeanShellAssertion.filename"></stringProp>
  522. <stringProp name="BeanShellAssertion.parameters"></stringProp>
  523. <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp>
  524. </BeanShellAssertion>
  525. <hashTree/>
  526. </hashTree>
  527. </hashTree>
  528. </hashTree>
  529. </hashTree>
  530. </jmeterTestPlan>