0

I don't have much experience with Java. I am trying to write a java program which takes a *.java or .class, run the test cases and report back number of failed test cases and number of passed test cases.

I was looking at different options available to me. How do I run JUnit tests from inside my java application?

This question explains how to run a single test case from within java program, but i am not really able to come up with a way to run multiple implementations (multiple .java files having same functions). Initial thought was to store them in different dir and walk through the directory and execute it.

The other thought was to somehow use the class path property to run multiple java implementations. I really have not looked at how to pass this path as a argument to the run function. I am still exploring.

It would be of great help if someone can suggest a better way of doing this. Or any suggestions regarding my thoughts here.

Thanks

Community
  • 1
  • 1
Anup
  • 743
  • 6
  • 12
  • Can you tell us why do you need that? Especially, why you do not like the solutions you propose? – pyb Feb 12 '15 at 17:03
  • I am trying to evaluate programs submitted by students. So they upload there code to there respective dir. And I have test cases to test if all the functions are working as expected. About the solutions, 1st approach is sort of ugly, and the 2nd one makes more sense. We have made some progress with 2nd approach in mind. 2nd approach though it makes sense, my guess is, it is soon going to get complicated. So i am curious to know if there is any other better (I mean a simple) way to achieve this goal – Anup Feb 12 '15 at 19:52

0 Answers0