JunitWithEmacs

Last edit April 25, 2013
From: JunitWithIdes

Tips and tricks
  • use dmacro to create a standard TestCase
  • (or) use tempo to define a standard TestCase template


Requested Features

  • jump from Junit output to source (via compile-regexp ?)

Quick fix: To jump to the Test file in which there is an assertion error, e.g.,:
      junit.framework.AssertionFailedError: expected:<5> but was:<4>
      at foo.FactorialTest.testFac(FactorialTest.java:30)

simply add the directory name of the Test file (which might be "./tests/foo/" in this case) to compilation-search-path. This way, when you press RET or next-error or click on the file name (which is "FactorialTest.java" here), you will jump to the correct file at the error line (line #30 here).
     (add-to-list 'compilation-search-path "./tests/foo/")
-- SPK


CategoryEmacs