agave-files/files-core/src/test/java/org/iplantc/service/io/queue/StagingJobIT.java
/**
	 * Tests that the StagingJob will fail without throwing an exception when the user does not have write permission
	 * to the destination location.
	 * @param sourceSystem the transfer source system
	 * @param destSystem the transfer dest system
	 * @param srcPath the path from which the file item will be copied
	 * @param destPath  the path to which the file item will be copied. The user should not have write permission here.
	 * @param message the error message
	 */
Tests that the StagingJob will fail without throwing an exception when the user does not have write permission
to the destination location.
@param sourceSystem the transfer source system
@param destSystem the transfer dest system
@param srcPath the path from which the file item will be copied
@param destPath  the path to which the file item will be copied. The user should not have write permission here.
@param message the error message
Tests that the StagingJob will fail without throwing an exception when the user does not have write permission to the destination location . @param sourceSystem the transfer source system @param destSystem the transfer dest system @param srcPath the path from which the file item will be copied @param destPath the path to which the file item will be copied . The user should not have write permission here . @param message the error message
@Test(dataProvider="testStageNextAgaveFileDestNoPermissionProvider", retryAnalyzer = StagingJobITRetryAnalyzer.class, priority = 8)
	public void testStageNextAgaveFileDestNoPermission(RemoteSystem sourceSystem, RemoteSystem destSystem, String srcPath, String destPath, String message) 
	{
		RemoteDataClient srcClient = null;
		RemoteDataClient destClient = null;
		try 
		{
			destClient = getClient(destSystem);
			if (!destClient.doesExist("")) {
				destClient.mkdirs("");
			}
			srcClient = getClient(sourceSystem);
			srcClient.mkdirs("");
			srcClient.put(LOCAL_BINARY_FILE, "");
			StagingTask task = createStagingTaskForUrl(new URI("agave://" + sourceSystem.getSystemId() + "/" + srcPath), destSystem, destPath);
            StagingJob stagingJob = new StagingJob();
			stagingJob.setQueueTask(task);
            stagingJob.doExecute();
			LogicalFile file = task.getLogicalFile();
			Assert.assertEquals(file.getStatus(), StagingTaskStatus.STAGING_FAILED.name(), message);
		} 
		catch (Exception e) {
			Assert.fail("File staging should not throw an exception", e);
		} 
		finally {
			try { srcClient.delete(""); } catch (Exception ignored) {}
			try { destClient.delete(""); } catch (Exception ignored) {}
		}
	}
@ Test ( dataProvider = "testStageNextAgaveFileDestNoPermissionProvider" , retryAnalyzer = StagingJobITRetryAnalyzer . class , priority = 8 ) public void testStageNextAgaveFileDestNoPermission ( RemoteSystem sourceSystem , RemoteSystem destSystem , String srcPath , String destPath , String message ) { RemoteDataClient srcClient = null ; RemoteDataClient destClient = null ; try { destClient = getClient ( destSystem ) ; if ( ! destClient . doesExist ( "" ) ) { destClient . mkdirs ( "" ) ; } srcClient = getClient ( sourceSystem ) ; srcClient . mkdirs ( "" ) ; srcClient . put ( LOCAL_BINARY_FILE , "" ) ; StagingTask task = createStagingTaskForUrl ( new URI ( "agave://" + sourceSystem . getSystemId ( ) + "/" + srcPath ) , destSystem , destPath ) ; StagingJob stagingJob = new StagingJob ( ) ; stagingJob . setQueueTask ( task ) ; stagingJob . doExecute ( ) ; LogicalFile file = task . getLogicalFile ( ) ; Assert . assertEquals ( file . getStatus ( ) , StagingTaskStatus . STAGING_FAILED . name ( ) , message ) ; } catch ( Exception e ) { Assert . fail ( "File staging should not throw an exception" , e ) ; } finally { try { srcClient . delete ( "" ) ; } catch ( Exception ignored ) { } try { destClient . delete ( "" ) ; } catch ( Exception ignored ) { } } }
Tests that the StagingJob will fail without throwing an exception when the user does not have write permission
 to the destination location.
Tests that the StagingJob will fail without throwing an exception when the user does not have write permission to the destination location .
//, dependsOnMethods={"testStageNextAgaveFileSourceNoPermission"}) // load the db with dummy records to stage a http-accessible file //			destClient.authenticate(); //			srcClient.authenticate();