use of ca.corefacility.bioinformatics.irida.model.workflow.description.IridaToolParameter in project irida by phac-nml.
the class AnalysisParameterServiceGalaxyTest method testPrepareParametersOverrideMultipleLevelMultipleParameterSuccess.
/**
* Tests preparing workflow parameters with multiple levels, multiple
* parameters and overriding with custom value successfully.
*
* @throws IridaWorkflowParameterException
*/
@Test
public void testPrepareParametersOverrideMultipleLevelMultipleParameterSuccess() throws IridaWorkflowParameterException {
IridaToolParameter iridaToolParameter = new IridaToolParameter("galaxy-tool1", "level1.parameter1");
IridaToolParameter iridaToolParameter2 = new IridaToolParameter("galaxy-tool1", "level1.parameter2");
IridaWorkflowParameter parameter1 = new IridaWorkflowParameter("parameter1", "0", Lists.newArrayList(iridaToolParameter, iridaToolParameter2));
List<IridaWorkflowParameter> iridaWorkflowParameters = Lists.newArrayList(parameter1);
when(iridaWorkflowDescription.getParameters()).thenReturn(iridaWorkflowParameters);
Map<String, String> parameters = Maps.newHashMap();
parameters.put("parameter1", "1");
WorkflowInputsGalaxy workflowInputsGalaxy = analysisParameterService.prepareAnalysisParameters(parameters, iridaWorkflow);
assertNotNull("workflowInputsGalaxy is null", workflowInputsGalaxy);
WorkflowInputs workflowInputs = workflowInputsGalaxy.getInputsObject();
Map<Object, Map<String, Object>> workflowParameters = workflowInputs.getParameters();
Map<String, Object> tool1Parameters = workflowParameters.get("galaxy-tool1");
assertNotNull("parameters for galaxy-tool1 should not be null", tool1Parameters);
assertEquals("parameter not properly defined", ImmutableMap.of("level1", ImmutableMap.of("parameter1", "1", "parameter2", "1")), tool1Parameters);
}
use of ca.corefacility.bioinformatics.irida.model.workflow.description.IridaToolParameter in project irida by phac-nml.
the class AnalysisParameterServiceGalaxyTest method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
analysisParameterService = new AnalysisParameterServiceGalaxy();
when(iridaWorkflow.getWorkflowDescription()).thenReturn(iridaWorkflowDescription);
IridaToolParameter iridaToolParameter = new IridaToolParameter("galaxy-tool1", "parameter1");
IridaWorkflowParameter parameter1 = new IridaWorkflowParameter("parameter1", "0", Lists.newArrayList(iridaToolParameter));
List<IridaWorkflowParameter> iridaWorkflowParameters = Lists.newArrayList(parameter1);
when(iridaWorkflowDescription.getParameters()).thenReturn(iridaWorkflowParameters);
when(iridaWorkflowDescription.acceptsParameters()).thenReturn(true);
}
use of ca.corefacility.bioinformatics.irida.model.workflow.description.IridaToolParameter in project irida by phac-nml.
the class IridaWorkflowLoaderServiceIT method buildTestDescription.
private IridaWorkflowDescription buildTestDescription(UUID id, String name, String version, String sequenceReadsSingle, String sequenceReadsPaired, boolean requiresSingleSample) throws MalformedURLException {
List<IridaWorkflowOutput> outputs = new LinkedList<>();
outputs.add(new IridaWorkflowOutput("output1", "output1.txt"));
outputs.add(new IridaWorkflowOutput("output2", "output2.txt"));
List<IridaWorkflowToolRepository> tools = new LinkedList<>();
IridaWorkflowToolRepository workflowTool = new IridaWorkflowToolRepository("sam_to_bam", "devteam", new URL("http://toolshed.g2.bx.psu.edu/"), "8176b2575aa1");
tools.add(workflowTool);
List<IridaWorkflowParameter> parameters = new LinkedList<>();
IridaToolParameter tool1 = new IridaToolParameter("irida.corefacility.ca/galaxy-shed/repos/irida/test-tool/0.1", "a");
IridaToolParameter tool2 = new IridaToolParameter("irida.corefacility.ca/galaxy-shed/repos/irida/test-tool/0.1", "b");
IridaWorkflowParameter parameter1 = new IridaWorkflowParameter("test-parameter", "1", Lists.newArrayList(tool1, tool2));
parameters.add(parameter1);
IridaWorkflowDescription iridaWorkflow = new IridaWorkflowDescription(id, name, version, AnalysisType.DEFAULT, new IridaWorkflowInput(sequenceReadsSingle, sequenceReadsPaired, "reference", requiresSingleSample), outputs, tools, parameters);
return iridaWorkflow;
}
Aggregations