Package au.org.aodn.reefscenarios.entities

Examples of au.org.aodn.reefscenarios.entities.Job


        try
        {
            ProcessRunner runner = new ProcessRunner();

            Job j = new Job();
            j.setJobName("blah");
            j.setJobPath(System.getProperty("user.dir") + "/src/test");
            System.out.println("job path: " + j.createRunPath());
            User user = new User();
            user.setEmailAddress("pauline.mak@utas.edu.au");

            j.setUserId(user.getUserId());
            runner.submitJob(j);

            System.out.println("new PBS job name: " + j.getPBSJobName());

            Assert.assertEquals(j.getPBSJobName(), "62586");
        }
        catch(Exception e)
        {
            System.out.println("This should NEVER HAPPEN!");
            e.printStackTrace();
View Full Code Here


    public void TestNonExistantScript() throws Exception
    {
        System.out.println("Running TestNonExistantScript()");
        ProcessRunner runner = new ProcessRunner();

        Job j = new Job();
        j.setJobName("blah");

        //There should be NO submit.sh script at this directory ($PROJECT/trunk)
        j.setJobPath("/SomeStupidDirectory");

        User user = new User();
        user.setEmailAddress("pauline.mak@utas.edu.au");

        j.setUserId(user.getUserId());
        runner.submitJob(j);
       
    }
View Full Code Here

    public String execute() throws Exception
    {
        User user = SharedUtils.getUser(userDAO);

        Job j = jobDAO.getJobByIdForUser(jobId, user);
        if(j != null)
        {
            if(type.equals("upload"))
            {
                srcLocation = j.createOriginalPath();
                setContentDisposition("attachment; filename=" + j.getJobName() + "_input.zip");
            }
            else if(type.equals("output"))
            {
                //The job must be finished first before you can download!
                if(j.getJobStatus() == STATUS.FINISHED || j.getPreprocessorStatus() == STATUS.FAILED)
                {
                    File outputZip = new File(j.createOutputZipFilePath());
                    setContentDisposition("attachment; filename=" + j.getJobName() + "_output.zip");

                    if(outputZip.exists())
                    {
                        outputZip.delete();
                    }
                   
                    if(outputZip.createNewFile())
                    {
                        ZipFunctions.compressDirectory(j.createScriptOutputDir(), outputZip.getAbsolutePath());
                        srcLocation = outputZip.getAbsolutePath();
                    }
                    else
                    {
                        this.addActionError("Error while creating the download package.  Please contact the site administrator for help.");
View Full Code Here

        return SUCCESS;
    }

    public String deleteJob()
    {
        Job job = jobDAO.getJobByIdForUser(jobId, SharedUtils.getUser(userDAO));

        String jobPath = job.getJobPath();
       
        File jobDir = new File(jobPath);

        if(deleteDir(jobDir))
        {
View Full Code Here

TOP

Related Classes of au.org.aodn.reefscenarios.entities.Job

Copyright © 2018 www.massapicom. 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.