I made a little app to generate Java test classes based on certain set of information. Basically, I am generating the boilerplate code needed for a library that we are using.
I would like to test the generated code in better way than just comparing the output to an expected string.
- Is there any facility to test if the Java code contains errors?
- Is there any facility to determine if the Java file will compile?
- Is there a strategy that I should use for this kind of situation (I was thinking of using Class class to get information about the class)?