agave-jobs/jobs-core/src/test/java/org/iplantc/service/jobs/queue/SubmissionWatchTest.java
/**
     * Tests that submission fails and the job requeues when the app is not available.
     */
Tests that submission fails and the job requeues when the app is not available.
Tests that submission fails and the job requeues when the app is not available .
@Test(enabled=false)
    public void submitJobStaysStagedWhenSoftwareIsUnavailable() 
    {
        Job job = null;
        Software software = null;
        try {
            software = SoftwareDao.getUserApps(SYSTEM_OWNER, true).get(0).clone();
            software.setName("submitTestApplicationChecks");
            software.setAvailable(false);
            SoftwareDao.persist(software);
            job = createJob(JobStatusType.STAGED, software, SYSTEM_OWNER);
            JobDao.persist(job);
            job = genericRemoteSubmissionTestCase(job, JobStatusType.STAGED, 
                    "Job submission should fail when the application is not available", 
                    false);
            Assert.assertEquals(job.getStatus(), JobStatusType.STAGED,
                    "Job should be returned to STAGED status when the app is unavailable.");
        } 
        catch (Throwable e) {
            Assert.fail("Job should be returned to STAGED status when the app is unavailable.", e);
        }
        finally {
            try { SoftwareDao.delete(software); } catch (Exception e) {}
            try { deleteJobWorkDirectory(job); } catch (Exception e) {}
            try { JobDao.delete(job); } catch (Exception e) {}
        }
    }
@ Test ( enabled = false ) public void submitJobStaysStagedWhenSoftwareIsUnavailable ( ) { Job job = null ; Software software = null ; try { software = SoftwareDao . getUserApps ( SYSTEM_OWNER , true ) . get ( 0 ) . clone ( ) ; software . setName ( "submitTestApplicationChecks" ) ; software . setAvailable ( false ) ; SoftwareDao . persist ( software ) ; job = createJob ( JobStatusType . STAGED , software , SYSTEM_OWNER ) ; JobDao . persist ( job ) ; job = genericRemoteSubmissionTestCase ( job , JobStatusType . STAGED , "Job submission should fail when the application is not available" , false ) ; Assert . assertEquals ( job . getStatus ( ) , JobStatusType . STAGED , "Job should be returned to STAGED status when the app is unavailable." ) ; } catch ( Throwable e ) { Assert . fail ( "Job should be returned to STAGED status when the app is unavailable." , e ) ; } finally { try { SoftwareDao . delete ( software ) ; } catch ( Exception e ) { } try { deleteJobWorkDirectory ( job ) ; } catch ( Exception e ) { } try { JobDao . delete ( job ) ; } catch ( Exception e ) { } } }
Tests that submission fails and the job requeues when the app is not available.
Tests that submission fails and the job requeues when the app is not available .
//, dependsOnMethods = { "submitJobStaysStagedWhenSoftwareDeploymentSystemIsUnavailable" })