Authored by Rong

commit by shell

... ... @@ -187,10 +187,10 @@
</ResponseAssertion>
<hashTree/>
</hashTree>
</hashTree> <TransactionController guiclass="TransactionControllerGui" testclass="TransactionController" testname="事务控制器" enabled="true">
<boolProp name="TransactionController.includeTimers">false</boolProp>
<boolProp name="TransactionController.parent">false</boolProp>
</TransactionController>
</hashTree>
<com.blazemeter.jmeter.controller.ParallelSampler guiclass="com.blazemeter.jmeter.controller.ParallelControllerGui" testclass="com.blazemeter.jmeter.controller.ParallelSampler" testname="bzm - Parallel Controller" enabled="true">
<boolProp name="PARENT_SAMPLE">false</boolProp>
</com.blazemeter.jmeter.controller.ParallelSampler>
<hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="tc_&#30007;&#39318;" enabled="true">
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
... ... @@ -221,68 +221,90 @@
</HTTPSamplerProxy>
<hashTree>
</hashTree>
<JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="AJAX" enabled="true">
<stringProp name="cacheKey">b04922f8-efaa-4390-bc5f-df25d02450bb</stringProp>
<stringProp name="filename"></stringProp>
<stringProp name="parameters">GEThttp://www.yohobuy.com/common/suggestfeedback?callback=jQuery112409858715270747556_1505876076710&amp;return_type=jsonp&amp;client_secret=web&amp;code=200&amp;_=1505876076711 GEThttp://www.yohobuy.com/channel/isNewUserAjax GEThttp://www.yohobuy.com/passport/cert/headerTip?callback=jQuery112409858715270747556_1505876076710&amp;_=1505876076712</stringProp>
<stringProp name="script">import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.util.EntityUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
List&lt;String&gt; urls = new ArrayList&lt;String&gt;();
Collections.addAll(urls,args);
ExecutorService pool = Executors.newFixedThreadPool(urls.size());
for (String url : urls) {
final String currentURL = url;
pool.submit(new Runnable() {
@Override
public void run() {
try {
if(currentURL.startsWith(&quot;GET&quot;)){
currentURL=currentURL.substring(3);
HttpClient client = new DefaultHttpClient();
HttpGet get = new HttpGet(currentURL);
HttpResponse response = client.execute(get);
HttpEntity entity = response.getEntity();
EntityUtils.consume(entity);
}
if(currentURL.startsWith(&quot;POST&quot;)){
String[] splitArr =currentURL.substring(4).split(&quot;YptPostData=&quot;);
currentURL = splitArr[0];
String postData = splitArr[1];
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost(currentURL);
StringEntity entityStr = new StringEntity(postData, Charset.forName(&quot;UTF-8&quot;));
entityStr.setContentEncoding(&quot;UTF-8&quot;);
post.setEntity(entityStr);
HttpResponse response = client.execute(post);
HttpEntity entity = response.getEntity();
EntityUtils.consume(entity);
}
}catch (Exception ex) {
ex.printStackTrace();
}
}
});
}
pool.shutdown();</stringProp>
<stringProp name="scriptLanguage">groovy</stringProp>
</JSR223Sampler>
<hashTree/> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="ajax_1" 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://www.yohobuy.com/common/suggestfeedback?callback=jQuery112409858715270747556_1505876076710&amp;return_type=jsonp&amp;client_secret=web&amp;code=200&amp;_=1505876076711</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">&#21153;&#24517;&#20197;tc_&#24320;&#22836;&#65292;&#21542;&#21017;&#26080;&#27861;&#33719;&#21462;&#32479;&#35745;&#32467;&#26524;</stringProp>
</HTTPSamplerProxy>
<hashTree>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="&#21709;&#24212;&#26029;&#35328;" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="1450572480"></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>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="ajax_2" 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://www.yohobuy.com/passport/cert/headerTip?callback=jQuery112409858715270747556_1505876076710&amp;_=1505876076712</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">&#21153;&#24517;&#20197;tc_&#24320;&#22836;&#65292;&#21542;&#21017;&#26080;&#27861;&#33719;&#21462;&#32479;&#35745;&#32467;&#26524;</stringProp>
</HTTPSamplerProxy>
<hashTree>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="&#21709;&#24212;&#26029;&#35328;" enabled="true">
<collectionProp name="Asserion.test_strings">
<stringProp name="1450572480"></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>60000</value>
<value>180000</value>
<savedValue>0.0</savedValue>
</doubleProp>
<intProp name="calcMode">2</intProp>
... ...