0

I am locking for a simple way to fetch all FIXMEs inside my source code within a JUnit test. If this list contains entries the test shell fail and print out all collected FIXMEs.

The source code is written in Java and contains many 10,000 classes. I know, there are a lot of other possibilities to get the FIXMEs. For instance I have also a CI/CD environment where you can see all TODOs, FIXMEs and that stuff.

But if I would have a JUnit test I do not have to look here and there to get all the infos anymore, I would just have a look to my tests. Are there any libs etc. to do such things or do I have to write it by myself? Thanks a lot!

Szdnez
  • 39
  • 3
  • What is the test to do? Fail if there is a FIXME? How many FIXMEs do you currently have? None? More than that? Would you rather have a failing test or the FIXMEs? Would you want to fail the build if there are FIXMEs? Note also that tests printing stuff is IMHO an anti-pattern... tests pass or fail. You shouldn't need to manually inspect the output. Not sure what you want exactly, but honestly I'd settle for the tasks view in Eclipse, your CI server, code reviews, or SonarQube. – Robert Mar 01 '21 at 21:11
  • Normally there should be no FIXMEs in the code. For sure you can see the number of FIXMEs in CI (Jenkins). But normally the focus is on the JUnit test results not in the number of FIXMEs. That is why I want to have a failing test when a FIXME occurs. I know it is a misuse of the test. But with a failing test the FIXME is highly visible. – Szdnez Mar 02 '21 at 20:54

0 Answers0