Multithreading concurrency Testing with testng annotations

Source: Internet
Author: User
Tags testng

Testng is a very good test framework, really from the test point of view, for the test to think. In the testing process, we often encounter a scenario to do concurrent requests, mainly want to know if the program in the concurrency will be abnormal or not consider the other situation, this is often not to do performance testing, and not because of this and to use LR to do this thing. If you know more about testng, you'll find that requires just 2 simple annotations.

1. The main use of the @test in the 2 attributes, one is ThreadPoolSize and Invocationcount, respectively, the thread pool size, and the number of calls
The thread pool belongs to the object pools. All object pools have a very important commonality in order to maximize the reuse of objects. The most important feature of the thread pool is to maximize the use of threads. The thread pool is generally used to control the threads used by the system and to conserve resource overhead. However, not every system is suitable for use with thread pooling.

2. The test code is as follows:

public class testmultidemo{@Test (threadpoolsize=10,invocationcount=5) public void Testthread () {System.out.prin           TLN ("Test.."); }}

More information: www.kootest.com; Technology Exchange Group: 182526995

Multithreading concurrency Testing with testng annotations

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.