0

This is a longshot question, so bear with me. :)

I like to have my code warning free so that I can quickly determine if I have a warning that truly needs to be dealt with. I have it set that if certain javadoc items are not correct, it will display a warning. In the team I work with, they are not concerned with javadoc warnings in the unit tests. These tests are always at src/test/java. Unfortunately if there is a warning in the test, it not only shows the warning icon on the code folder src/test/java, but also on the project itself. I'm tempted just to javadoc all of their unit tests, but it's not a good use of my time. Is there a way to tell eclipse to ignore warnings from src/test/java or trigger different warnings for my tests than for my implementation?

Jason Thompson
  • 4,643
  • 5
  • 50
  • 74

2 Answers2

1

You can use a working set to filter out the test code. Take a look at this answer: Filtering warnings in eclipse by filename

Community
  • 1
  • 1
Richard Neish
  • 8,414
  • 4
  • 39
  • 69
  • Unless I'm not understanding something, this suggests that I put my tests in a separate assembly than my implementation. Is that correct? If so, it's a no-go. – Jason Thompson Nov 26 '12 at 18:20
  • You should be able to define a working set that includes some files and folders of a project but not all. When defining the working set, expand the project and add only the parts that you want. This might be a pain to do if the tests are intermingled with code, but should solve your problem. – Richard Neish Nov 27 '12 at 09:03
  • Thanks. I'll try it out. The tests are not intermingled with the code, but are in the same maven project. – Jason Thompson Nov 27 '12 at 16:26
0

There is at least one good answer in How to suppress Java warnings for specific directories or files such as generated code (using Project properties > Java Build Path > Compiler > Source)

JRA_TLL
  • 1,186
  • 12
  • 23