Search in sources :

Example 1 with WorkflowInputDefinition

use of com.github.jmchilton.blend4j.galaxy.beans.WorkflowInputDefinition in project irida by phac-nml.

the class GalaxyWorkflowServiceTest method testGetWorkflowInputIdValid.

/**
 * Tests getting a valid workflow input id from a workflow details.
 * @throws WorkflowException
 */
@Test
public void testGetWorkflowInputIdValid() throws WorkflowException {
    WorkflowDetails details = new WorkflowDetails();
    WorkflowInputDefinition validDefinition = new WorkflowInputDefinition();
    validDefinition.setLabel("valid");
    Map<String, WorkflowInputDefinition> workflowInputMap = new HashMap<>();
    workflowInputMap.put("validInputId", validDefinition);
    details.setInputs(workflowInputMap);
    assertEquals("validInputId", galaxyWorkflowService.getWorkflowInputId(details, "valid"));
}
Also used : WorkflowInputDefinition(com.github.jmchilton.blend4j.galaxy.beans.WorkflowInputDefinition) HashMap(java.util.HashMap) WorkflowDetails(com.github.jmchilton.blend4j.galaxy.beans.WorkflowDetails) Test(org.junit.Test)

Example 2 with WorkflowInputDefinition

use of com.github.jmchilton.blend4j.galaxy.beans.WorkflowInputDefinition in project irida by phac-nml.

the class GalaxyWorkflowServiceTest method testGetWorkflowInputIdInvalid.

/**
 * Tests failing to find a valid workflow input id from a workflow details.
 * @throws WorkflowException
 */
@Test(expected = WorkflowException.class)
public void testGetWorkflowInputIdInvalid() throws WorkflowException {
    WorkflowDetails details = new WorkflowDetails();
    WorkflowInputDefinition validDefinition = new WorkflowInputDefinition();
    validDefinition.setLabel("valid");
    Map<String, WorkflowInputDefinition> workflowInputMap = new HashMap<>();
    workflowInputMap.put("validInputId", validDefinition);
    details.setInputs(workflowInputMap);
    galaxyWorkflowService.getWorkflowInputId(details, "invalid");
}
Also used : WorkflowInputDefinition(com.github.jmchilton.blend4j.galaxy.beans.WorkflowInputDefinition) HashMap(java.util.HashMap) WorkflowDetails(com.github.jmchilton.blend4j.galaxy.beans.WorkflowDetails) Test(org.junit.Test)

Example 3 with WorkflowInputDefinition

use of com.github.jmchilton.blend4j.galaxy.beans.WorkflowInputDefinition in project irida by phac-nml.

the class GalaxyWorkflowServiceTest method setup.

/**
 * Sets up variables for workflow tests.
 * @throws URISyntaxException
 */
@Before
public void setup() throws URISyntaxException {
    MockitoAnnotations.initMocks(this);
    galaxyWorkflowService = new GalaxyWorkflowService(workflowsClient, StandardCharsets.UTF_8);
    String workflowInputId = "1";
    WorkflowInputDefinition worklowInput = new WorkflowInputDefinition();
    worklowInput.setLabel(VALID_INPUT_LABEL);
    workflowInputs = new HashMap<String, WorkflowInputDefinition>();
    workflowInputs.put(workflowInputId, worklowInput);
    when(workflowsClient.showWorkflow(VALID_WORKFLOW_ID)).thenReturn(workflowDetails);
    when(workflowDetails.getInputs()).thenReturn(workflowInputs);
}
Also used : WorkflowInputDefinition(com.github.jmchilton.blend4j.galaxy.beans.WorkflowInputDefinition) GalaxyWorkflowService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyWorkflowService) Before(org.junit.Before)

Aggregations

WorkflowInputDefinition (com.github.jmchilton.blend4j.galaxy.beans.WorkflowInputDefinition)3 WorkflowDetails (com.github.jmchilton.blend4j.galaxy.beans.WorkflowDetails)2 HashMap (java.util.HashMap)2 Test (org.junit.Test)2 GalaxyWorkflowService (ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyWorkflowService)1 Before (org.junit.Before)1