agave-jobs/jobs-core/src/test/java/org/iplantc/service/jobs/managers/JobRequestProcessorIT.java
/**
	 * Creates a bare bones ObjectNode representing a job submission.
	 * @return ObjectNode with minimal set of job attributes.
	 * @throws IOException 
	 * @throws JsonProcessingException 
	 */
Creates a bare bones ObjectNode representing a job submission.
@return ObjectNode with minimal set of job attributes.
Creates a bare bones ObjectNode representing a job submission . @return ObjectNode with minimal set of job attributes .
private ObjectNode createJobJsonNode(Software software)
	{
		ObjectMapper mapper = new ObjectMapper();
		ObjectNode json = mapper.createObjectNode();
		try 
		{
			json.put("name", UUID.randomUUID().toString());
			json.put("appId", software.getUniqueName());
			ObjectNode jsonInput = mapper.createObjectNode();
			for (SoftwareInput input: software.getInputs()) {
				jsonInput.putArray(input.getKey()).addAll(input.getDefaultValueAsJsonArray());
			}
			json.set("inputs", jsonInput);
			ObjectNode jsonParameter = mapper.createObjectNode();
			for (SoftwareParameter parameter: software.getParameters()) {
				jsonParameter.putArray(parameter.getKey()).addAll(parameter.getDefaultValueAsJsonArray());
			}
			json.set("parameters", jsonParameter);
		} catch (Exception e) {
			Assert.fail("Failed to read in software description to create json job object", e);
		}
		return json;
	}
private ObjectNode createJobJsonNode ( Software software ) { ObjectMapper mapper = new ObjectMapper ( ) ; ObjectNode json = mapper . createObjectNode ( ) ; try { json . put ( "name" , UUID . randomUUID ( ) . toString ( ) ) ; json . put ( "appId" , software . getUniqueName ( ) ) ; ObjectNode jsonInput = mapper . createObjectNode ( ) ; for ( SoftwareInput input : software . getInputs ( ) ) { jsonInput . putArray ( input . getKey ( ) ) . addAll ( input . getDefaultValueAsJsonArray ( ) ) ; } json . set ( "inputs" , jsonInput ) ; ObjectNode jsonParameter = mapper . createObjectNode ( ) ; for ( SoftwareParameter parameter : software . getParameters ( ) ) { jsonParameter . putArray ( parameter . getKey ( ) ) . addAll ( parameter . getDefaultValueAsJsonArray ( ) ) ; } json . set ( "parameters" , jsonParameter ) ; } catch ( Exception e ) { Assert . fail ( "Failed to read in software description to create json job object" , e ) ; } return json ; }
Creates a bare bones ObjectNode representing a job submission.
Creates a bare bones ObjectNode representing a job submission .