agave-jobs/jobs-core/src/test/java/org/iplantc/service/jobs/managers/launchers/StartupScriptJobMacroResolverTest.java
/**
	 * Ensures blank startup script values in the job's {@link ExecutionSystem} return null.
	 * @param pathToStartupScript the startupPath value to test
	 */
Ensures blank startup script values in the job's  ExecutionSystem return null.
@param pathToStartupScript the startupPath value to test
Ensures blank startup script values in the job ' s ExecutionSystem return null . @param pathToStartupScript the startupPath value to test
@Test(dataProvider = "testResolveStartupScriptJobMacroReturnsNullWhenStartupScriptBlankProvider")
	public void testResolveStartupScriptJobMacroReturnsNullWhenStartupScriptBlank(String pathToStartupScript) {
		try {
			Job job = new Job();
			job.setSystem(UUID.randomUUID().toString());
			job.setBatchQueue(UUID.randomUUID().toString());
			job.setTenantId(UUID.randomUUID().toString());
			ExecutionSystem executionSystem = new ExecutionSystem();
			executionSystem.setSystemId(job.getSystem());
			executionSystem.setStartupScript(pathToStartupScript);
			StartupScriptJobMacroResolver resolver = mock(StartupScriptJobMacroResolver.class);
			when(resolver.getJob()).thenReturn(job);
			when(resolver.getExecutionSystem()).thenReturn(executionSystem);
			when(resolver.resolve()).thenCallRealMethod();
			String result = resolver.resolve();
			Assert.assertNull(result, "Blank startup script value should return null");
		} catch (JobException | SystemArgumentException | JobMacroResolutionException e) {
			Assert.fail("Resolving an empty startup script should return empty string.", e);
		}
	}
@ Test ( dataProvider = "testResolveStartupScriptJobMacroReturnsNullWhenStartupScriptBlankProvider" ) public void testResolveStartupScriptJobMacroReturnsNullWhenStartupScriptBlank ( String pathToStartupScript ) { try { Job job = new Job ( ) ; job . setSystem ( UUID . randomUUID ( ) . toString ( ) ) ; job . setBatchQueue ( UUID . randomUUID ( ) . toString ( ) ) ; job . setTenantId ( UUID . randomUUID ( ) . toString ( ) ) ; ExecutionSystem executionSystem = new ExecutionSystem ( ) ; executionSystem . setSystemId ( job . getSystem ( ) ) ; executionSystem . setStartupScript ( pathToStartupScript ) ; StartupScriptJobMacroResolver resolver = mock ( StartupScriptJobMacroResolver . class ) ; when ( resolver . getJob ( ) ) . thenReturn ( job ) ; when ( resolver . getExecutionSystem ( ) ) . thenReturn ( executionSystem ) ; when ( resolver . resolve ( ) ) . thenCallRealMethod ( ) ; String result = resolver . resolve ( ) ; Assert . assertNull ( result , "Blank startup script value should return null" ) ; } catch ( JobException | SystemArgumentException | JobMacroResolutionException e ) { Assert . fail ( "Resolving an empty startup script should return empty string." , e ) ; } }
Ensures blank startup script values in the job's {@link ExecutionSystem} return null.
Ensures blank startup script values in the job ' s { @link ExecutionSystem } return null .
//			BatchQueue queue = new BatchQueue(); //			queue.setName(job.getBatchQueue()); //			queue.setMappedName("effective" + job.getBatchQueue()); //			executionSystem.addBatchQueue(queue);