select_countwindow_rule.jmx 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ Copyright 2021-2023 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="mqtt_srv" elementType="Argument">
  43. <stringProp name="Argument.name">mqtt_srv</stringProp>
  44. <stringProp name="Argument.value">127.0.0.1</stringProp>
  45. <stringProp name="Argument.metadata">=</stringProp>
  46. </elementProp>
  47. </collectionProp>
  48. </Arguments>
  49. <hashTree/>
  50. <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Rules" enabled="true">
  51. <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
  52. <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
  53. <boolProp name="LoopController.continue_forever">false</boolProp>
  54. <stringProp name="LoopController.loops">1</stringProp>
  55. </elementProp>
  56. <stringProp name="ThreadGroup.num_threads">1</stringProp>
  57. <stringProp name="ThreadGroup.ramp_time">1</stringProp>
  58. <boolProp name="ThreadGroup.scheduler">false</boolProp>
  59. <stringProp name="ThreadGroup.duration"></stringProp>
  60. <stringProp name="ThreadGroup.delay"></stringProp>
  61. <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
  62. </ThreadGroup>
  63. <hashTree>
  64. <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
  65. <boolProp name="ResultCollector.error_logging">false</boolProp>
  66. <objProp>
  67. <name>saveConfig</name>
  68. <value class="SampleSaveConfiguration">
  69. <time>true</time>
  70. <latency>true</latency>
  71. <timestamp>true</timestamp>
  72. <success>true</success>
  73. <label>true</label>
  74. <code>true</code>
  75. <message>true</message>
  76. <threadName>true</threadName>
  77. <dataType>true</dataType>
  78. <encoding>false</encoding>
  79. <assertions>true</assertions>
  80. <subresults>true</subresults>
  81. <responseData>false</responseData>
  82. <samplerData>false</samplerData>
  83. <xml>false</xml>
  84. <fieldNames>true</fieldNames>
  85. <responseHeaders>false</responseHeaders>
  86. <requestHeaders>false</requestHeaders>
  87. <responseDataOnError>false</responseDataOnError>
  88. <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
  89. <assertionsResultsToSave>0</assertionsResultsToSave>
  90. <bytes>true</bytes>
  91. <sentBytes>true</sentBytes>
  92. <threadCounts>true</threadCounts>
  93. <idleTime>true</idleTime>
  94. <connectTime>true</connectTime>
  95. </value>
  96. </objProp>
  97. <stringProp name="filename"></stringProp>
  98. </ResultCollector>
  99. <hashTree/>
  100. <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="API" enabled="true">
  101. <boolProp name="TransactionController.includeTimers">false</boolProp>
  102. <boolProp name="TransactionController.parent">false</boolProp>
  103. </TransactionController>
  104. <hashTree>
  105. <net.xmeter.samplers.ConnectSampler guiclass="net.xmeter.gui.ConnectSamplerUI" testclass="net.xmeter.samplers.ConnectSampler" testname="MQTT Connect" enabled="true">
  106. <stringProp name="mqtt.server">${mqtt_srv}</stringProp>
  107. <stringProp name="mqtt.port">1883</stringProp>
  108. <stringProp name="mqtt.version">3.1</stringProp>
  109. <stringProp name="mqtt.conn_timeout">10</stringProp>
  110. <boolProp name="mqtt.private_protocol">false</boolProp>
  111. <stringProp name="mqtt.listener_timeout">10</stringProp>
  112. <stringProp name="mqtt.protocol">TCP</stringProp>
  113. <boolProp name="mqtt.dual_ssl_authentication">false</boolProp>
  114. <stringProp name="mqtt.keystore_file_path"></stringProp>
  115. <stringProp name="mqtt.keystore_password"></stringProp>
  116. <stringProp name="mqtt.clientcert_file_path"></stringProp>
  117. <stringProp name="mqtt.clientcert_password"></stringProp>
  118. <stringProp name="mqtt.user_name"></stringProp>
  119. <stringProp name="mqtt.password"></stringProp>
  120. <stringProp name="mqtt.client_id_prefix">conn_</stringProp>
  121. <boolProp name="mqtt.client_id_suffix">true</boolProp>
  122. <stringProp name="mqtt.conn_keep_alive">300</stringProp>
  123. <stringProp name="mqtt.conn_attampt_max">0</stringProp>
  124. <stringProp name="mqtt.reconn_attampt_max">0</stringProp>
  125. <boolProp name="mqtt.conn_clean_session">true</boolProp>
  126. </net.xmeter.samplers.ConnectSampler>
  127. <hashTree/>
  128. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_CreateStream" enabled="true">
  129. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  130. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  131. <collectionProp name="Arguments.arguments">
  132. <elementProp name="" elementType="HTTPArgument">
  133. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  134. <stringProp name="Argument.value">{&#xd;
  135. &quot;sql&quot; : &quot;create stream demo (temperature bigint, humidity bigint) WITH (FORMAT=\&quot;JSON\&quot;, DATASOURCE=\&quot;devices/+/messages\&quot;,STRICT_VALIDATION=\&quot;true\&quot; )&quot;&#xd;
  136. }</stringProp>
  137. <stringProp name="Argument.metadata">=</stringProp>
  138. </elementProp>
  139. </collectionProp>
  140. </elementProp>
  141. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  142. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  143. <stringProp name="HTTPSampler.protocol"></stringProp>
  144. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  145. <stringProp name="HTTPSampler.path">/streams</stringProp>
  146. <stringProp name="HTTPSampler.method">POST</stringProp>
  147. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  148. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  149. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  150. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  151. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  152. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  153. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  154. </HTTPSamplerProxy>
  155. <hashTree>
  156. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  157. <collectionProp name="Asserion.test_strings">
  158. <stringProp name="-1754954177">Stream demo is created.</stringProp>
  159. </collectionProp>
  160. <stringProp name="Assertion.custom_message"></stringProp>
  161. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  162. <boolProp name="Assertion.assume_success">true</boolProp>
  163. <intProp name="Assertion.test_type">16</intProp>
  164. </ResponseAssertion>
  165. <hashTree/>
  166. </hashTree>
  167. <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="COUNTWINDOW(5,1)" enabled="true">
  168. <boolProp name="TransactionController.includeTimers">false</boolProp>
  169. <boolProp name="TransactionController.parent">false</boolProp>
  170. </TransactionController>
  171. <hashTree>
  172. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_CreateRule" enabled="true">
  173. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  174. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  175. <collectionProp name="Arguments.arguments">
  176. <elementProp name="" elementType="HTTPArgument">
  177. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  178. <stringProp name="Argument.value">{&#xd;
  179. &quot;id&quot;: &quot;rule1&quot;,&#xd;
  180. &quot;sql&quot;: &quot;SELECT * FROM demo WHERE temperature &gt; 20 GROUP BY COUNTWINDOW(5,1) HAVING COUNT(*) &gt; 2&quot;,&#xd;
  181. &quot;actions&quot;: [&#xd;
  182. {&#xd;
  183. &quot;log&quot;: {}&#xd;
  184. },&#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. <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  227. <collectionProp name="Arguments.arguments"/>
  228. </elementProp>
  229. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  230. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  231. <stringProp name="HTTPSampler.protocol"></stringProp>
  232. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  233. <stringProp name="HTTPSampler.path">/rules/rule1/status</stringProp>
  234. <stringProp name="HTTPSampler.method">GET</stringProp>
  235. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  236. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  237. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  238. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  239. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  240. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  241. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  242. </HTTPSamplerProxy>
  243. <hashTree>
  244. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  245. <stringProp name="JSON_PATH">$.source_demo_0_records_in_total</stringProp>
  246. <stringProp name="EXPECTED_VALUE">0</stringProp>
  247. <boolProp name="JSONVALIDATION">true</boolProp>
  248. <boolProp name="EXPECT_NULL">false</boolProp>
  249. <boolProp name="INVERT">false</boolProp>
  250. <boolProp name="ISREGEX">false</boolProp>
  251. </JSONPathAssertion>
  252. <hashTree/>
  253. </hashTree>
  254. <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="loop_controller" enabled="true">
  255. <boolProp name="LoopController.continue_forever">true</boolProp>
  256. <stringProp name="LoopController.loops">10</stringProp>
  257. </LoopController>
  258. <hashTree>
  259. <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true">
  260. <stringProp name="delimiter">,</stringProp>
  261. <stringProp name="fileEncoding"></stringProp>
  262. <stringProp name="filename">iot_data.txt</stringProp>
  263. <boolProp name="ignoreFirstLine">false</boolProp>
  264. <boolProp name="quotedData">false</boolProp>
  265. <boolProp name="recycle">true</boolProp>
  266. <stringProp name="shareMode">shareMode.thread</stringProp>
  267. <boolProp name="stopThread">false</boolProp>
  268. <stringProp name="variableNames">device_id,temperature,humidity</stringProp>
  269. </CSVDataSet>
  270. <hashTree/>
  271. <net.xmeter.samplers.PubSampler guiclass="net.xmeter.gui.PubSamplerUI" testclass="net.xmeter.samplers.PubSampler" testname="MQTT Pub Sampler" enabled="true">
  272. <stringProp name="mqtt.topic_name">devices/${device_id}/messages</stringProp>
  273. <stringProp name="mqtt.qos_level">0</stringProp>
  274. <boolProp name="mqtt.add_timestamp">false</boolProp>
  275. <stringProp name="mqtt.message_type">String</stringProp>
  276. <stringProp name="mqtt.message_type_fixed_length">1024</stringProp>
  277. <stringProp name="mqtt.message_to_sent">{&quot;temperature&quot;: ${temperature}, &quot;humidity&quot; : ${humidity}}</stringProp>
  278. <boolProp name="mqtt.retained_message">false</boolProp>
  279. </net.xmeter.samplers.PubSampler>
  280. <hashTree/>
  281. </hashTree>
  282. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_GetRuleStatus" enabled="true">
  283. <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  284. <collectionProp name="Arguments.arguments"/>
  285. </elementProp>
  286. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  287. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  288. <stringProp name="HTTPSampler.protocol"></stringProp>
  289. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  290. <stringProp name="HTTPSampler.path">/rules/rule1/status</stringProp>
  291. <stringProp name="HTTPSampler.method">GET</stringProp>
  292. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  293. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  294. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  295. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  296. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  297. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  298. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  299. </HTTPSamplerProxy>
  300. <hashTree>
  301. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  302. <stringProp name="JSON_PATH">$.source_demo_0_records_in_total</stringProp>
  303. <stringProp name="EXPECTED_VALUE">10</stringProp>
  304. <boolProp name="JSONVALIDATION">true</boolProp>
  305. <boolProp name="EXPECT_NULL">false</boolProp>
  306. <boolProp name="INVERT">false</boolProp>
  307. <boolProp name="ISREGEX">false</boolProp>
  308. </JSONPathAssertion>
  309. <hashTree/>
  310. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  311. <stringProp name="JSON_PATH">$.sink_mqtt_1_0_records_in_total</stringProp>
  312. <stringProp name="EXPECTED_VALUE">5</stringProp>
  313. <boolProp name="JSONVALIDATION">true</boolProp>
  314. <boolProp name="EXPECT_NULL">false</boolProp>
  315. <boolProp name="INVERT">false</boolProp>
  316. <boolProp name="ISREGEX">false</boolProp>
  317. </JSONPathAssertion>
  318. <hashTree/>
  319. </hashTree>
  320. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_DropRule" enabled="true">
  321. <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  322. <collectionProp name="Arguments.arguments"/>
  323. </elementProp>
  324. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  325. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  326. <stringProp name="HTTPSampler.protocol"></stringProp>
  327. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  328. <stringProp name="HTTPSampler.path">/rules/rule1</stringProp>
  329. <stringProp name="HTTPSampler.method">DELETE</stringProp>
  330. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  331. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  332. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  333. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  334. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  335. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  336. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  337. </HTTPSamplerProxy>
  338. <hashTree>
  339. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  340. <collectionProp name="Asserion.test_strings">
  341. <stringProp name="717250485">Rule rule1 is dropped.</stringProp>
  342. </collectionProp>
  343. <stringProp name="Assertion.custom_message"></stringProp>
  344. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  345. <boolProp name="Assertion.assume_success">false</boolProp>
  346. <intProp name="Assertion.test_type">16</intProp>
  347. </ResponseAssertion>
  348. <hashTree/>
  349. </hashTree>
  350. </hashTree>
  351. <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="COUNTWINDOW(5,2)" enabled="true">
  352. <boolProp name="TransactionController.includeTimers">false</boolProp>
  353. <boolProp name="TransactionController.parent">false</boolProp>
  354. </TransactionController>
  355. <hashTree>
  356. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_CreateRule" enabled="true">
  357. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  358. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  359. <collectionProp name="Arguments.arguments">
  360. <elementProp name="" elementType="HTTPArgument">
  361. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  362. <stringProp name="Argument.value">{&#xd;
  363. &quot;id&quot;: &quot;rule1&quot;,&#xd;
  364. &quot;sql&quot;: &quot;SELECT * FROM demo WHERE temperature &gt; 20 GROUP BY COUNTWINDOW(5,2)&quot;,&#xd;
  365. &quot;actions&quot;: [&#xd;
  366. {&#xd;
  367. &quot;log&quot;: {}&#xd;
  368. },&#xd;
  369. {&#xd;
  370. &quot;mqtt&quot;: {&#xd;
  371. &quot;server&quot;: &quot;tcp://${mqtt_srv}:1883&quot;,&#xd;
  372. &quot;topic&quot;: &quot;devices/result&quot;,&#xd;
  373. &quot;qos&quot;: 1,&#xd;
  374. &quot;clientId&quot;: &quot;demo_001&quot;&#xd;
  375. }&#xd;
  376. }&#xd;
  377. ]&#xd;
  378. }</stringProp>
  379. <stringProp name="Argument.metadata">=</stringProp>
  380. </elementProp>
  381. </collectionProp>
  382. </elementProp>
  383. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  384. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  385. <stringProp name="HTTPSampler.protocol"></stringProp>
  386. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  387. <stringProp name="HTTPSampler.path">/rules</stringProp>
  388. <stringProp name="HTTPSampler.method">POST</stringProp>
  389. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  390. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  391. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  392. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  393. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  394. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  395. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  396. </HTTPSamplerProxy>
  397. <hashTree>
  398. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  399. <collectionProp name="Asserion.test_strings">
  400. <stringProp name="-2022196798">Rule rule1 was created</stringProp>
  401. </collectionProp>
  402. <stringProp name="Assertion.custom_message"></stringProp>
  403. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  404. <boolProp name="Assertion.assume_success">true</boolProp>
  405. <intProp name="Assertion.test_type">16</intProp>
  406. </ResponseAssertion>
  407. <hashTree/>
  408. </hashTree>
  409. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_GetRuleStatus" enabled="true">
  410. <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  411. <collectionProp name="Arguments.arguments"/>
  412. </elementProp>
  413. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  414. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  415. <stringProp name="HTTPSampler.protocol"></stringProp>
  416. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  417. <stringProp name="HTTPSampler.path">/rules/rule1/status</stringProp>
  418. <stringProp name="HTTPSampler.method">GET</stringProp>
  419. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  420. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  421. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  422. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  423. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  424. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  425. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  426. </HTTPSamplerProxy>
  427. <hashTree>
  428. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  429. <stringProp name="JSON_PATH">$.source_demo_0_records_in_total</stringProp>
  430. <stringProp name="EXPECTED_VALUE">0</stringProp>
  431. <boolProp name="JSONVALIDATION">true</boolProp>
  432. <boolProp name="EXPECT_NULL">false</boolProp>
  433. <boolProp name="INVERT">false</boolProp>
  434. <boolProp name="ISREGEX">false</boolProp>
  435. </JSONPathAssertion>
  436. <hashTree/>
  437. </hashTree>
  438. <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="loop_controller" enabled="true">
  439. <boolProp name="LoopController.continue_forever">true</boolProp>
  440. <stringProp name="LoopController.loops">10</stringProp>
  441. </LoopController>
  442. <hashTree>
  443. <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true">
  444. <stringProp name="delimiter">,</stringProp>
  445. <stringProp name="fileEncoding"></stringProp>
  446. <stringProp name="filename">iot_data.txt</stringProp>
  447. <boolProp name="ignoreFirstLine">false</boolProp>
  448. <boolProp name="quotedData">false</boolProp>
  449. <boolProp name="recycle">true</boolProp>
  450. <stringProp name="shareMode">shareMode.thread</stringProp>
  451. <boolProp name="stopThread">false</boolProp>
  452. <stringProp name="variableNames">device_id,temperature,humidity</stringProp>
  453. </CSVDataSet>
  454. <hashTree/>
  455. <net.xmeter.samplers.PubSampler guiclass="net.xmeter.gui.PubSamplerUI" testclass="net.xmeter.samplers.PubSampler" testname="MQTT Pub Sampler" enabled="true">
  456. <stringProp name="mqtt.topic_name">devices/${device_id}/messages</stringProp>
  457. <stringProp name="mqtt.qos_level">0</stringProp>
  458. <boolProp name="mqtt.add_timestamp">false</boolProp>
  459. <stringProp name="mqtt.message_type">String</stringProp>
  460. <stringProp name="mqtt.message_type_fixed_length">1024</stringProp>
  461. <stringProp name="mqtt.message_to_sent">{&quot;temperature&quot;: ${temperature}, &quot;humidity&quot; : ${humidity}}</stringProp>
  462. <boolProp name="mqtt.retained_message">false</boolProp>
  463. </net.xmeter.samplers.PubSampler>
  464. <hashTree/>
  465. </hashTree>
  466. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_GetRuleStatus" enabled="true">
  467. <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  468. <collectionProp name="Arguments.arguments"/>
  469. </elementProp>
  470. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  471. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  472. <stringProp name="HTTPSampler.protocol"></stringProp>
  473. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  474. <stringProp name="HTTPSampler.path">/rules/rule1/status</stringProp>
  475. <stringProp name="HTTPSampler.method">GET</stringProp>
  476. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  477. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  478. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  479. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  480. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  481. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  482. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  483. </HTTPSamplerProxy>
  484. <hashTree>
  485. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  486. <stringProp name="JSON_PATH">$.source_demo_0_records_in_total</stringProp>
  487. <stringProp name="EXPECTED_VALUE">10</stringProp>
  488. <boolProp name="JSONVALIDATION">true</boolProp>
  489. <boolProp name="EXPECT_NULL">false</boolProp>
  490. <boolProp name="INVERT">false</boolProp>
  491. <boolProp name="ISREGEX">false</boolProp>
  492. </JSONPathAssertion>
  493. <hashTree/>
  494. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  495. <stringProp name="JSON_PATH">$.sink_mqtt_1_0_records_in_total</stringProp>
  496. <stringProp name="EXPECTED_VALUE">3</stringProp>
  497. <boolProp name="JSONVALIDATION">true</boolProp>
  498. <boolProp name="EXPECT_NULL">false</boolProp>
  499. <boolProp name="INVERT">false</boolProp>
  500. <boolProp name="ISREGEX">false</boolProp>
  501. </JSONPathAssertion>
  502. <hashTree/>
  503. </hashTree>
  504. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_DropRule" enabled="true">
  505. <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  506. <collectionProp name="Arguments.arguments"/>
  507. </elementProp>
  508. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  509. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  510. <stringProp name="HTTPSampler.protocol"></stringProp>
  511. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  512. <stringProp name="HTTPSampler.path">/rules/rule1</stringProp>
  513. <stringProp name="HTTPSampler.method">DELETE</stringProp>
  514. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  515. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  516. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  517. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  518. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  519. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  520. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  521. </HTTPSamplerProxy>
  522. <hashTree>
  523. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  524. <collectionProp name="Asserion.test_strings">
  525. <stringProp name="717250485">Rule rule1 is dropped.</stringProp>
  526. </collectionProp>
  527. <stringProp name="Assertion.custom_message"></stringProp>
  528. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  529. <boolProp name="Assertion.assume_success">false</boolProp>
  530. <intProp name="Assertion.test_type">16</intProp>
  531. </ResponseAssertion>
  532. <hashTree/>
  533. </hashTree>
  534. </hashTree>
  535. <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="COUNTWINDOW(5)" enabled="true">
  536. <boolProp name="TransactionController.includeTimers">false</boolProp>
  537. <boolProp name="TransactionController.parent">false</boolProp>
  538. </TransactionController>
  539. <hashTree>
  540. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_CreateRule" enabled="true">
  541. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  542. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  543. <collectionProp name="Arguments.arguments">
  544. <elementProp name="" elementType="HTTPArgument">
  545. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  546. <stringProp name="Argument.value">{&#xd;
  547. &quot;id&quot;: &quot;rule1&quot;,&#xd;
  548. &quot;sql&quot;: &quot;SELECT * FROM demo WHERE temperature &gt; 20 GROUP BY COUNTWINDOW(5) HAVING COUNT(*) &gt; 2&quot;,&#xd;
  549. &quot;actions&quot;: [&#xd;
  550. {&#xd;
  551. &quot;log&quot;: {}&#xd;
  552. },&#xd;
  553. {&#xd;
  554. &quot;mqtt&quot;: {&#xd;
  555. &quot;server&quot;: &quot;tcp://${mqtt_srv}:1883&quot;,&#xd;
  556. &quot;topic&quot;: &quot;devices/result&quot;,&#xd;
  557. &quot;qos&quot;: 1,&#xd;
  558. &quot;clientId&quot;: &quot;demo_001&quot;&#xd;
  559. }&#xd;
  560. }&#xd;
  561. ]&#xd;
  562. }</stringProp>
  563. <stringProp name="Argument.metadata">=</stringProp>
  564. </elementProp>
  565. </collectionProp>
  566. </elementProp>
  567. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  568. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  569. <stringProp name="HTTPSampler.protocol"></stringProp>
  570. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  571. <stringProp name="HTTPSampler.path">/rules</stringProp>
  572. <stringProp name="HTTPSampler.method">POST</stringProp>
  573. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  574. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  575. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  576. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  577. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  578. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  579. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  580. </HTTPSamplerProxy>
  581. <hashTree>
  582. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  583. <collectionProp name="Asserion.test_strings">
  584. <stringProp name="-2022196798">Rule rule1 was created</stringProp>
  585. </collectionProp>
  586. <stringProp name="Assertion.custom_message"></stringProp>
  587. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  588. <boolProp name="Assertion.assume_success">true</boolProp>
  589. <intProp name="Assertion.test_type">16</intProp>
  590. </ResponseAssertion>
  591. <hashTree/>
  592. </hashTree>
  593. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_GetRuleStatus" enabled="true">
  594. <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  595. <collectionProp name="Arguments.arguments"/>
  596. </elementProp>
  597. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  598. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  599. <stringProp name="HTTPSampler.protocol"></stringProp>
  600. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  601. <stringProp name="HTTPSampler.path">/rules/rule1/status</stringProp>
  602. <stringProp name="HTTPSampler.method">GET</stringProp>
  603. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  604. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  605. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  606. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  607. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  608. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  609. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  610. </HTTPSamplerProxy>
  611. <hashTree>
  612. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  613. <stringProp name="JSON_PATH">$.source_demo_0_records_in_total</stringProp>
  614. <stringProp name="EXPECTED_VALUE">0</stringProp>
  615. <boolProp name="JSONVALIDATION">true</boolProp>
  616. <boolProp name="EXPECT_NULL">false</boolProp>
  617. <boolProp name="INVERT">false</boolProp>
  618. <boolProp name="ISREGEX">false</boolProp>
  619. </JSONPathAssertion>
  620. <hashTree/>
  621. </hashTree>
  622. <LoopController guiclass="LoopControlPanel" testclass="LoopController" testname="loop_controller" enabled="true">
  623. <boolProp name="LoopController.continue_forever">true</boolProp>
  624. <stringProp name="LoopController.loops">10</stringProp>
  625. </LoopController>
  626. <hashTree>
  627. <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true">
  628. <stringProp name="delimiter">,</stringProp>
  629. <stringProp name="fileEncoding"></stringProp>
  630. <stringProp name="filename">iot_data.txt</stringProp>
  631. <boolProp name="ignoreFirstLine">false</boolProp>
  632. <boolProp name="quotedData">false</boolProp>
  633. <boolProp name="recycle">true</boolProp>
  634. <stringProp name="shareMode">shareMode.thread</stringProp>
  635. <boolProp name="stopThread">false</boolProp>
  636. <stringProp name="variableNames">device_id,temperature,humidity</stringProp>
  637. </CSVDataSet>
  638. <hashTree/>
  639. <net.xmeter.samplers.PubSampler guiclass="net.xmeter.gui.PubSamplerUI" testclass="net.xmeter.samplers.PubSampler" testname="MQTT Pub Sampler" enabled="true">
  640. <stringProp name="mqtt.topic_name">devices/${device_id}/messages</stringProp>
  641. <stringProp name="mqtt.qos_level">0</stringProp>
  642. <boolProp name="mqtt.add_timestamp">false</boolProp>
  643. <stringProp name="mqtt.message_type">String</stringProp>
  644. <stringProp name="mqtt.message_type_fixed_length">1024</stringProp>
  645. <stringProp name="mqtt.message_to_sent">{&quot;temperature&quot;: ${temperature}, &quot;humidity&quot; : ${humidity}}</stringProp>
  646. <boolProp name="mqtt.retained_message">false</boolProp>
  647. </net.xmeter.samplers.PubSampler>
  648. <hashTree/>
  649. </hashTree>
  650. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_GetRuleStatus" enabled="true">
  651. <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  652. <collectionProp name="Arguments.arguments"/>
  653. </elementProp>
  654. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  655. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  656. <stringProp name="HTTPSampler.protocol"></stringProp>
  657. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  658. <stringProp name="HTTPSampler.path">/rules/rule1/status</stringProp>
  659. <stringProp name="HTTPSampler.method">GET</stringProp>
  660. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  661. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  662. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  663. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  664. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  665. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  666. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  667. </HTTPSamplerProxy>
  668. <hashTree>
  669. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  670. <stringProp name="JSON_PATH">$.source_demo_0_records_in_total</stringProp>
  671. <stringProp name="EXPECTED_VALUE">10</stringProp>
  672. <boolProp name="JSONVALIDATION">true</boolProp>
  673. <boolProp name="EXPECT_NULL">false</boolProp>
  674. <boolProp name="INVERT">false</boolProp>
  675. <boolProp name="ISREGEX">false</boolProp>
  676. </JSONPathAssertion>
  677. <hashTree/>
  678. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  679. <stringProp name="JSON_PATH">$.sink_mqtt_1_0_records_in_total</stringProp>
  680. <stringProp name="EXPECTED_VALUE">2</stringProp>
  681. <boolProp name="JSONVALIDATION">true</boolProp>
  682. <boolProp name="EXPECT_NULL">false</boolProp>
  683. <boolProp name="INVERT">false</boolProp>
  684. <boolProp name="ISREGEX">false</boolProp>
  685. </JSONPathAssertion>
  686. <hashTree/>
  687. </hashTree>
  688. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_DropRule" enabled="true">
  689. <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  690. <collectionProp name="Arguments.arguments"/>
  691. </elementProp>
  692. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  693. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  694. <stringProp name="HTTPSampler.protocol"></stringProp>
  695. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  696. <stringProp name="HTTPSampler.path">/rules/rule1</stringProp>
  697. <stringProp name="HTTPSampler.method">DELETE</stringProp>
  698. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  699. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  700. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  701. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  702. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  703. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  704. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  705. </HTTPSamplerProxy>
  706. <hashTree>
  707. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  708. <collectionProp name="Asserion.test_strings">
  709. <stringProp name="717250485">Rule rule1 is dropped.</stringProp>
  710. </collectionProp>
  711. <stringProp name="Assertion.custom_message"></stringProp>
  712. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  713. <boolProp name="Assertion.assume_success">false</boolProp>
  714. <intProp name="Assertion.test_type">16</intProp>
  715. </ResponseAssertion>
  716. <hashTree/>
  717. </hashTree>
  718. </hashTree>
  719. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="API_Drop_Stream" enabled="true">
  720. <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
  721. <collectionProp name="Arguments.arguments"/>
  722. </elementProp>
  723. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  724. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  725. <stringProp name="HTTPSampler.protocol"></stringProp>
  726. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  727. <stringProp name="HTTPSampler.path">/streams/demo</stringProp>
  728. <stringProp name="HTTPSampler.method">DELETE</stringProp>
  729. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  730. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  731. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  732. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  733. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  734. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  735. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  736. </HTTPSamplerProxy>
  737. <hashTree>
  738. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  739. <collectionProp name="Asserion.test_strings">
  740. <stringProp name="287881319">Stream demo is dropped.</stringProp>
  741. </collectionProp>
  742. <stringProp name="Assertion.custom_message"></stringProp>
  743. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  744. <boolProp name="Assertion.assume_success">false</boolProp>
  745. <intProp name="Assertion.test_type">16</intProp>
  746. </ResponseAssertion>
  747. <hashTree/>
  748. </hashTree>
  749. <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true">
  750. <stringProp name="ConstantTimer.delay">1000</stringProp>
  751. </ConstantTimer>
  752. <hashTree/>
  753. </hashTree>
  754. </hashTree>
  755. <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Result" enabled="true">
  756. <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
  757. <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
  758. <boolProp name="LoopController.continue_forever">false</boolProp>
  759. <stringProp name="LoopController.loops">10</stringProp>
  760. </elementProp>
  761. <stringProp name="ThreadGroup.num_threads">1</stringProp>
  762. <stringProp name="ThreadGroup.ramp_time">1</stringProp>
  763. <boolProp name="ThreadGroup.scheduler">false</boolProp>
  764. <stringProp name="ThreadGroup.duration"></stringProp>
  765. <stringProp name="ThreadGroup.delay"></stringProp>
  766. <boolProp name="ThreadGroup.same_user_on_next_iteration">true</boolProp>
  767. </ThreadGroup>
  768. <hashTree>
  769. <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
  770. <boolProp name="ResultCollector.error_logging">false</boolProp>
  771. <objProp>
  772. <name>saveConfig</name>
  773. <value class="SampleSaveConfiguration">
  774. <time>true</time>
  775. <latency>true</latency>
  776. <timestamp>true</timestamp>
  777. <success>true</success>
  778. <label>true</label>
  779. <code>true</code>
  780. <message>true</message>
  781. <threadName>true</threadName>
  782. <dataType>true</dataType>
  783. <encoding>false</encoding>
  784. <assertions>true</assertions>
  785. <subresults>true</subresults>
  786. <responseData>false</responseData>
  787. <samplerData>false</samplerData>
  788. <xml>false</xml>
  789. <fieldNames>true</fieldNames>
  790. <responseHeaders>false</responseHeaders>
  791. <requestHeaders>false</requestHeaders>
  792. <responseDataOnError>false</responseDataOnError>
  793. <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
  794. <assertionsResultsToSave>0</assertionsResultsToSave>
  795. <bytes>true</bytes>
  796. <sentBytes>true</sentBytes>
  797. <threadCounts>true</threadCounts>
  798. <idleTime>true</idleTime>
  799. <connectTime>true</connectTime>
  800. </value>
  801. </objProp>
  802. <stringProp name="filename"></stringProp>
  803. </ResultCollector>
  804. <hashTree/>
  805. <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true">
  806. <stringProp name="delimiter">,</stringProp>
  807. <stringProp name="fileEncoding"></stringProp>
  808. <stringProp name="filename">countwindow_data.txt</stringProp>
  809. <boolProp name="ignoreFirstLine">false</boolProp>
  810. <boolProp name="quotedData">false</boolProp>
  811. <boolProp name="recycle">true</boolProp>
  812. <stringProp name="shareMode">shareMode.thread</stringProp>
  813. <boolProp name="stopThread">false</boolProp>
  814. <stringProp name="variableNames">count</stringProp>
  815. </CSVDataSet>
  816. <hashTree/>
  817. <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Once Only Controller" enabled="true"/>
  818. <hashTree>
  819. <net.xmeter.samplers.ConnectSampler guiclass="net.xmeter.gui.ConnectSamplerUI" testclass="net.xmeter.samplers.ConnectSampler" testname="MQTT Connect" enabled="true">
  820. <stringProp name="mqtt.server">${mqtt_srv}</stringProp>
  821. <stringProp name="mqtt.port">1883</stringProp>
  822. <stringProp name="mqtt.version">3.1</stringProp>
  823. <stringProp name="mqtt.conn_timeout">10</stringProp>
  824. <boolProp name="mqtt.private_protocol">false</boolProp>
  825. <stringProp name="mqtt.listener_timeout">10</stringProp>
  826. <stringProp name="mqtt.protocol">TCP</stringProp>
  827. <boolProp name="mqtt.dual_ssl_authentication">false</boolProp>
  828. <stringProp name="mqtt.keystore_file_path"></stringProp>
  829. <stringProp name="mqtt.keystore_password"></stringProp>
  830. <stringProp name="mqtt.clientcert_file_path"></stringProp>
  831. <stringProp name="mqtt.clientcert_password"></stringProp>
  832. <stringProp name="mqtt.user_name"></stringProp>
  833. <stringProp name="mqtt.password"></stringProp>
  834. <stringProp name="mqtt.client_id_prefix">conn_</stringProp>
  835. <boolProp name="mqtt.client_id_suffix">true</boolProp>
  836. <stringProp name="mqtt.conn_keep_alive">300</stringProp>
  837. <stringProp name="mqtt.conn_attampt_max">0</stringProp>
  838. <stringProp name="mqtt.reconn_attampt_max">0</stringProp>
  839. <boolProp name="mqtt.conn_clean_session">true</boolProp>
  840. </net.xmeter.samplers.ConnectSampler>
  841. <hashTree/>
  842. </hashTree>
  843. <net.xmeter.samplers.SubSampler guiclass="net.xmeter.gui.SubSamplerUI" testclass="net.xmeter.samplers.SubSampler" testname="AnalysisResult" enabled="true">
  844. <stringProp name="mqtt.topic_name">devices/result</stringProp>
  845. <stringProp name="mqtt.qos_level">0</stringProp>
  846. <boolProp name="mqtt.add_timestamp">false</boolProp>
  847. <boolProp name="mqtt.debug_response">true</boolProp>
  848. <stringProp name="mqtt.sample_condition">number of received messages</stringProp>
  849. <stringProp name="mqtt.sample_condition_value">1</stringProp>
  850. </net.xmeter.samplers.SubSampler>
  851. <hashTree>
  852. <BeanShellAssertion guiclass="BeanShellAssertionGui" testclass="BeanShellAssertion" testname="BeanShell Assertion" enabled="true">
  853. <stringProp name="BeanShellAssertion.query">import net.sf.json.JSONArray;
  854. import net.sf.json.JSONObject;
  855. String response = SampleResult.getResponseDataAsString();
  856. JSONArray jsonArr = JSONArray.fromObject(response);
  857. int count = Integer.parseInt(vars.get(&quot;count&quot;));
  858. if(count != jsonArr.size()) {
  859. Failure = true;
  860. FailureMessage = &quot;The count window size is not correct.&quot;;
  861. return;
  862. }
  863. for(int j = 0; j &lt; jsonArr.size(); j++) {
  864. int temperature = jsonArr.getJSONObject(j).getInt(&quot;temperature&quot;);
  865. if(temperature &lt;= 20) {
  866. Failure = true;
  867. FailureMessage = &quot;The temperature should not be less than 20.&quot;;
  868. break;
  869. }
  870. }</stringProp>
  871. <stringProp name="BeanShellAssertion.filename"></stringProp>
  872. <stringProp name="BeanShellAssertion.parameters"></stringProp>
  873. <boolProp name="BeanShellAssertion.resetInterpreter">false</boolProp>
  874. </BeanShellAssertion>
  875. <hashTree/>
  876. </hashTree>
  877. </hashTree>
  878. </hashTree>
  879. </hashTree>
  880. </jmeterTestPlan>