且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在使用Ant的Eclipse中调试TestNg Java代码

更新时间:2022-05-13 10:34:14

我想出了解决此问题的方法.请按照以下步骤解决此问题
1.在build.xml文件的任务内添加以下行.

I figured the solution to this problem. Follow the following steps to solve this
1. Add following lines inside the task in build.xml file.

<jvmarg value="-Xdebug" />
<jvmarg value="-Xnoagent"/> 
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5432" />

  1. 添加远程Java应用程序调试配置,即,指定项目名称,将主机指定为"localhost",并在本例中将端口与步骤1中的5432相同
  2. 首先调试build.xml文件
  3. 通过开始调试在步骤2中设置的远程Java应用程序调试配置来附加testng进程.