小编lie*_*es1的帖子

用于IntelliJ的多线程测试的Java工具

这是一个简单的问题,我从来没有在Java中测试程序,因为大多数都不是多线程,现在结果取决于时间和运气,这很糟糕.我不希望我的代码在需要时不工作,例如.我的IDE确实是IntelliJ

目前我开发的程序已按预期工作,现在因为它是一个带线程的并发编程,我需要运行100x然后发生随机错误.我不希望程序无限循环,而不是关闭程序.

结果示例:

Exit: Bus 37 exit the store
Size of Shop: 0
Cleaner : We're closing now!
Cleaner : We're closing now!
Depot : We're closing now!
Mechanics : We're closing now!
Mechanics : We're closing now!
Parking: We are closing now!

Process finished with exit code 0
Run Code Online (Sandbox Code Playgroud)

这是程序正常时的结果

有时结果如下:

Ramp: Bus 37 using the ramp
Size of Shop: 2
Size of Shop: 2
Ramp: Bus 37 …
Run Code Online (Sandbox Code Playgroud)

java testing concurrency junit multithreading

1
推荐指数
1
解决办法
243
查看次数

标签 统计

concurrency ×1

java ×1

junit ×1

multithreading ×1

testing ×1