1

I have a test written in JUnit. On fail I would like to append a file to the report.

My thoughts: I just have to get the path and report name, so I can put a custom file right next to it, so it can be easily found.

How do I get that report file or path name?

Additional information: Those tests are run via Eclipse or Jenkins.

Update: the name can be found like this: Get name of currently executing test in JUnit 4

The path seems to be a surefire topic ...

Community
  • 1
  • 1
wuppi
  • 1,004
  • 10
  • 16
  • I'm assuming that your test written in JUnit is not a unit test because I can't think of a reason why you'd ever want to do this in a unit test. Are you trying to report a file that you're reading/writing in an integration test? – Alan Escreet Apr 19 '12 at 10:24
  • you are right, its not a simple JUnit unit test but a test written in JUnit. I corrected my question that way. – wuppi Apr 19 '12 at 11:02

0 Answers0