agave-jobs/jobs-core/src/test/java/org/iplantc/service/jobs/queue/actions/MonitoringActionTest.java
/**
     * Tests that submission fails and the job requeues when the app deployment 
     * system is not available.
     * 
     * @throws Exception
     */
Tests that submission fails and the job requeues when the app deployment
system is not available.

@throws Exception
Tests that submission fails and the job requeues when the app deployment system is not available . @throws Exception
@Test(enabled=true)
    public void submitJobStaysStagedWhenExectuionSystemIsOffline() 
    throws Exception
    {
        Software software = null;
        ExecutionSystem executionSystem = null;
        Job job = null;
        try
        {
            SystemManager systemManager = new SystemManager();
            JSONObject json = jtd.getTestDataObject(EXECUTION_SYSTEM_TEMPLATE_DIR + 
                        File.separator + "ssh.example.com.json");
            json.put("id", "submitJobStaysStagedWhenExectuionSystemIsOffline");
            json.getJSONObject("login").put("host", "thiscannotbeavalidaddress.seriously.itsnot");
            executionSystem = (ExecutionSystem)systemManager.parseSystem(json, SYSTEM_OWNER, null);
            executionSystem.getBatchQueues().clear();
            executionSystem.addBatchQueue(unlimitedQueue.clone());
            systemDao.persist(executionSystem);
            software = SoftwareDao.getUserApps(SYSTEM_OWNER, true).get(0).clone();
            software.setName("submitTestApplicationStorageSystemChecks");
            software.setExecutionSystem(executionSystem);
            software.setDefaultQueue(executionSystem.getDefaultQueue().getName());
            SoftwareDao.persist(software);
            for (JobStatusType testStatus: new JobStatusType[] {JobStatusType.RUNNING, JobStatusType.QUEUED}) 
            {
                try 
                {
                    job = createJob(testStatus, software, SYSTEM_OWNER);
                    JobDao.persist(job);
                    job = genericRemoteMonitoringTestCase(job, testStatus, 
                            "Job submission should stay in a " + testStatus 
                            + " state while the execution system is offline", true);
                }
                finally {
                    try { deleteJobWorkDirectory(job); } catch (Exception e) {}
                    try { JobDao.delete(job); } catch (Exception e) {}
                }
            }
        }
        finally {
            try { SoftwareDao.delete(software); } catch (Exception e) {}
            try { systemDao.remove(executionSystem); } catch (Exception e) {}
        }
    }
@ Test ( enabled = true ) public void submitJobStaysStagedWhenExectuionSystemIsOffline ( ) throws Exception { Software software = null ; ExecutionSystem executionSystem = null ; Job job = null ; try { SystemManager systemManager = new SystemManager ( ) ; JSONObject json = jtd . getTestDataObject ( EXECUTION_SYSTEM_TEMPLATE_DIR + File . separator + "ssh.example.com.json" ) ; json . put ( "id" , "submitJobStaysStagedWhenExectuionSystemIsOffline" ) ; json . getJSONObject ( "login" ) . put ( "host" , "thiscannotbeavalidaddress.seriously.itsnot" ) ; executionSystem = ( ExecutionSystem ) systemManager . parseSystem ( json , SYSTEM_OWNER , null ) ; executionSystem . getBatchQueues ( ) . clear ( ) ; executionSystem . addBatchQueue ( unlimitedQueue . clone ( ) ) ; systemDao . persist ( executionSystem ) ; software = SoftwareDao . getUserApps ( SYSTEM_OWNER , true ) . get ( 0 ) . clone ( ) ; software . setName ( "submitTestApplicationStorageSystemChecks" ) ; software . setExecutionSystem ( executionSystem ) ; software . setDefaultQueue ( executionSystem . getDefaultQueue ( ) . getName ( ) ) ; SoftwareDao . persist ( software ) ; for ( JobStatusType testStatus : new JobStatusType [ ] { JobStatusType . RUNNING , JobStatusType . QUEUED } ) { try { job = createJob ( testStatus , software , SYSTEM_OWNER ) ; JobDao . persist ( job ) ; job = genericRemoteMonitoringTestCase ( job , testStatus , "Job submission should stay in a " + testStatus + " state while the execution system is offline" , true ) ; } finally { try { deleteJobWorkDirectory ( job ) ; } catch ( Exception e ) { } try { JobDao . delete ( job ) ; } catch ( Exception e ) { } } } } finally { try { SoftwareDao . delete ( software ) ; } catch ( Exception e ) { } try { systemDao . remove ( executionSystem ) ; } catch ( Exception e ) { } } }
Tests that submission fails and the job requeues when the app deployment
 system is not available.
Tests that submission fails and the job requeues when the app deployment system is not available .
//, dependsOnMethods = { "submitJobStaysStagedWhenExecutionSystemIsUnavailable" })