Toggle navigation
Toggle navigation
This project
Loading...
Sign in
YPT
/
jmeter
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
Rong
8 years ago
Commit
3748488cdc58ac7fceb82549b64eef33f78760d8
1 parent
a7f76978
commit by shell
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
84 additions
and
62 deletions
script/default/test4.jmx
script/default/test4.jmx
View file @
3748488
...
...
@@ -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_男首"
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
&
return_type=jsonp
&
client_secret=web
&
code=200
&
_=1505876076711 GEThttp://www.yohobuy.com/channel/isNewUserAjax GEThttp://www.yohobuy.com/passport/cert/headerTip?callback=jQuery112409858715270747556_1505876076710
&
_=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
<
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 entityStr = new StringEntity(postData, Charset.forName(
"
UTF-8
"
));
entityStr.setContentEncoding(
"
UTF-8
"
);
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
&
return_type=jsonp
&
client_secret=web
&
code=200
&
_=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"
>
务必以
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://www.yohobuy.com/passport/cert/headerTip?callback=jQuery112409858715270747556_1505876076710
&
_=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"
>
务必以
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>
<ConstantThroughputTimer
guiclass=
"TestBeanGUI"
testclass=
"ConstantThroughputTimer"
testname=
"固定TPM"
enabled=
"true"
>
<stringProp
name=
"TestPlan.comments"
></stringProp>
<doubleProp>
<name>
throughput
</name>
<value>
6
0000
</value>
<value>
18
0000
</value>
<savedValue>
0.0
</savedValue>
</doubleProp>
<intProp
name=
"calcMode"
>
2
</intProp>
...
...
Please
register
or
login
to post a comment