Authored by Rong

commit by shell

@@ -60,7 +60,7 @@ @@ -60,7 +60,7 @@
60 <boolProp name="ignoreFirstLine">false</boolProp> 60 <boolProp name="ignoreFirstLine">false</boolProp>
61 </CSVDataSet> 61 </CSVDataSet>
62 <hashTree/> 62 <hashTree/>
63 - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="购物车-编辑add" enabled="true"> 63 + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="购物车add-select" enabled="true">
64 <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> 64 <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
65 <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> 65 <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
66 <boolProp name="LoopController.continue_forever">false</boolProp> 66 <boolProp name="LoopController.continue_forever">false</boolProp>
@@ -188,6 +188,86 @@ vars.put(&quot;searchValue&quot;,req+&quot;&amp;client_secret=&quot;+md5code); @@ -188,6 +188,86 @@ vars.put(&quot;searchValue&quot;,req+&quot;&amp;client_secret=&quot;+md5code);
188 </ResponseAssertion> 188 </ResponseAssertion>
189 <hashTree/> 189 <hashTree/>
190 </hashTree> 190 </hashTree>
  191 + <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="Constant Throughput Timer" enabled="true">
  192 + <intProp name="calcMode">2</intProp>
  193 + <doubleProp>
  194 + <name>throughput</name>
  195 + <value>150000.0</value>
  196 + <savedValue>0.0</savedValue>
  197 + </doubleProp>
  198 + </ConstantThroughputTimer>
  199 + <hashTree/>
  200 + </hashTree>
  201 + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="购物车add-remove" enabled="true">
  202 + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
  203 + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
  204 + <boolProp name="LoopController.continue_forever">false</boolProp>
  205 + <intProp name="LoopController.loops">-1</intProp>
  206 + </elementProp>
  207 + <stringProp name="ThreadGroup.num_threads">150</stringProp>
  208 + <stringProp name="ThreadGroup.ramp_time">10</stringProp>
  209 + <longProp name="ThreadGroup.start_time">1501638755000</longProp>
  210 + <longProp name="ThreadGroup.end_time">1501638755000</longProp>
  211 + <boolProp name="ThreadGroup.scheduler">false</boolProp>
  212 + <stringProp name="ThreadGroup.duration"></stringProp>
  213 + <stringProp name="ThreadGroup.delay"></stringProp>
  214 + </ThreadGroup>
  215 + <hashTree>
  216 + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_add" enabled="true">
  217 + <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
  218 + <collectionProp name="Arguments.arguments"/>
  219 + </elementProp>
  220 + <stringProp name="HTTPSampler.domain"></stringProp>
  221 + <stringProp name="HTTPSampler.port"></stringProp>
  222 + <stringProp name="HTTPSampler.protocol"></stringProp>
  223 + <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  224 + <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
  225 + <stringProp name="HTTPSampler.method">GET</stringProp>
  226 + <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  227 + <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  228 + <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  229 + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  230 + <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  231 + <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  232 + <stringProp name="HTTPSampler.response_timeout"></stringProp>
  233 + </HTTPSamplerProxy>
  234 + <hashTree>
  235 + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="前置MD5" enabled="true">
  236 + <stringProp name="filename"></stringProp>
  237 + <stringProp name="parameters">${uid_cart_edit} ${shopping_key_edit} ${sku_edit}</stringProp>
  238 + <boolProp name="resetInterpreter">false</boolProp>
  239 + <stringProp name="script">import java.security.MessageDigest;
  240 +
  241 +String req = &quot;app_version=5.8.0&amp;buy_number=1&amp;client_type=test&amp;edit_product_sku=0&amp;goods_type=0&amp;method=app.Shopping.add&amp;os_version=yohobuy:web&amp;private_key=fd4ad5fcfa0de589ef238c0e7331b585&amp;product_sku=&quot;+bsh.args[2]+&quot;&amp;promotion_id=&amp;screen_size=720x1280&amp;selected=Y&amp;session_key=5103fd2c7217459929865c1da6aa7f5a&amp;shopping_key=&quot;+bsh.args[1]+&quot;&amp;uid=&quot;+bsh.args[0]+&quot;&amp;v=7&quot;;
  242 +
  243 +MessageDigest md = MessageDigest.getInstance(&quot;MD5&quot;);
  244 +byte[] btInput = req.getBytes();
  245 +md.update(btInput);
  246 +byte[] btResult = md.digest();
  247 +
  248 +StringBuffer sb = new StringBuffer();
  249 +for(byte b : btResult){
  250 + int bt = b&amp;0xff;
  251 + if(bt&lt;16){
  252 + sb.append(0);
  253 + }
  254 + sb.append(Integer.toHexString(bt));
  255 +}
  256 +String md5Str = sb.toString();
  257 +vars.put(&quot;searchValue&quot;,req+&quot;&amp;client_secret=&quot;+md5Str);
  258 +</stringProp>
  259 + </BeanShellPreProcessor>
  260 + <hashTree/>
  261 + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
  262 + <collectionProp name="Asserion.test_strings">
  263 + <stringProp name="723337899">&quot;code&quot;:200</stringProp>
  264 + </collectionProp>
  265 + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  266 + <boolProp name="Assertion.assume_success">false</boolProp>
  267 + <intProp name="Assertion.test_type">16</intProp>
  268 + </ResponseAssertion>
  269 + <hashTree/>
  270 + </hashTree>
191 <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_removeAndCart" enabled="true"> 271 <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_Shopping_removeAndCart" enabled="true">
192 <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> 272 <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
193 <collectionProp name="Arguments.arguments"/> 273 <collectionProp name="Arguments.arguments"/>
@@ -249,13 +329,13 @@ vars.put(&quot;searchValue&quot;,req+&quot;&amp;client_secret=&quot;+md5code);</ @@ -249,13 +329,13 @@ vars.put(&quot;searchValue&quot;,req+&quot;&amp;client_secret=&quot;+md5code);</
249 <intProp name="calcMode">2</intProp> 329 <intProp name="calcMode">2</intProp>
250 <doubleProp> 330 <doubleProp>
251 <name>throughput</name> 331 <name>throughput</name>
252 - <value>150000.0</value> 332 + <value>3000.0</value>
253 <savedValue>0.0</savedValue> 333 <savedValue>0.0</savedValue>
254 </doubleProp> 334 </doubleProp>
255 </ConstantThroughputTimer> 335 </ConstantThroughputTimer>
256 <hashTree/> 336 <hashTree/>
257 </hashTree> 337 </hashTree>
258 - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="购物车-编辑inc" enabled="true"> 338 + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="购物车add-inc" enabled="true">
259 <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> 339 <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
260 <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> 340 <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
261 <boolProp name="LoopController.continue_forever">false</boolProp> 341 <boolProp name="LoopController.continue_forever">false</boolProp>