title: Generating Unit Tests Automatically
body: <p>I have a web tool which when queried returns generated Java classes based upon the arguments in the URL.</p>
  
  <p>The classes we retrieve from the webserver change daily and we need to ensure that they still can process known inputs.</p>
  
  <p>Note these classes do not test the webserver, they run locally and transform xml into a custom format. I am not testing the webserver.</p>
  
  <p>These classes must then be placed in specific package structure compiled and run against a known set of input data and compared against known output data.</p>
  
  <p>I would like to do this automatically each night to make sure that the generated classes are correct.</p>
  
  <p>What is the best way to achieve this? </p>
  
  <p>Specifically whats the best way to: </p>
  
  <ol>
  <li>retrieve the code from a webserver and place it in a file</li>
  <li>compile the code and then call it</li>
  </ol>
  
  <p>I'm sure a mix of junit and ant will be able to achieve this but is there and standard solution / approach for this?</p>