Package au.edu.mq.comp.junitGrading.SMTPUI

Source Code of au.edu.mq.comp.junitGrading.SMTPUI.GradingJob

package au.edu.mq.comp.junitGrading.SMTPUI;

import java.util.UUID;
import java.io.File;
import java.io.IOException;

import au.edu.mq.comp.common.*;
import au.edu.mq.comp.junitGrading.commandLineUI.JavaGraderDriver;

public class GradingJob
{
    private UUID id;
    private File workDir;
   
    public GradingJob(String configString, String workingDirectoryPrefix) throws IOException
    {
        this.id = UUID.randomUUID();
        this.workDir = new File(workingDirectoryPrefix + File.separator + id.toString());
        this.workDir.mkdirs();
        SimpleFileIO.writeStringToTextFile(configString, this.workDir.getAbsolutePath() + File.separator + "config.txt");
    }
   
    public UUID id()
    {
        return id;
    }
   
   
    public String run() throws Exception
    {
        Log.setLogToFile(this.workDir.getAbsolutePath() + File.separator + "run.log");
        JavaGraderDriver agm = new JavaGraderDriver();
        String CSVString = agm.run(new File(this.workDir.getAbsolutePath() + File.separator + "config.txt"));
        return CSVString;
    }
   
}
TOP

Related Classes of au.edu.mq.comp.junitGrading.SMTPUI.GradingJob

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.