Is there a way I can get ant to run the unit tests just for the java classes it builds? For example, if MyClass.java is out of date, ant will build MyClass.class. After that I want it to also run MyClassTest and MyClassTestSuite if they exist. It doesn't have to be based on a naming convention. I'd be fine with using annotations or any other method that works.
EDIT: Several people have chimed in saying this is a bad idea. It would be, if I planned on checking in without running all of our unit tests. My main project has over 16k unit tests which take about 20 minutes to run. I'll run them all before check-in, but it's completely impractical to run the whole suite every time I change a file. Sorry, I should have given more context.