...
|
...
|
@@ -221,129 +221,62 @@ |
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
</hashTree>
|
|
|
<RandomController guiclass="RandomControlGui" testclass="RandomController" testname="随机控制器" enabled="true">
|
|
|
<intProp name="InterleaveControl.style">1</intProp>
|
|
|
</RandomController>
|
|
|
<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://${HOST_PC}/common/suggestfeedback?callback=jQuery112407297836417199297_1506394331103&return_type=jsonp&client_secret=web&code=200&_=1506394331104</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">务必以tc_开头,否则无法获取统计结果</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" 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://${HOST_PC}/guang/info/listData?ids=67249%2C67239%2C67157%2C67191%2C67189%2C67163%2C67161%2C67259%2C67287%2C67159%2C67279%2C67263%2C67113%2C67199%2C67261%2C67143%2C67153%2C67197%2C67141%2C67195&type=0</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">务必以tc_开头,否则无法获取统计结果</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" 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_3" 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_PC}/passport/cert/headerTip?callback=jQuery112407297836417199297_1506394331103&_=1506394331105</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">务必以tc_开头,否则无法获取统计结果</stringProp>
|
|
|
</HTTPSamplerProxy>
|
|
|
<hashTree>
|
|
|
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" 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>
|
|
|
</hashTree>
|
|
|
<JSR223Sampler guiclass="TestBeanGUI" testclass="JSR223Sampler" testname="JSR223 Sampler" enabled="true">
|
|
|
<stringProp name="cacheKey">b04922f8-efaa-4390-bc5f-df25d02450bb</stringProp>
|
|
|
<stringProp name="filename"></stringProp>
|
|
|
<stringProp name="parameters">GEThttp://${HOST_PC}/common/suggestfeedback?callback=jQuery112407297836417199297_1506394331103&return_type=jsonp&client_secret=web&code=200&_=1506394331104 GEThttp://${HOST_PC}/guang/info/listData?ids=67249%2C67239%2C67157%2C67191%2C67189%2C67163%2C67161%2C67259%2C67287%2C67159%2C67279%2C67263%2C67113%2C67199%2C67261%2C67143%2C67153%2C67197%2C67141%2C67195&type=0 GEThttp://${HOST_PC}/passport/cert/headerTip?callback=jQuery112407297836417199297_1506394331103&_=1506394331105</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.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<String> urls = new ArrayList<String>();
|
|
|
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("GET")){
|
|
|
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("POST")){
|
|
|
String[] splitArr =currentURL.substring(4).split("YptPostData=");
|
|
|
currentURL = splitArr[0];
|
|
|
String postData = splitArr[1];
|
|
|
HttpClient client = new DefaultHttpClient();
|
|
|
HttpPost post = new HttpPost(currentURL);
|
|
|
StringEntity entity = new StringEntity(postData, Charset.forName("UTF-8"));
|
|
|
entity.setContentEncoding("UTF-8");
|
|
|
post.setEntity(entity);
|
|
|
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>
|
|
|
<ConstantThroughputTimer guiclass="TestBeanGUI" testclass="ConstantThroughputTimer" testname="固定TPM" enabled="true">
|
|
|
<stringProp name="TestPlan.comments"></stringProp>
|
|
|
<doubleProp>
|
...
|
...
|
|