select_countwindow_rule.jmx 56 KB

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