Authored by Rong

commit by shell

... ... @@ -463,12 +463,83 @@ vars.put(&quot;searchValue&quot;,req+&quot;&amp;client_secret=&quot;+md5);</stri
</ResponseAssertion>
<hashTree/>
</hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="child_tc_app_ShoppingForOffline_remove" enabled="true">
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
<collectionProp name="Arguments.arguments">
<elementProp name="" elementType="HTTPArgument">
<boolProp name="HTTPArgument.always_encode">false</boolProp>
<stringProp name="Argument.value"></stringProp>
<stringProp name="Argument.metadata">=</stringProp>
</elementProp>
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.domain"></stringProp>
<stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.connect_timeout"></stringProp>
<stringProp name="HTTPSampler.response_timeout"></stringProp>
<stringProp name="HTTPSampler.protocol"></stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">http://${HOST_API}/?${searchValue}</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp>
<boolProp name="HTTPSampler.use_keepalive">true</boolProp>
<boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
<boolProp name="HTTPSampler.monitor">false</boolProp>
<stringProp name="HTTPSampler.embedded_url_re"></stringProp>
<stringProp name="TestPlan.comments"></stringProp>
</HTTPSamplerProxy>
<hashTree>
<BeanShellPreProcessor guiclass="TestBeanGUI" testclass="BeanShellPreProcessor" testname="&#21069;&#32622;BeanShell" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<boolProp name="resetInterpreter">false</boolProp>
<stringProp name="parameters">${offline_uid} ${offline_product_sku} ${offline_shopping_key} ${offline_warehouse_id}</stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="script">import java.security.MessageDigest;
import java.util.Random;
String[] clientTypes = {&quot;android&quot;};
String[] privateKeys = {&quot;fd4ad5fcfa0de589ef238c0e7331b585&quot;};
int rd = new Random().nextInt(1);
String clientType = clientTypes[rd];
String privateKey = privateKeys[rd];
String product_sku_list = &quot;[{\&quot;buy_number\&quot;:\&quot;1\&quot;,\&quot;product_sku\&quot;:\&quot;&quot;+bsh.args[1]+&quot;\&quot;,\&quot;buy_type\&quot;:\&quot;1\&quot;}]&quot;;
String req = &quot;app_version=5.6.0&amp;client_type=&quot;+clientType+&quot;&amp;employee_uid=&quot;+bsh.args[0]+&quot;&amp;method=app.ShoppingForOffline.remove&amp;os_version=10.3.1&amp;private_key=&quot;+privateKey+&quot;&amp;product_sku_list=&quot;+product_sku_list+&quot;&amp;promotion_id=0&amp;screen_size=768x1024&amp;session_key=2a557208e3537f112685015c36e4e58e&amp;shopping_key=&quot;+bsh.args[2]+&quot;&amp;v=7&amp;warehouse_id=&quot;+bsh.args[3]+&quot;&quot;;
MessageDigest md = MessageDigest.getInstance(&quot;MD5&quot;);
byte[] btInput = req.getBytes();
md.update(btInput);
byte[] btResult = md.digest();
StringBuffer sb = new StringBuffer();
for(byte b : btResult){
int bt = b&amp;0xff;
if(bt&lt;16){
sb.append(0);
}
sb.append(Integer.toHexString(bt));
}
String md5 = sb.toString();
product_sku_list=URLEncoder.encode(product_sku_list);
req = &quot;app_version=5.6.0&amp;client_type=&quot;+clientType+&quot;&amp;employee_uid=&quot;+bsh.args[0]+&quot;&amp;method=app.ShoppingForOffline.remove&amp;os_version=10.3.1&amp;private_key=&quot;+privateKey+&quot;&amp;product_sku_list=&quot;+product_sku_list+&quot;&amp;promotion_id=0&amp;screen_size=768x1024&amp;session_key=2a557208e3537f112685015c36e4e58e&amp;shopping_key=&quot;+bsh.args[2]+&quot;&amp;v=7&amp;warehouse_id=&quot;+bsh.args[3]+&quot;&quot;;
vars.put(&quot;searchValue&quot;,req+&quot;&amp;client_secret=&quot;+md5);</stringProp>
</BeanShellPreProcessor>
<hashTree/>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="&#21709;&#24212;&#26029;&#35328;" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="1450572480">&quot;code&quot;:200</stringProp>
</collectionProp>
<stringProp name="TestPlan.comments"></stringProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
<boolProp name="Assertion.assume_success">false</boolProp>
<intProp name="Assertion.test_type">16</intProp>
</ResponseAssertion>
<hashTree/>
</hashTree>
</hashTree>
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="&#22266;&#23450;TPM" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
<doubleProp>
<name>throughput</name>
<value>3000</value>
<value>3600</value>
<savedValue>0.0</savedValue>
</doubleProp>
<intProp name="calcMode">2</intProp>
... ...