在Eclipse中的JUnit测试上调试断点不起作用

tek*_*ara 8 java eclipse debugging junit

我试图在日食中调试一个junit测试,但我的断点没有触发(除非它们在第一行或第二行).

我已经尝试删除并重新创建工作区中的所有断点,清理项目,创建新的调试配置,以及单独运行测试方法以及使用其他方法作为测试类的一部分.但一切都无济于事:-(

 public void testLoadPatientsAndConvertToBeans() throws IOException, CDataGridException {
  File file = fileutil.getFileFromPrefsOrPrompt(basefileDef);

  CDataBuilder builder = new CDataDelimitedFileBuilder(file, 
    CDataDelimitedFileBuilder.DelimiterSettings.WINDOWS_CSV,
    basefileDef);

  // breakpoints placed on lines from here on do not fire

  CDataCacheContainer container = 
   cacheIO.construct(
     new CDataNarrower(
       cacheIO.construct(builder)
     ).setConvertMissing(true));

  assertEquals(13548, container.size());

  cacheIO.export(container, patients);

  Collection<Patient> pBeans = patients.getBeans();

  assertEquals(container.size(), pBeans.size());

  Patient patient = pBeans.iterator().next();
  Map props = patient.getPropertyMap();

  System.out.println(props);
 }
Run Code Online (Sandbox Code Playgroud)

Vin*_*lds 8

如果您使用的是Sun JDK 6 Update 14,则可能会出现这种情况.请参阅此处另一个类似的SO问题.在这种情况下,可能的解决方案是使用Sun JDK 6 Update 16.