I am at a loss on this one and I'm not really sure how to explain it, but I'll give it my best shot.
I've got this project where the client wants me to create a competition. One person has to upload his Java code, another person had to upload his JUnit tests. My application is supposed to take these 2 files and run the uploaded tests on the uploaded code.
Now I know how to make it possible for the users to upload their files, but I haven't got the slightest clue how I can actually run the tests. Could anyone help me out with this one?
Here is the code I've got so far:
public void actionPerformed(ActionEvent e)
{
if (e.getSource() == codeB)
{
//Get the code
File dir = new File("..");
fc.setCurrentDirectory(dir);
int returnVal = fc.showOpenDialog(this);
if (returnVal == fc.APPROVE_OPTION)
{
codeF = fc.getSelectedFile();
codeV.setText(codeF.getPath());
}
else
{
System.out.println("Cancel");
}
}
if (e.getSource() == testB)
{
//Get the test
File dir = new File("..");
fc.setCurrentDirectory(dir);
int returnVal = fc.showOpenDialog(this);
if (returnVal == fc.APPROVE_OPTION)
{
testF = fc.getSelectedFile();
testV.setText(testF.getPath());
}
else
{
System.out.println("Cancel");
}
}
if (e.getSource() == run)
{
//Run the tests on the code
}