agave-jobs/jobs-core/src/test/java/org/iplantc/service/jobs/submission/AbstractJobSubmissionTest.java
/**
     * Removes a single {@link Job#getWorkPath()} on the job {@link ExecutionSystem}
     * 
     * @param job the job for which to delete the working directory
     */
Removes a single  Job#getWorkPath() on the job  ExecutionSystem

@param job the job for which to delete the working directory
Removes a single Job#getWorkPath () on the job ExecutionSystem @param job the job for which to delete the working directory
public void deleteJobWorkDirectory(Job job) {
        RemoteDataClient remoteDataClient = null;
        RemoteSystem executionSystem = systemDao.findBySystemId(job.getSystem());
        if (executionSystem == null) return;
        try {
            remoteDataClient = executionSystem.getRemoteDataClient(job.getInternalUsername());
            remoteDataClient.authenticate();
            if (remoteDataClient.doesExist(job.getWorkPath())) {
                remoteDataClient.delete(job.getWorkPath());
                Assert.assertFalse(remoteDataClient.doesExist(job.getWorkPath()), 
                        "Failed to delete job work directory agave://" 
                                + executionSystem.getSystemId() 
                                + "/" + job.getWorkPath() + " after test");
            }
        } catch (Exception e) {
            Assert.fail("Failed to delete job work directory agave://" 
                    + executionSystem.getSystemId() 
                    + "/" + job.getWorkPath() + " after test", e);
        } finally {
            try {
                if (remoteDataClient != null) {
                    remoteDataClient.disconnect();
                }
            } catch (Exception ignored) {}
        }
    }
public void deleteJobWorkDirectory ( Job job ) { RemoteDataClient remoteDataClient = null ; RemoteSystem executionSystem = systemDao . findBySystemId ( job . getSystem ( ) ) ; if ( executionSystem == null ) return ; try { remoteDataClient = executionSystem . getRemoteDataClient ( job . getInternalUsername ( ) ) ; remoteDataClient . authenticate ( ) ; if ( remoteDataClient . doesExist ( job . getWorkPath ( ) ) ) { remoteDataClient . delete ( job . getWorkPath ( ) ) ; Assert . assertFalse ( remoteDataClient . doesExist ( job . getWorkPath ( ) ) , "Failed to delete job work directory agave://" + executionSystem . getSystemId ( ) + "/" + job . getWorkPath ( ) + " after test" ) ; } } catch ( Exception e ) { Assert . fail ( "Failed to delete job work directory agave://" + executionSystem . getSystemId ( ) + "/" + job . getWorkPath ( ) + " after test" , e ) ; } finally { try { if ( remoteDataClient != null ) { remoteDataClient . disconnect ( ) ; } } catch ( Exception ignored ) { } } }
Removes a single {@link Job#getWorkPath()} on the job {@link ExecutionSystem}
Removes a single { @link Job#getWorkPath () } on the job { @link ExecutionSystem }
// system may have been deleted during the test run.