Authored by Rong

commit by shell

@@ -204,7 +204,7 @@ @@ -204,7 +204,7 @@
204 <stringProp name="shareMode">shareMode.all</stringProp> 204 <stringProp name="shareMode">shareMode.all</stringProp>
205 </CSVDataSet> 205 </CSVDataSet>
206 <hashTree/> 206 <hashTree/>
207 - <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_web_product_shopRecommend" enabled="true"> 207 + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_newproduct_recbrand" enabled="true">
208 <stringProp name="ThreadGroup.on_sample_error">continue</stringProp> 208 <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
209 <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true"> 209 <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
210 <boolProp name="LoopController.continue_forever">false</boolProp> 210 <boolProp name="LoopController.continue_forever">false</boolProp>
@@ -217,10 +217,10 @@ @@ -217,10 +217,10 @@
217 <boolProp name="ThreadGroup.scheduler">false</boolProp> 217 <boolProp name="ThreadGroup.scheduler">false</boolProp>
218 <stringProp name="ThreadGroup.duration"></stringProp> 218 <stringProp name="ThreadGroup.duration"></stringProp>
219 <stringProp name="ThreadGroup.delay"></stringProp> 219 <stringProp name="ThreadGroup.delay"></stringProp>
220 - <stringProp name="TestPlan.comments">&#21830;&#21697;&#35814;&#24773;&#39029;&#24213;&#37096;&#24215;&#38138;&#25512;&#33616;(&#25552;&#20379;&#32473;web&#20351;&#29992;)</stringProp> 220 + <stringProp name="TestPlan.comments">&#26032;&#21697;&#21040;&#30528;&#25512;&#33616;&#21697;&#29260;</stringProp>
221 </ThreadGroup> 221 </ThreadGroup>
222 <hashTree> 222 <hashTree>
223 - <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_web_product_shopRecommend" enabled="true"> 223 + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_newproduct_recbrand" enabled="true">
224 <boolProp name="HTTPSampler.postBodyRaw">true</boolProp> 224 <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
225 <elementProp name="HTTPsampler.Arguments" elementType="Arguments"> 225 <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
226 <collectionProp name="Arguments.arguments"> 226 <collectionProp name="Arguments.arguments">
@@ -245,13 +245,13 @@ @@ -245,13 +245,13 @@
245 <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp> 245 <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
246 <boolProp name="HTTPSampler.monitor">false</boolProp> 246 <boolProp name="HTTPSampler.monitor">false</boolProp>
247 <stringProp name="HTTPSampler.embedded_url_re"></stringProp> 247 <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
248 - <stringProp name="TestPlan.comments">&#21830;&#21697;&#35814;&#24773;&#39029;&#24213;&#37096;&#24215;&#38138;&#25512;&#33616;(&#25552;&#20379;&#32473;web&#20351;&#29992;)</stringProp> 248 + <stringProp name="TestPlan.comments">&#26032;&#21697;&#21040;&#30528;&#25512;&#33616;&#21697;&#29260;</stringProp>
249 </HTTPSamplerProxy> 249 </HTTPSamplerProxy>
250 <hashTree> 250 <hashTree>
251 <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="&#21069;&#32622;BeanShell" enabled="true"> 251 <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="&#21069;&#32622;BeanShell" enabled="true">
252 <stringProp name="TestPlan.comments"></stringProp> 252 <stringProp name="TestPlan.comments"></stringProp>
253 <boolProp name="resetInterpreter">false</boolProp> 253 <boolProp name="resetInterpreter">false</boolProp>
254 - <stringProp name="parameters">${product_skn}</stringProp> 254 + <stringProp name="parameters">${uid}</stringProp>
255 <stringProp name="filename"></stringProp> 255 <stringProp name="filename"></stringProp>
256 <stringProp name="script">import java.security.MessageDigest; 256 <stringProp name="script">import java.security.MessageDigest;
257 import java.util.Random; 257 import java.util.Random;
@@ -260,8 +260,204 @@ String[] privateKeys = {&quot;fd4ad5fcfa0de589ef238c0e7331b585&quot;}; @@ -260,8 +260,204 @@ String[] privateKeys = {&quot;fd4ad5fcfa0de589ef238c0e7331b585&quot;};
260 int rd = new Random().nextInt(1); 260 int rd = new Random().nextInt(1);
261 String clientType = clientTypes[rd]; 261 String clientType = clientTypes[rd];
262 String privateKey = privateKeys[rd]; 262 String privateKey = privateKeys[rd];
263 -String os_version = &quot;yohobuy:web&quot;;  
264 -String req = &quot;app_version=5.8.0&amp;client_type=&quot;+clientType+&quot;&amp;limit=20&amp;method=web.product.shopRecommend&amp;os_version=&quot;+os_version+&quot;&amp;page=1&amp;private_key=&quot;+privateKey+&quot;&amp;product_skn=&quot;+bsh.args[0]+&quot;&amp;screen_size=720x1280&amp;v=7&quot;; 263 +
  264 +String req = &quot;app_version=5.8.1&amp;client_type=&quot;+clientType+&quot;&amp;limit=60&amp;method=app.newproduct.recbrand&amp;os_version=10.3.2&amp;page=1&amp;physical_channel=1&amp;private_key=&quot;+privateKey+&quot;&amp;screen_size=414x736&amp;session_key=437f86ad70b9832a1884c357b96e8ffe&amp;udid=fc2fdedc84327f14de31f79adbcd0de61fad0afd&amp;uid=&quot;+bsh.args[0]+&quot;&amp;v=7&amp;yh_channel=1&quot;;
  265 +MessageDigest md = MessageDigest.getInstance(&quot;MD5&quot;);
  266 +byte[] btInput = req.getBytes();
  267 +md.update(btInput);
  268 +byte[] btResult = md.digest();
  269 +StringBuffer sb = new StringBuffer();
  270 +for(byte b : btResult){
  271 + int bt = b&amp;0xff;
  272 + if(bt&lt;16){
  273 + sb.append(0);
  274 + }
  275 + sb.append(Integer.toHexString(bt));
  276 +}
  277 +String md5 = sb.toString();
  278 +
  279 +
  280 +vars.put(&quot;searchValue&quot;,req+&quot;&amp;client_secret=&quot;+md5);</stringProp>
  281 + </BeanShellPreProcessor>
  282 + <hashTree/>
  283 + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="&#21709;&#24212;&#26029;&#35328;" enabled="true">
  284 + <collectionProp name="Asserion.test_strings">
  285 + <stringProp name="1450572480">&quot;code&quot;:200</stringProp>
  286 + </collectionProp>
  287 + <stringProp name="TestPlan.comments"></stringProp>
  288 + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  289 + <boolProp name="Assertion.assume_success">false</boolProp>
  290 + <intProp name="Assertion.test_type">16</intProp>
  291 + </ResponseAssertion>
  292 + <hashTree/>
  293 + </hashTree>
  294 + <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="&#22266;&#23450;TPM" enabled="true">
  295 + <stringProp name="TestPlan.comments"></stringProp>
  296 + <doubleProp>
  297 + <name>throughput</name>
  298 + <value>60000</value>
  299 + <savedValue>0.0</savedValue>
  300 + </doubleProp>
  301 + <intProp name="calcMode">2</intProp>
  302 + </ConstantThroughputTimer>
  303 + <hashTree/>
  304 + </hashTree>
  305 + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_newproduct_reclist" enabled="true">
  306 + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
  307 + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
  308 + <boolProp name="LoopController.continue_forever">false</boolProp>
  309 + <intProp name="LoopController.loops">-1</intProp>
  310 + </elementProp>
  311 + <stringProp name="ThreadGroup.num_threads">100</stringProp>
  312 + <stringProp name="ThreadGroup.ramp_time">10</stringProp>
  313 + <longProp name="ThreadGroup.start_time">1488865571000</longProp>
  314 + <longProp name="ThreadGroup.end_time">1488865571000</longProp>
  315 + <boolProp name="ThreadGroup.scheduler">false</boolProp>
  316 + <stringProp name="ThreadGroup.duration"></stringProp>
  317 + <stringProp name="ThreadGroup.delay"></stringProp>
  318 + <stringProp name="TestPlan.comments">&#26032;&#21697;&#21040;&#30528;&#25512;&#33616;&#21830;&#21697;&#21015;&#34920;</stringProp>
  319 + </ThreadGroup>
  320 + <hashTree>
  321 + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_newproduct_reclist" enabled="true">
  322 + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  323 + <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  324 + <collectionProp name="Arguments.arguments">
  325 + <elementProp name="" elementType="HTTPArgument">
  326 + <boolProp name="HTTPArgument.always_encode">false</boolProp>
  327 + <stringProp name="Argument.value"></stringProp>
  328 + <stringProp name="Argument.metadata">=</stringProp>
  329 + </elementProp>
  330 + </collectionProp>
  331 + </elementProp>
  332 + <stringProp name="HTTPSampler.domain"></stringProp>
  333 + <stringProp name="HTTPSampler.port"></stringProp>
  334 + <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  335 + <stringProp name="HTTPSampler.response_timeout"></stringProp>
  336 + <stringProp name="HTTPSampler.protocol"></stringProp>
  337 + <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  338 + <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
  339 + <stringProp name="HTTPSampler.method">GET</stringProp>
  340 + <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  341 + <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  342 + <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  343 + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  344 + <boolProp name="HTTPSampler.monitor">false</boolProp>
  345 + <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  346 + <stringProp name="TestPlan.comments">&#26032;&#21697;&#21040;&#30528;&#25512;&#33616;&#21830;&#21697;&#21015;&#34920;</stringProp>
  347 + </HTTPSamplerProxy>
  348 + <hashTree>
  349 + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="&#21069;&#32622;BeanShell" enabled="true">
  350 + <stringProp name="TestPlan.comments"></stringProp>
  351 + <boolProp name="resetInterpreter">false</boolProp>
  352 + <stringProp name="parameters">${uid}</stringProp>
  353 + <stringProp name="filename"></stringProp>
  354 + <stringProp name="script">import java.security.MessageDigest;
  355 +import java.util.Random;
  356 +String[] clientTypes = {&quot;android&quot;};
  357 +String[] privateKeys = {&quot;fd4ad5fcfa0de589ef238c0e7331b585&quot;};
  358 +int rd = new Random().nextInt(1);
  359 +String clientType = clientTypes[rd];
  360 +String privateKey = privateKeys[rd];
  361 +String os_version = &quot;android5.1.1:Redmi_Note_3&quot;;
  362 +String req = &quot;app_version=5.8.1&amp;client_type=&quot;+clientType+&quot;&amp;gender=1,3&amp;limit=20&amp;method=app.newproduct.reclist&amp;order=&amp;os_version=&quot;+os_version+&quot;&amp;page=1&amp;physical_channel=1&amp;private_key=&quot;+privateKey+&quot;&amp;screen_size=1080x1920&amp;session_key=7ddadfafd388aba86ff13f0d51adf591&amp;udid=8610840369852596e0de9aef48b93f6&amp;uid=&quot;+bsh.args[0]+&quot;&amp;v=7&amp;yh_channel=1&quot;;
  363 +MessageDigest md = MessageDigest.getInstance(&quot;MD5&quot;);
  364 +byte[] btInput = req.getBytes();
  365 +md.update(btInput);
  366 +byte[] btResult = md.digest();
  367 +StringBuffer sb = new StringBuffer();
  368 +for(byte b : btResult){
  369 + int bt = b&amp;0xff;
  370 + if(bt&lt;16){
  371 + sb.append(0);
  372 + }
  373 + sb.append(Integer.toHexString(bt));
  374 +}
  375 +String md5 = sb.toString();
  376 +os_version=URLEncoder.encode(os_version);
  377 +req = &quot;app_version=5.8.1&amp;client_type=&quot;+clientType+&quot;&amp;gender=1,3&amp;limit=20&amp;method=app.newproduct.reclist&amp;order=&amp;os_version=&quot;+os_version+&quot;&amp;page=1&amp;physical_channel=1&amp;private_key=&quot;+privateKey+&quot;&amp;screen_size=1080x1920&amp;session_key=7ddadfafd388aba86ff13f0d51adf591&amp;udid=8610840369852596e0de9aef48b93f6&amp;uid=&quot;+bsh.args[0]+&quot;&amp;v=7&amp;yh_channel=1&quot;;
  378 +vars.put(&quot;searchValue&quot;,req+&quot;&amp;client_secret=&quot;+md5);</stringProp>
  379 + </BeanShellPreProcessor>
  380 + <hashTree/>
  381 + <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="&#21709;&#24212;&#26029;&#35328;" enabled="true">
  382 + <collectionProp name="Asserion.test_strings">
  383 + <stringProp name="1450572480">&quot;code&quot;:200</stringProp>
  384 + </collectionProp>
  385 + <stringProp name="TestPlan.comments"></stringProp>
  386 + <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
  387 + <boolProp name="Assertion.assume_success">false</boolProp>
  388 + <intProp name="Assertion.test_type">16</intProp>
  389 + </ResponseAssertion>
  390 + <hashTree/>
  391 + </hashTree>
  392 + <ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="&#22266;&#23450;TPM" enabled="true">
  393 + <stringProp name="TestPlan.comments"></stringProp>
  394 + <doubleProp>
  395 + <name>throughput</name>
  396 + <value>60000</value>
  397 + <savedValue>0.0</savedValue>
  398 + </doubleProp>
  399 + <intProp name="calcMode">2</intProp>
  400 + </ConstantThroughputTimer>
  401 + <hashTree/>
  402 + </hashTree>
  403 + <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="tg_app_newproduct_recshop" enabled="true">
  404 + <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
  405 + <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="循环控制器" enabled="true">
  406 + <boolProp name="LoopController.continue_forever">false</boolProp>
  407 + <intProp name="LoopController.loops">-1</intProp>
  408 + </elementProp>
  409 + <stringProp name="ThreadGroup.num_threads">100</stringProp>
  410 + <stringProp name="ThreadGroup.ramp_time">10</stringProp>
  411 + <longProp name="ThreadGroup.start_time">1488865571000</longProp>
  412 + <longProp name="ThreadGroup.end_time">1488865571000</longProp>
  413 + <boolProp name="ThreadGroup.scheduler">false</boolProp>
  414 + <stringProp name="ThreadGroup.duration"></stringProp>
  415 + <stringProp name="ThreadGroup.delay"></stringProp>
  416 + <stringProp name="TestPlan.comments">&#26032;&#21697;&#21040;&#30528;&#25512;&#33616;&#24215;&#38138;</stringProp>
  417 + </ThreadGroup>
  418 + <hashTree>
  419 + <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_app_newproduct_recshop" enabled="true">
  420 + <boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
  421 + <elementProp name="HTTPsampler.Arguments" elementType="Arguments">
  422 + <collectionProp name="Arguments.arguments">
  423 + <elementProp name="" elementType="HTTPArgument">
  424 + <boolProp name="HTTPArgument.always_encode">false</boolProp>
  425 + <stringProp name="Argument.value"></stringProp>
  426 + <stringProp name="Argument.metadata">=</stringProp>
  427 + </elementProp>
  428 + </collectionProp>
  429 + </elementProp>
  430 + <stringProp name="HTTPSampler.domain"></stringProp>
  431 + <stringProp name="HTTPSampler.port"></stringProp>
  432 + <stringProp name="HTTPSampler.connect_timeout"></stringProp>
  433 + <stringProp name="HTTPSampler.response_timeout"></stringProp>
  434 + <stringProp name="HTTPSampler.protocol"></stringProp>
  435 + <stringProp name="HTTPSampler.contentEncoding"></stringProp>
  436 + <stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
  437 + <stringProp name="HTTPSampler.method">GET</stringProp>
  438 + <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
  439 + <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
  440 + <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
  441 + <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
  442 + <boolProp name="HTTPSampler.monitor">false</boolProp>
  443 + <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
  444 + <stringProp name="TestPlan.comments">&#26032;&#21697;&#21040;&#30528;&#25512;&#33616;&#24215;&#38138;</stringProp>
  445 + </HTTPSamplerProxy>
  446 + <hashTree>
  447 + <BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="&#21069;&#32622;BeanShell" enabled="true">
  448 + <stringProp name="TestPlan.comments"></stringProp>
  449 + <boolProp name="resetInterpreter">false</boolProp>
  450 + <stringProp name="parameters">${uid}</stringProp>
  451 + <stringProp name="filename"></stringProp>
  452 + <stringProp name="script">import java.security.MessageDigest;
  453 +import java.util.Random;
  454 +String[] clientTypes = {&quot;android&quot;};
  455 +String[] privateKeys = {&quot;fd4ad5fcfa0de589ef238c0e7331b585&quot;};
  456 +int rd = new Random().nextInt(1);
  457 +String clientType = clientTypes[rd];
  458 +String privateKey = privateKeys[rd];
  459 +String os_version = &quot;android5.1.1:Redmi_Note_3&quot;;
  460 +String req = &quot;app_version=5.8.1&amp;client_type=&quot;+clientType+&quot;&amp;contentCode=1f2e07cb63811680154ba693c954dd62&amp;gender=1,3&amp;limit=10&amp;method=app.newproduct.recshop&amp;os_version=&quot;+os_version+&quot;&amp;page=1&amp;physical_channel=1&amp;private_key=&quot;+privateKey+&quot;&amp;screen_size=1080x1920&amp;session_key=7ddadfafd388aba86ff13f0d51adf591&amp;udid=8610840369852596e0de9aef48b93f6&amp;uid=&quot;+bsh.args[0]+&quot;&amp;v=7&amp;yh_channel=1&quot;;
265 MessageDigest md = MessageDigest.getInstance(&quot;MD5&quot;); 461 MessageDigest md = MessageDigest.getInstance(&quot;MD5&quot;);
266 byte[] btInput = req.getBytes(); 462 byte[] btInput = req.getBytes();
267 md.update(btInput); 463 md.update(btInput);
@@ -276,7 +472,7 @@ for(byte b : btResult){ @@ -276,7 +472,7 @@ for(byte b : btResult){
276 } 472 }
277 String md5 = sb.toString(); 473 String md5 = sb.toString();
278 os_version=URLEncoder.encode(os_version); 474 os_version=URLEncoder.encode(os_version);
279 -req = &quot;app_version=5.8.0&amp;client_type=&quot;+clientType+&quot;&amp;limit=20&amp;method=web.product.shopRecommend&amp;os_version=&quot;+os_version+&quot;&amp;page=1&amp;private_key=&quot;+privateKey+&quot;&amp;product_skn=&quot;+bsh.args[0]+&quot;&amp;screen_size=720x1280&amp;v=7&quot;; 475 +req = &quot;app_version=5.8.1&amp;client_type=&quot;+clientType+&quot;&amp;contentCode=1f2e07cb63811680154ba693c954dd62&amp;gender=1,3&amp;limit=10&amp;method=app.newproduct.recshop&amp;os_version=&quot;+os_version+&quot;&amp;page=1&amp;physical_channel=1&amp;private_key=&quot;+privateKey+&quot;&amp;screen_size=1080x1920&amp;session_key=7ddadfafd388aba86ff13f0d51adf591&amp;udid=8610840369852596e0de9aef48b93f6&amp;uid=&quot;+bsh.args[0]+&quot;&amp;v=7&amp;yh_channel=1&quot;;
280 vars.put(&quot;searchValue&quot;,req+&quot;&amp;client_secret=&quot;+md5);</stringProp> 476 vars.put(&quot;searchValue&quot;,req+&quot;&amp;client_secret=&quot;+md5);</stringProp>
281 </BeanShellPreProcessor> 477 </BeanShellPreProcessor>
282 <hashTree/> 478 <hashTree/>