Browse Source

Worked on test cases.

pull/6778/head
Halil İbrahim Kalkan 5 years ago
parent
commit
2bad56d020
  1. 2
      test/AbpPerfTest/AbpPerfTest.WithAbp/AppModule.cs
  2. 3
      test/AbpPerfTest/AbpPerfTest.WithAbp/Controllers/BookController.cs
  3. 16
      test/AbpPerfTest/_jmeter/SimpleTestPlan.jmx
  4. 16
      test/AbpPerfTest/_jmeter/SimpleTestPlanWithoutAbp.jmx

2
test/AbpPerfTest/AbpPerfTest.WithAbp/AppModule.cs

@ -33,7 +33,7 @@ namespace AbpPerfTest.WithAbp
Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Auto;
options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});
}

3
test/AbpPerfTest/AbpPerfTest.WithAbp/Controllers/BookController.cs

@ -5,6 +5,7 @@ using System.Threading.Tasks;
using AbpPerfTest.WithAbp.Dtos;
using AbpPerfTest.WithAbp.Entities;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Domain.Repositories;
namespace AbpPerfTest.WithAbp.Controllers
@ -22,7 +23,7 @@ namespace AbpPerfTest.WithAbp.Controllers
[HttpGet]
public async Task<List<BookDto>> GetListAsync()
{
var books = await _bookRepository.GetPagedListAsync(0, 10, "Id");
var books = await _bookRepository.OrderBy(x => x.Id).Take(10).ToListAsync();
return books
.Select(b => new BookDto

16
test/AbpPerfTest/_jmeter/SimpleTestPlan.jmx

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.3">
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.4">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
@ -43,7 +43,7 @@
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.domain">localhost</stringProp>
<stringProp name="HTTPSampler.port">5000</stringProp>
<stringProp name="HTTPSampler.port">5001</stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/api/books/</stringProp>
@ -70,7 +70,7 @@
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">localhost</stringProp>
<stringProp name="HTTPSampler.port">5000</stringProp>
<stringProp name="HTTPSampler.port">5001</stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">api/books/${BookId}</stringProp>
@ -84,7 +84,7 @@
<stringProp name="HTTPSampler.response_timeout"></stringProp>
</HTTPSamplerProxy>
<hashTree/>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Update a book" enabled="true">
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Update a book" enabled="false">
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
<collectionProp name="Arguments.arguments">
@ -101,7 +101,7 @@
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.domain">localhost</stringProp>
<stringProp name="HTTPSampler.port">5000</stringProp>
<stringProp name="HTTPSampler.port">5001</stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/api/books/${BookId}</stringProp>
@ -115,12 +115,12 @@
<stringProp name="HTTPSampler.response_timeout"></stringProp>
</HTTPSamplerProxy>
<hashTree/>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get books" enabled="true">
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get books" enabled="false">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">localhost</stringProp>
<stringProp name="HTTPSampler.port">5000</stringProp>
<stringProp name="HTTPSampler.port">5001</stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/api/books</stringProp>
@ -139,7 +139,7 @@
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">localhost</stringProp>
<stringProp name="HTTPSampler.port">5000</stringProp>
<stringProp name="HTTPSampler.port">5001</stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/api/books/${BookId}</stringProp>

16
test/AbpPerfTest/_jmeter/SimpleTestPlanWithoutAbp.jmx

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.3">
<jmeterTestPlan version="1.2" properties="5.0" jmeter="5.4">
<hashTree>
<TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="Test Plan" enabled="true">
<stringProp name="TestPlan.comments"></stringProp>
@ -43,7 +43,7 @@
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.domain">localhost</stringProp>
<stringProp name="HTTPSampler.port">5001</stringProp>
<stringProp name="HTTPSampler.port">5003</stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/api/books/</stringProp>
@ -70,7 +70,7 @@
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">localhost</stringProp>
<stringProp name="HTTPSampler.port">5001</stringProp>
<stringProp name="HTTPSampler.port">5003</stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">api/books/${BookId}</stringProp>
@ -84,7 +84,7 @@
<stringProp name="HTTPSampler.response_timeout"></stringProp>
</HTTPSamplerProxy>
<hashTree/>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Update a book" enabled="true">
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Update a book" enabled="false">
<boolProp name="HTTPSampler.postBodyRaw">true</boolProp>
<elementProp name="HTTPsampler.Arguments" elementType="Arguments">
<collectionProp name="Arguments.arguments">
@ -101,7 +101,7 @@
</collectionProp>
</elementProp>
<stringProp name="HTTPSampler.domain">localhost</stringProp>
<stringProp name="HTTPSampler.port">5001</stringProp>
<stringProp name="HTTPSampler.port">5003</stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/api/books/${BookId}</stringProp>
@ -115,12 +115,12 @@
<stringProp name="HTTPSampler.response_timeout"></stringProp>
</HTTPSamplerProxy>
<hashTree/>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get books" enabled="true">
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="Get books" enabled="false">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">localhost</stringProp>
<stringProp name="HTTPSampler.port">5001</stringProp>
<stringProp name="HTTPSampler.port">5003</stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/api/books</stringProp>
@ -139,7 +139,7 @@
<collectionProp name="Arguments.arguments"/>
</elementProp>
<stringProp name="HTTPSampler.domain">localhost</stringProp>
<stringProp name="HTTPSampler.port">5001</stringProp>
<stringProp name="HTTPSampler.port">5003</stringProp>
<stringProp name="HTTPSampler.protocol">https</stringProp>
<stringProp name="HTTPSampler.contentEncoding"></stringProp>
<stringProp name="HTTPSampler.path">/api/books/${BookId}</stringProp>

Loading…
Cancel
Save