My problem is that test cases can not see the newly compiled files. During my program I programmatically change a input program (called InputProgram), and then compile that and save it in a proper folder in bin. Test cases related to the input program (provided as Jar file) are also extracted and are saved in a proper document in bin directory.
The first iteration works completely fine. In fact, if I change the InputProgram and the applied changes caused any failure in test cases, the test cases can catch them. (-:
However, after the first iteration, if I change the program again, the test cases can not see the changes, and return me the results for the first changes (first iteration). In fact, it can not see the newly compiled file. Note that, I check the newly created program files (.class), and I can see changes are there. Therefore, the compiler process (done programmatically) works fine.
I delete the test cases (.class) files from bin directory before executing second iteration and surprisingly I saw the test cases can still be run, but again based on the old version. It seems eclipse does not load the new version of files.
I also clean bin directory (project->clean) during execution, but still no success. I also replaced the old version of testcases with new ones (extracted again from jar file), but again no success.
Overall, I need Jave instructions that I can programmatically tell the eclipse to load newly compiled files.
Not sure it help, but I use this instructions to run a JUnit test case:
Result result = JUnitCore.runClasses(testCase);
for (Failure failure : result.getFailures())
System.out.println(failure.toString());