0

I have a theoretical question this time. Where is unitils @Dataset annotation processed? Every annotation must have a prosessor class, see http://www.javacodegeeks.com/2012/08/java-annotations-explored-explained.html

Does this happen in org.unitils.UnitilsJUnit4 library?

I would like to make my own implementation for anotation, no code ready yet.

mjgirl
  • 1,214
  • 7
  • 24
  • 42

1 Answers1

0

Depends on which part of the processing that you are looking for. If you mean where the actual DataSet is processed, then check out the DbUnitModule class. From the API:

Loading of DbUnit data sets can be done by annotating a class or method with the DataSet annotation. The name of the data set files can be specified explicitly as an argument of the annotation. If no file name is specified, it looks for a file in the same directory as the test class named: 'classname without packagename'.xml.

If you are referring to the code that actually looks for things that are annotated with @DataSet then they have a helper class called AnnotationUtils (API) which has a bunch of methods for accessing annotated items. This is used by the DbUnitModule mentioned above to find whatever data set is needed for a given test.

Mike D
  • 64
  • 7