select_countwindow_rule.jmx 57 KB

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