agave-jobs/jobs-core/src/test/java/org/iplantc/service/jobs/managers/launchers/HPCLauncherTest.java
/**
     * Generator for test {@link Software}
     * @param executionSystem the execution system to assign to the software
     * @param executionType the execution type to assign to software
     * @return a software instance to use in testing
     */
Generator for test  Software
@param executionSystem the execution system to assign to the software
@param executionType the execution type to assign to software
@return a software instance to use in testing
Generator for test Software @param executionSystem the execution system to assign to the software @param executionType the execution type to assign to software @return a software instance to use in testing
private Software createMockSoftware(ExecutionSystem executionSystem, ExecutionType executionType) {
        final Software software = new Software();
        try {
            JSONObject json = JSONTestDataUtil.getInstance().getTestDataObject(JSONTestDataUtil.TEST_SOFTWARE_FOLDER + "/singularity-1.0/app.json");
            software.setExecutionSystem(executionSystem);
            software.setExecutionType(executionType);
            software.setName(UUID.randomUUID().toString());
            JSONArray params = json.getJSONArray("parameters");
            for(int i=0; i< params.length(); i++) {
                try
                {
                    JSONObject jsonParameter = params.getJSONObject(i);
                    SoftwareParameter parameter = SoftwareParameter.fromJSON(jsonParameter);
                    parameter.setSoftware(software);
                    if (!software.getParameters().contains(parameter)) {
                        software.addParameter(parameter);
                    }
                } catch (JSONException e) {
                    log.error("Invalid app parameters value. Please specify " +
                            "an array of JSON objects describing the parameters for this app.");
                }
            }
            JSONArray inputs = json.getJSONArray("inputs");
            for(int i=0; i< inputs.length(); i++) {
                try
                {
                    JSONObject jsonParameter = inputs.getJSONObject(i);
                    SoftwareInput input = SoftwareInput.fromJSON(jsonParameter);
                    input.setSoftware(software);
                    if (!software.getInputs().contains(input)) {
                        software.addInput(input);
                    }
                } catch (JSONException e) {
                    log.error("Invalid app input value. Please specify " +
                            "an array of JSON objects describing the inputs for this app.");
                }
            }
            software.setVersion("0.1");
        } catch (IOException|JSONException e) {
            fail("Test system id should not throw exception", e);
        }
        return software;
    }
private Software createMockSoftware ( ExecutionSystem executionSystem , ExecutionType executionType ) { final Software software = new Software ( ) ; try { JSONObject json = JSONTestDataUtil . getInstance ( ) . getTestDataObject ( JSONTestDataUtil . TEST_SOFTWARE_FOLDER + "/singularity-1.0/app.json" ) ; software . setExecutionSystem ( executionSystem ) ; software . setExecutionType ( executionType ) ; software . setName ( UUID . randomUUID ( ) . toString ( ) ) ; JSONArray params = json . getJSONArray ( "parameters" ) ; for ( int i = 0 ; i < params . length ( ) ; i ++ ) { try { JSONObject jsonParameter = params . getJSONObject ( i ) ; SoftwareParameter parameter = SoftwareParameter . fromJSON ( jsonParameter ) ; parameter . setSoftware ( software ) ; if ( ! software . getParameters ( ) . contains ( parameter ) ) { software . addParameter ( parameter ) ; } } catch ( JSONException e ) { log . error ( "Invalid app parameters value. Please specify " + "an array of JSON objects describing the parameters for this app." ) ; } } JSONArray inputs = json . getJSONArray ( "inputs" ) ; for ( int i = 0 ; i < inputs . length ( ) ; i ++ ) { try { JSONObject jsonParameter = inputs . getJSONObject ( i ) ; SoftwareInput input = SoftwareInput . fromJSON ( jsonParameter ) ; input . setSoftware ( software ) ; if ( ! software . getInputs ( ) . contains ( input ) ) { software . addInput ( input ) ; } } catch ( JSONException e ) { log . error ( "Invalid app input value. Please specify " + "an array of JSON objects describing the inputs for this app." ) ; } } software . setVersion ( "0.1" ) ; } catch ( IOException | JSONException e ) { fail ( "Test system id should not throw exception" , e ) ; } return software ; }
Generator for test {@link Software}
 @param executionSystem the execution system to assign to the software
 @param executionType the execution type to assign to software
 @return a software instance to use in testing
Generator for test { @link Software } @param executionSystem the execution system to assign to the software @param executionType the execution type to assign to software @return a software instance to use in testing