change_stream_rule.jmx 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723
  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">Change the stream definition for rule</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="1stRun" 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. <stringProp name="TestPlan.comments">The connections</stringProp>
  125. </net.xmeter.samplers.ConnectSampler>
  126. <hashTree/>
  127. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="CreateStream" enabled="true">
  128. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  129. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  130. <collectionProp name="Arguments.arguments">
  131. <elementProp name="" elementType="HTTPArgument">
  132. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  133. <stringProp name="Argument.value">{&#xd;
  134. &quot;sql&quot; : &quot;create stream demo (temperature float, light string) WITH (FORMAT=\&quot;JSON\&quot;, DATASOURCE=\&quot;devices/+/messages\&quot;,STRICT_VALIDATION=\&quot;true\&quot; )&quot;&#xd;
  135. }</stringProp>
  136. <stringProp name="Argument.metadata">=</stringProp>
  137. </elementProp>
  138. </collectionProp>
  139. </elementProp>
  140. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  141. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  142. <stringProp name="HTTPSampler.protocol"></stringProp>
  143. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  144. <stringProp name="HTTPSampler.path">/streams</stringProp>
  145. <stringProp name="HTTPSampler.method">POST</stringProp>
  146. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  147. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  148. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  149. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  150. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  151. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  152. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  153. </HTTPSamplerProxy>
  154. <hashTree>
  155. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  156. <collectionProp name="Asserion.test_strings">
  157. <stringProp name="-1754954177">Stream demo is created.</stringProp>
  158. </collectionProp>
  159. <stringProp name="Assertion.custom_message"></stringProp>
  160. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  161. <boolProp name="Assertion.assume_success">true</boolProp>
  162. <intProp name="Assertion.test_type">16</intProp>
  163. </ResponseAssertion>
  164. <hashTree/>
  165. </hashTree>
  166. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="CreateRule" enabled="true">
  167. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  168. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  169. <collectionProp name="Arguments.arguments">
  170. <elementProp name="" elementType="HTTPArgument">
  171. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  172. <stringProp name="Argument.value">{&#xd;
  173. &quot;id&quot;: &quot;rule1&quot;,&#xd;
  174. &quot;sql&quot;: &quot;SELECT light FROM demo&quot;,&#xd;
  175. &quot;actions&quot;: [&#xd;
  176. {&#xd;
  177. &quot;mqtt&quot;: {&#xd;
  178. &quot;server&quot;: &quot;tcp://${mqtt_srv}:1883&quot;,&#xd;
  179. &quot;topic&quot;: &quot;devices/result&quot;,&#xd;
  180. &quot;qos&quot;: 1,&#xd;
  181. &quot;clientId&quot;: &quot;demo_001&quot;&#xd;
  182. }&#xd;
  183. }&#xd;
  184. ]&#xd;
  185. }</stringProp>
  186. <stringProp name="Argument.metadata">=</stringProp>
  187. </elementProp>
  188. </collectionProp>
  189. </elementProp>
  190. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  191. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  192. <stringProp name="HTTPSampler.protocol"></stringProp>
  193. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  194. <stringProp name="HTTPSampler.path">/rules</stringProp>
  195. <stringProp name="HTTPSampler.method">POST</stringProp>
  196. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  197. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  198. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  199. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  200. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  201. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  202. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  203. </HTTPSamplerProxy>
  204. <hashTree>
  205. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  206. <collectionProp name="Asserion.test_strings">
  207. <stringProp name="-2022196798">Rule rule1 was created</stringProp>
  208. </collectionProp>
  209. <stringProp name="Assertion.custom_message"></stringProp>
  210. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  211. <boolProp name="Assertion.assume_success">true</boolProp>
  212. <intProp name="Assertion.test_type">16</intProp>
  213. </ResponseAssertion>
  214. <hashTree/>
  215. </hashTree>
  216. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="GetRuleStatus" enabled="true">
  217. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  218. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  219. <collectionProp name="Arguments.arguments">
  220. <elementProp name="" elementType="HTTPArgument">
  221. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  222. <stringProp name="Argument.value"></stringProp>
  223. <stringProp name="Argument.metadata">=</stringProp>
  224. </elementProp>
  225. </collectionProp>
  226. </elementProp>
  227. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  228. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  229. <stringProp name="HTTPSampler.protocol"></stringProp>
  230. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  231. <stringProp name="HTTPSampler.path">/rules/rule1/status</stringProp>
  232. <stringProp name="HTTPSampler.method">GET</stringProp>
  233. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  234. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  235. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  236. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  237. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  238. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  239. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  240. </HTTPSamplerProxy>
  241. <hashTree>
  242. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  243. <stringProp name="JSON_PATH">$.source_demo_0_records_in_total</stringProp>
  244. <stringProp name="EXPECTED_VALUE">0</stringProp>
  245. <boolProp name="JSONVALIDATION">true</boolProp>
  246. <boolProp name="EXPECT_NULL">false</boolProp>
  247. <boolProp name="INVERT">false</boolProp>
  248. <boolProp name="ISREGEX">false</boolProp>
  249. </JSONPathAssertion>
  250. <hashTree/>
  251. </hashTree>
  252. <net.xmeter.samplers.PubSampler guiclass="net.xmeter.gui.PubSamplerUI" testclass="net.xmeter.samplers.PubSampler" testname="MQTT_Pub_1" enabled="true">
  253. <stringProp name="mqtt.topic_name">devices/${device_id}/messages</stringProp>
  254. <stringProp name="mqtt.qos_level">0</stringProp>
  255. <boolProp name="mqtt.add_timestamp">false</boolProp>
  256. <stringProp name="mqtt.message_type">String</stringProp>
  257. <stringProp name="mqtt.message_type_fixed_length">1024</stringProp>
  258. <stringProp name="mqtt.message_to_sent">{&quot;temperature&quot;: ${__Random(1,100,)}, &quot;humidity&quot; : ${__Random(1,100,)}}</stringProp>
  259. </net.xmeter.samplers.PubSampler>
  260. <hashTree/>
  261. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="GetRuleStatus" enabled="true">
  262. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  263. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  264. <collectionProp name="Arguments.arguments">
  265. <elementProp name="" elementType="HTTPArgument">
  266. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  267. <stringProp name="Argument.value"></stringProp>
  268. <stringProp name="Argument.metadata">=</stringProp>
  269. </elementProp>
  270. </collectionProp>
  271. </elementProp>
  272. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  273. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  274. <stringProp name="HTTPSampler.protocol"></stringProp>
  275. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  276. <stringProp name="HTTPSampler.path">/rules/rule1/status</stringProp>
  277. <stringProp name="HTTPSampler.method">GET</stringProp>
  278. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  279. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  280. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  281. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  282. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  283. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  284. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  285. </HTTPSamplerProxy>
  286. <hashTree>
  287. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  288. <stringProp name="JSON_PATH">$.source_demo_0_records_in_total</stringProp>
  289. <stringProp name="EXPECTED_VALUE">1</stringProp>
  290. <boolProp name="JSONVALIDATION">true</boolProp>
  291. <boolProp name="EXPECT_NULL">false</boolProp>
  292. <boolProp name="INVERT">false</boolProp>
  293. <boolProp name="ISREGEX">false</boolProp>
  294. </JSONPathAssertion>
  295. <hashTree/>
  296. <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="JSON Assertion" enabled="true">
  297. <stringProp name="JSON_PATH">$.sink_mqtt_0_0_records_in_total</stringProp>
  298. <stringProp name="EXPECTED_VALUE">1</stringProp>
  299. <boolProp name="JSONVALIDATION">true</boolProp>
  300. <boolProp name="EXPECT_NULL">false</boolProp>
  301. <boolProp name="INVERT">false</boolProp>
  302. <boolProp name="ISREGEX">false</boolProp>
  303. </JSONPathAssertion>
  304. <hashTree/>
  305. </hashTree>
  306. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="DropStream" enabled="true">
  307. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  308. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  309. <collectionProp name="Arguments.arguments">
  310. <elementProp name="" elementType="HTTPArgument">
  311. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  312. <stringProp name="Argument.value"></stringProp>
  313. <stringProp name="Argument.metadata">=</stringProp>
  314. </elementProp>
  315. </collectionProp>
  316. </elementProp>
  317. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  318. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  319. <stringProp name="HTTPSampler.protocol"></stringProp>
  320. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  321. <stringProp name="HTTPSampler.path">/streams/demo</stringProp>
  322. <stringProp name="HTTPSampler.method">DELETE</stringProp>
  323. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  324. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  325. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  326. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  327. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  328. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  329. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  330. </HTTPSamplerProxy>
  331. <hashTree>
  332. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  333. <collectionProp name="Asserion.test_strings">
  334. <stringProp name="287881319">Stream demo is dropped.</stringProp>
  335. </collectionProp>
  336. <stringProp name="Assertion.custom_message"></stringProp>
  337. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  338. <boolProp name="Assertion.assume_success">false</boolProp>
  339. <intProp name="Assertion.test_type">16</intProp>
  340. </ResponseAssertion>
  341. <hashTree/>
  342. </hashTree>
  343. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="CreateStream" enabled="true">
  344. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  345. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  346. <collectionProp name="Arguments.arguments">
  347. <elementProp name="" elementType="HTTPArgument">
  348. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  349. <stringProp name="Argument.value">{&#xd;
  350. &quot;sql&quot; : &quot;create stream demo (temperature float, humidity bigint, light bigint) WITH (FORMAT=\&quot;JSON\&quot;, DATASOURCE=\&quot;devices/+/messages\&quot;,STRICT_VALIDATION=\&quot;true\&quot; )&quot;&#xd;
  351. }</stringProp>
  352. <stringProp name="Argument.metadata">=</stringProp>
  353. </elementProp>
  354. </collectionProp>
  355. </elementProp>
  356. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  357. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  358. <stringProp name="HTTPSampler.protocol"></stringProp>
  359. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  360. <stringProp name="HTTPSampler.path">/streams</stringProp>
  361. <stringProp name="HTTPSampler.method">POST</stringProp>
  362. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  363. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  364. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  365. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  366. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  367. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  368. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  369. </HTTPSamplerProxy>
  370. <hashTree>
  371. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  372. <collectionProp name="Asserion.test_strings">
  373. <stringProp name="-1754954177">Stream demo is created.</stringProp>
  374. </collectionProp>
  375. <stringProp name="Assertion.custom_message"></stringProp>
  376. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  377. <boolProp name="Assertion.assume_success">true</boolProp>
  378. <intProp name="Assertion.test_type">16</intProp>
  379. </ResponseAssertion>
  380. <hashTree/>
  381. </hashTree>
  382. <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true">
  383. <stringProp name="ConstantTimer.delay">500</stringProp>
  384. </ConstantTimer>
  385. <hashTree/>
  386. </hashTree>
  387. <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="RedefineStreamAndRun" enabled="true">
  388. <boolProp name="TransactionController.includeTimers">false</boolProp>
  389. <boolProp name="TransactionController.parent">false</boolProp>
  390. </TransactionController>
  391. <hashTree>
  392. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="DropStream" enabled="true">
  393. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  394. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  395. <collectionProp name="Arguments.arguments">
  396. <elementProp name="" elementType="HTTPArgument">
  397. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  398. <stringProp name="Argument.value"></stringProp>
  399. <stringProp name="Argument.metadata">=</stringProp>
  400. </elementProp>
  401. </collectionProp>
  402. </elementProp>
  403. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  404. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  405. <stringProp name="HTTPSampler.protocol"></stringProp>
  406. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  407. <stringProp name="HTTPSampler.path">/streams/demo</stringProp>
  408. <stringProp name="HTTPSampler.method">DELETE</stringProp>
  409. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  410. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  411. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  412. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  413. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  414. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  415. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  416. </HTTPSamplerProxy>
  417. <hashTree>
  418. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  419. <collectionProp name="Asserion.test_strings">
  420. <stringProp name="287881319">Stream demo is dropped.</stringProp>
  421. </collectionProp>
  422. <stringProp name="Assertion.custom_message"></stringProp>
  423. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  424. <boolProp name="Assertion.assume_success">false</boolProp>
  425. <intProp name="Assertion.test_type">16</intProp>
  426. </ResponseAssertion>
  427. <hashTree/>
  428. </hashTree>
  429. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="CreateStream" enabled="true">
  430. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  431. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  432. <collectionProp name="Arguments.arguments">
  433. <elementProp name="" elementType="HTTPArgument">
  434. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  435. <stringProp name="Argument.value">{&#xd;
  436. &quot;sql&quot; : &quot;create stream demo (temperature float, humidity bigint, light bigint) WITH (FORMAT=\&quot;JSON\&quot;, DATASOURCE=\&quot;devices/+/messages\&quot;,STRICT_VALIDATION=\&quot;true\&quot; )&quot;&#xd;
  437. }</stringProp>
  438. <stringProp name="Argument.metadata">=</stringProp>
  439. </elementProp>
  440. </collectionProp>
  441. </elementProp>
  442. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  443. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  444. <stringProp name="HTTPSampler.protocol"></stringProp>
  445. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  446. <stringProp name="HTTPSampler.path">/streams</stringProp>
  447. <stringProp name="HTTPSampler.method">POST</stringProp>
  448. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  449. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  450. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  451. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  452. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  453. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  454. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  455. </HTTPSamplerProxy>
  456. <hashTree>
  457. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  458. <collectionProp name="Asserion.test_strings">
  459. <stringProp name="-1754954177">Stream demo is created.</stringProp>
  460. </collectionProp>
  461. <stringProp name="Assertion.custom_message"></stringProp>
  462. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  463. <boolProp name="Assertion.assume_success">true</boolProp>
  464. <intProp name="Assertion.test_type">16</intProp>
  465. </ResponseAssertion>
  466. <hashTree/>
  467. </hashTree>
  468. <net.xmeter.samplers.PubSampler guiclass="net.xmeter.gui.PubSamplerUI" testclass="net.xmeter.samplers.PubSampler" testname="MQTT_Pub_2" enabled="true">
  469. <stringProp name="mqtt.topic_name">devices/${device_id}/messages</stringProp>
  470. <stringProp name="mqtt.qos_level">0</stringProp>
  471. <boolProp name="mqtt.add_timestamp">false</boolProp>
  472. <stringProp name="mqtt.message_type">String</stringProp>
  473. <stringProp name="mqtt.message_type_fixed_length">1024</stringProp>
  474. <stringProp name="mqtt.message_to_sent">{&quot;temperature&quot;: ${__Random(1,100,)}, &quot;humidity&quot; : ${__Random(1,100,)}, &quot;light&quot; : ${__Random(1,100,)}}</stringProp>
  475. </net.xmeter.samplers.PubSampler>
  476. <hashTree/>
  477. <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true">
  478. <stringProp name="ConstantTimer.delay">500</stringProp>
  479. </ConstantTimer>
  480. <hashTree/>
  481. </hashTree>
  482. <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="RestartRuleAndRun" enabled="true">
  483. <boolProp name="TransactionController.includeTimers">false</boolProp>
  484. <boolProp name="TransactionController.parent">false</boolProp>
  485. </TransactionController>
  486. <hashTree>
  487. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="RestartRule" enabled="true">
  488. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  489. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  490. <collectionProp name="Arguments.arguments">
  491. <elementProp name="" elementType="HTTPArgument">
  492. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  493. <stringProp name="Argument.value"></stringProp>
  494. <stringProp name="Argument.metadata">=</stringProp>
  495. </elementProp>
  496. </collectionProp>
  497. </elementProp>
  498. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  499. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  500. <stringProp name="HTTPSampler.protocol"></stringProp>
  501. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  502. <stringProp name="HTTPSampler.path">/rules/rule1/restart</stringProp>
  503. <stringProp name="HTTPSampler.method">POST</stringProp>
  504. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  505. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  506. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  507. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  508. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  509. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  510. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  511. </HTTPSamplerProxy>
  512. <hashTree>
  513. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  514. <collectionProp name="Asserion.test_strings">
  515. <stringProp name="-167686328">Rule rule1 was restarted</stringProp>
  516. </collectionProp>
  517. <stringProp name="Assertion.custom_message"></stringProp>
  518. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  519. <boolProp name="Assertion.assume_success">false</boolProp>
  520. <intProp name="Assertion.test_type">16</intProp>
  521. </ResponseAssertion>
  522. <hashTree/>
  523. </hashTree>
  524. <net.xmeter.samplers.PubSampler guiclass="net.xmeter.gui.PubSamplerUI" testclass="net.xmeter.samplers.PubSampler" testname="MQTT_Pub_3" enabled="true">
  525. <stringProp name="mqtt.topic_name">devices/${device_id}/messages</stringProp>
  526. <stringProp name="mqtt.qos_level">0</stringProp>
  527. <boolProp name="mqtt.add_timestamp">false</boolProp>
  528. <stringProp name="mqtt.message_type">String</stringProp>
  529. <stringProp name="mqtt.message_type_fixed_length">1024</stringProp>
  530. <stringProp name="mqtt.message_to_sent">{&quot;temperature&quot;: ${__Random(1,100,)}, &quot;humidity&quot; : ${__Random(1,100,)}, &quot;light&quot; : ${__Random(1,100,)}}</stringProp>
  531. </net.xmeter.samplers.PubSampler>
  532. <hashTree/>
  533. <ConstantTimer guiclass="ConstantTimerGui" testclass="ConstantTimer" testname="Constant Timer" enabled="true">
  534. <stringProp name="ConstantTimer.delay">500</stringProp>
  535. </ConstantTimer>
  536. <hashTree/>
  537. </hashTree>
  538. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="DropStream" enabled="true">
  539. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  540. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  541. <collectionProp name="Arguments.arguments">
  542. <elementProp name="" elementType="HTTPArgument">
  543. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  544. <stringProp name="Argument.value"></stringProp>
  545. <stringProp name="Argument.metadata">=</stringProp>
  546. </elementProp>
  547. </collectionProp>
  548. </elementProp>
  549. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  550. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  551. <stringProp name="HTTPSampler.protocol"></stringProp>
  552. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  553. <stringProp name="HTTPSampler.path">/streams/demo</stringProp>
  554. <stringProp name="HTTPSampler.method">DELETE</stringProp>
  555. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  556. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  557. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  558. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  559. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  560. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  561. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  562. </HTTPSamplerProxy>
  563. <hashTree>
  564. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  565. <collectionProp name="Asserion.test_strings">
  566. <stringProp name="287881319">Stream demo is dropped.</stringProp>
  567. </collectionProp>
  568. <stringProp name="Assertion.custom_message"></stringProp>
  569. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  570. <boolProp name="Assertion.assume_success">false</boolProp>
  571. <intProp name="Assertion.test_type">16</intProp>
  572. </ResponseAssertion>
  573. <hashTree/>
  574. </hashTree>
  575. <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="DropRule" enabled="true">
  576. <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  577. <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  578. <collectionProp name="Arguments.arguments">
  579. <elementProp name="" elementType="HTTPArgument">
  580. <boolProp name="HTTPArgument.always_encode">false</boolProp>
  581. <stringProp name="Argument.value"></stringProp>
  582. <stringProp name="Argument.metadata">=</stringProp>
  583. </elementProp>
  584. </collectionProp>
  585. </elementProp>
  586. <stringProp name="HTTPSampler.domain">${srv}</stringProp>
  587. <stringProp name="HTTPSampler.port">${rest_port}</stringProp>
  588. <stringProp name="HTTPSampler.protocol"></stringProp>
  589. <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  590. <stringProp name="HTTPSampler.path">/rules/rule1</stringProp>
  591. <stringProp name="HTTPSampler.method">DELETE</stringProp>
  592. <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  593. <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  594. <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  595. <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  596. <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  597. <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  598. <stringProp name="HTTPSampler.response_timeout"></stringProp>
  599. </HTTPSamplerProxy>
  600. <hashTree>
  601. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  602. <collectionProp name="Asserion.test_strings">
  603. <stringProp name="717250485">Rule rule1 is dropped.</stringProp>
  604. </collectionProp>
  605. <stringProp name="Assertion.custom_message"></stringProp>
  606. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  607. <boolProp name="Assertion.assume_success">false</boolProp>
  608. <intProp name="Assertion.test_type">16</intProp>
  609. </ResponseAssertion>
  610. <hashTree/>
  611. </hashTree>
  612. </hashTree>
  613. <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Result" enabled="true">
  614. <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
  615. <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
  616. <boolProp name="LoopController.continue_forever">false</boolProp>
  617. <stringProp name="LoopController.loops">3</stringProp>
  618. </elementProp>
  619. <stringProp name="ThreadGroup.num_threads">1</stringProp>
  620. <stringProp name="ThreadGroup.ramp_time">1</stringProp>
  621. <boolProp name="ThreadGroup.scheduler">false</boolProp>
  622. <stringProp name="ThreadGroup.duration"></stringProp>
  623. <stringProp name="ThreadGroup.delay"></stringProp>
  624. </ThreadGroup>
  625. <hashTree>
  626. <CSVDataSet guiclass="TestBeanGUI" testclass="CSVDataSet" testname="CSV Data Set Config" enabled="true">
  627. <stringProp name="filename">change_stream_rule.txt</stringProp>
  628. <stringProp name="fileEncoding"></stringProp>
  629. <stringProp name="variableNames">result</stringProp>
  630. <boolProp name="ignoreFirstLine">false</boolProp>
  631. <stringProp name="delimiter">,</stringProp>
  632. <boolProp name="quotedData">false</boolProp>
  633. <boolProp name="recycle">true</boolProp>
  634. <boolProp name="stopThread">false</boolProp>
  635. <stringProp name="shareMode">shareMode.all</stringProp>
  636. </CSVDataSet>
  637. <hashTree/>
  638. <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
  639. <boolProp name="ResultCollector.error_logging">false</boolProp>
  640. <objProp>
  641. <name>saveConfig</name>
  642. <value class="SampleSaveConfiguration">
  643. <time>true</time>
  644. <latency>true</latency>
  645. <timestamp>true</timestamp>
  646. <success>true</success>
  647. <label>true</label>
  648. <code>true</code>
  649. <message>true</message>
  650. <threadName>true</threadName>
  651. <dataType>true</dataType>
  652. <encoding>false</encoding>
  653. <assertions>true</assertions>
  654. <subresults>true</subresults>
  655. <responseData>false</responseData>
  656. <samplerData>false</samplerData>
  657. <xml>false</xml>
  658. <fieldNames>true</fieldNames>
  659. <responseHeaders>false</responseHeaders>
  660. <requestHeaders>false</requestHeaders>
  661. <responseDataOnError>false</responseDataOnError>
  662. <saveAssertionResultsFailureMessage>true</saveAssertionResultsFailureMessage>
  663. <assertionsResultsToSave>0</assertionsResultsToSave>
  664. <bytes>true</bytes>
  665. <sentBytes>true</sentBytes>
  666. <threadCounts>true</threadCounts>
  667. <idleTime>true</idleTime>
  668. <connectTime>true</connectTime>
  669. </value>
  670. </objProp>
  671. <stringProp name="filename"></stringProp>
  672. </ResultCollector>
  673. <hashTree/>
  674. <OnceOnlyController guiclass="OnceOnlyControllerGui" testclass="OnceOnlyController" testname="Once Only Controller" enabled="true"/>
  675. <hashTree>
  676. <net.xmeter.samplers.ConnectSampler guiclass="net.xmeter.gui.ConnectSamplerUI" testclass="net.xmeter.samplers.ConnectSampler" testname="MQTT Connect" enabled="true">
  677. <stringProp name="mqtt.server">${mqtt_srv}</stringProp>
  678. <stringProp name="mqtt.port">1883</stringProp>
  679. <stringProp name="mqtt.version">3.1</stringProp>
  680. <stringProp name="mqtt.conn_timeout">10</stringProp>
  681. <boolProp name="mqtt.private_protocol">false</boolProp>
  682. <stringProp name="mqtt.listener_timeout">10</stringProp>
  683. <stringProp name="mqtt.protocol">TCP</stringProp>
  684. <boolProp name="mqtt.dual_ssl_authentication">false</boolProp>
  685. <stringProp name="mqtt.keystore_file_path"></stringProp>
  686. <stringProp name="mqtt.keystore_password"></stringProp>
  687. <stringProp name="mqtt.clientcert_file_path"></stringProp>
  688. <stringProp name="mqtt.clientcert_password"></stringProp>
  689. <stringProp name="mqtt.user_name"></stringProp>
  690. <stringProp name="mqtt.password"></stringProp>
  691. <stringProp name="mqtt.client_id_prefix">conn_</stringProp>
  692. <boolProp name="mqtt.client_id_suffix">true</boolProp>
  693. <stringProp name="mqtt.conn_keep_alive">300</stringProp>
  694. <stringProp name="mqtt.conn_attampt_max">0</stringProp>
  695. <stringProp name="mqtt.reconn_attampt_max">0</stringProp>
  696. </net.xmeter.samplers.ConnectSampler>
  697. <hashTree/>
  698. </hashTree>
  699. <net.xmeter.samplers.SubSampler guiclass="net.xmeter.gui.SubSamplerUI" testclass="net.xmeter.samplers.SubSampler" testname="AnalysisResult" enabled="true">
  700. <stringProp name="mqtt.topic_name">devices/result</stringProp>
  701. <stringProp name="mqtt.qos_level">0</stringProp>
  702. <boolProp name="mqtt.add_timestamp">false</boolProp>
  703. <boolProp name="mqtt.debug_response">true</boolProp>
  704. <stringProp name="mqtt.sample_condition">number of received messages</stringProp>
  705. <stringProp name="mqtt.sample_condition_value">1</stringProp>
  706. </net.xmeter.samplers.SubSampler>
  707. <hashTree>
  708. <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="Response Assertion" enabled="true">
  709. <collectionProp name="Asserion.test_strings">
  710. <stringProp name="71001929">${result}</stringProp>
  711. </collectionProp>
  712. <stringProp name="Assertion.custom_message"></stringProp>
  713. <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  714. <boolProp name="Assertion.assume_success">false</boolProp>
  715. <intProp name="Assertion.test_type">16</intProp>
  716. </ResponseAssertion>
  717. <hashTree/>
  718. </hashTree>
  719. </hashTree>
  720. </hashTree>
  721. </hashTree>
  722. </jmeterTestPlan>