agave-jobs/jobs-core/src/test/java/org/iplantc/service/jobs/queue/ArchiveWatchTest.java
/**
	 * Uploads the test job output folder to the remote execution system
     * for use in archiving tasks. This differs in the other {@link #stageTestData(String, Job)}
     * method in that it also creates multiple > 250MB+ files on the remote 
     * execution system for use in testing long-running transfers.
     * 
	 * @param localArchiveFile
	 * @param job
	 * @param useBigfiles
	 * @throws Exception
	 */
Uploads the test job output folder to the remote execution system
for use in archiving tasks. This differs in the other  #stageTestData(String, Job)
method in that it also creates multiple > 250MB+ files on the remote
execution system for use in testing long-running transfers.


Uploads the test job output folder to the remote execution system for use in archiving tasks . This differs in the other #stageTestData ( String Job ) method in that it also creates multiple > 250MB + files on the remote execution system for use in testing long - running transfers .
protected void stageTestData(String localArchiveFile, Job job, boolean useBigfiles) throws Exception {
		RemoteDataClient exeClient = null;
		OutputStream out = null;
		try {
			exeClient = executionSystem.getRemoteDataClient(job.getInternalUsername());
			exeClient.authenticate();
			exeClient.mkdirs(job.getWorkPath());
			if (useBigfiles) {
			    if (!exeClient.doesExist("bigfile.txt")) {
                    out = exeClient.getOutputStream("bigfile.txt", false, false);
                    byte[] buf = new byte[exeClient.getMaxBufferSize()];
                    for (int i=0;i<Math.ceil(Math.pow(2, 20)/exeClient.getMaxBufferSize()); i++) {
                        out.write(buf);
                    }
			    }
			    exeClient.copy("bigfile.txt", job.getWorkPath());
                for (File localFile: new File(TEST_DATA_DIR).listFiles()) {
                    exeClient.put(localFile.getAbsolutePath(), job.getWorkPath() + "/" + localFile.getName());
                    exeClient.copy("bigfile.txt", job.getWorkPath() + "/beta-" + localFile.getName());
                }
			}
			else
			{
    			for (File localFile: new File(TEST_DATA_DIR).listFiles()) {
    			    exeClient.put(localFile.getAbsolutePath(), job.getWorkPath() + "/" + localFile.getName());
    			    exeClient.copy(job.getWorkPath() + "/" + localFile.getName(), job.getWorkPath() + "/beta-" + localFile.getName());
    			}
			}
			exeClient.put(localArchiveFile, job.getWorkPath() + "/.agave.archive");
			Assert.assertTrue(exeClient.doesExist(job.getWorkPath()), 
					"Failed to copy work files to execution system");
		} catch (Exception e) {
			Assert.fail("Failed to work files to execution system", e);
		} finally {
		    try { if (out != null) out.close(); } catch (Exception e) {}
		    exeClient.disconnect();
		}
	}
protected void stageTestData ( String localArchiveFile , Job job , boolean useBigfiles ) throws Exception { RemoteDataClient exeClient = null ; OutputStream out = null ; try { exeClient = executionSystem . getRemoteDataClient ( job . getInternalUsername ( ) ) ; exeClient . authenticate ( ) ; exeClient . mkdirs ( job . getWorkPath ( ) ) ; if ( useBigfiles ) { if ( ! exeClient . doesExist ( "bigfile.txt" ) ) { out = exeClient . getOutputStream ( "bigfile.txt" , false , false ) ; byte [ ] buf = new byte [ exeClient . getMaxBufferSize ( ) ] ; for ( int i = 0 ; i < Math . ceil ( Math . pow ( 2 , 20 ) / exeClient . getMaxBufferSize ( ) ) ; i ++ ) { out . write ( buf ) ; } } exeClient . copy ( "bigfile.txt" , job . getWorkPath ( ) ) ; for ( File localFile : new File ( TEST_DATA_DIR ) . listFiles ( ) ) { exeClient . put ( localFile . getAbsolutePath ( ) , job . getWorkPath ( ) + "/" + localFile . getName ( ) ) ; exeClient . copy ( "bigfile.txt" , job . getWorkPath ( ) + "/beta-" + localFile . getName ( ) ) ; } } else { for ( File localFile : new File ( TEST_DATA_DIR ) . listFiles ( ) ) { exeClient . put ( localFile . getAbsolutePath ( ) , job . getWorkPath ( ) + "/" + localFile . getName ( ) ) ; exeClient . copy ( job . getWorkPath ( ) + "/" + localFile . getName ( ) , job . getWorkPath ( ) + "/beta-" + localFile . getName ( ) ) ; } } exeClient . put ( localArchiveFile , job . getWorkPath ( ) + "/.agave.archive" ) ; Assert . assertTrue ( exeClient . doesExist ( job . getWorkPath ( ) ) , "Failed to copy work files to execution system" ) ; } catch ( Exception e ) { Assert . fail ( "Failed to work files to execution system" , e ) ; } finally { try { if ( out != null ) out . close ( ) ; } catch ( Exception e ) { } exeClient . disconnect ( ) ; } }
Uploads the test job output folder to the remote execution system
 for use in archiving tasks.
Uploads the test job output folder to the remote execution system for use in archiving tasks .
// set up the work folder like it's a completed job // create a ~300MB file for testing interrupts of longer transfers // copy over the .agave.archive file