有没有办法在测试类中断点? [英] Is there any way to breakpoint inside the tested classes?

查看:228
本文介绍了有没有办法在测试类中断点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的方案:


  1. 我有一个Android服务( CoreService

  2. 我使用 ServiceTestCase< CoreService> 进行测试

  3. CoreService 产生一个线程,并实例化几个具有侦听器/回调的类。

  1. I have an Android service (CoreService)
  2. I use ServiceTestCase<CoreService> to test it
  3. CoreService spawns a thread and instantiates several classes that have listeners/callbacks on them.

有没有办法在生成的线程和/或回调中设置断点,并在此处停止JUnit?它只停留在JUnit项目或 CoreService 类中设置的断点。

Is there any way to set up breakpoints in the spawned threads and/or callbacks and have JUnit stop at these? It only stops at breakpoints set in the JUnit project or CoreService class.

推荐答案

p>尝试将断点挂起政策更改为挂起虚拟机

Try changing the breakpoint suspend policy to Suspend VM:

要全局更改:

< img src =https://i.stack.imgur.com/JkdQQ.pngalt =enter image description here>

有关断点挂起政策,请查看 here

这篇关于有没有办法在测试类中断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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