JUnit,测试和线程 [英] JUnit, test and threads

查看:67
本文介绍了JUnit,测试和线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我连续运行多个JUnit测试时,JUnit是否为每次执行创建一个新线程,或者所有内容都包装在一个线程中?

when i run multiple JUnit tests in a row, does JUnit create a new thread for each execution or everything is wrapped in a single thread?

谢谢

推荐答案

全部都在单个线程上.您没有说如何调用测试,但是例如,运行TestSuite将按顺序运行套件中的所有测试.

It's all on a single thread. You don't say how you're invoking the tests, but for example, running a TestSuite will run all the tests in the suite sequentially.

如果要并行执行,TestNG可以同时运行测试, JUnitPerf GroboUtils .

If you want parallel execution, TestNG has support for running tests concurrently, as does JUnitPerf and GroboUtils.

这篇关于JUnit,测试和线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆