use of ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus in project irida by phac-nml.
the class GalaxyWorkflowStatusTest method testBuildWorkflowStatusFromHistoryDetailsSuccessQueued.
/**
* Tests successfully building a workflow status from history details (still
* queued).
*/
@Test
public void testBuildWorkflowStatusFromHistoryDetailsSuccessQueued() {
HistoryDetails historyDetails = new HistoryDetails();
historyDetails.setState("queued");
historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("queued", Lists.newArrayList(DATASET_ID)));
GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
assertEquals("workflow status not in correct state", GalaxyWorkflowState.QUEUED, workflowStatus.getState());
assertEquals("percentage complete not correct", 0.0f, workflowStatus.getProportionComplete(), DELTA);
}
use of ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus in project irida by phac-nml.
the class GalaxyWorkflowStatusTest method testIsRunningWhileQueued.
/**
* Tests whether or not this workflow is considered still running (while
* queued).
*/
@Test
public void testIsRunningWhileQueued() {
HistoryDetails historyDetails = new HistoryDetails();
historyDetails.setState("queued");
historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("queued", Lists.newArrayList(DATASET_ID)));
GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
assertTrue("Workflow is not still running", workflowStatus.isRunning());
}
use of ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus in project irida by phac-nml.
the class GalaxyWorkflowStatusTest method testErrorOccuredEmpty.
/**
* Tests whether or not this workflow is in an error state when it is an
* empty state.
*/
@Test
public void testErrorOccuredEmpty() {
HistoryDetails historyDetails = new HistoryDetails();
historyDetails.setState("empty");
historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("empty", Lists.newArrayList(DATASET_ID)));
GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
assertTrue("Workflow is not in an error state", workflowStatus.errorOccurred());
}
use of ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus in project irida by phac-nml.
the class GalaxyWorkflowStatusTest method testErrorOccuredDiscardedStillRunning.
/**
* Tests whether or not this workflow is in an error state when it is discarded
* but the overall workflow is still running.
*/
@Test
public void testErrorOccuredDiscardedStillRunning() {
HistoryDetails historyDetails = new HistoryDetails();
historyDetails.setState("discarded");
historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("discarded", Lists.newArrayList(DATASET_ID)));
GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
assertTrue("Workflow is not in an error state", workflowStatus.errorOccurred());
}
use of ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus in project irida by phac-nml.
the class GalaxyHistoriesServiceTest method testGetStatusPartialCompleteState.
/**
* Tests getting status for a running workflow state.
* @throws ExecutionManagerException
*/
@Test
public void testGetStatusPartialCompleteState() throws ExecutionManagerException {
Map<String, List<String>> validStateIds = Util.buildStateIdsWithStateFilled("ok", Arrays.asList("1"));
validStateIds.put("running", Arrays.asList("2"));
when(historiesClient.showHistory(VALID_HISTORY_ID)).thenReturn(historyDetails);
when(historyDetails.getState()).thenReturn("running");
when(historyDetails.getStateIds()).thenReturn(validStateIds);
GalaxyWorkflowStatus status = galaxyHistory.getStatusForHistory(VALID_HISTORY_ID);
assertEquals(GalaxyWorkflowState.RUNNING, status.getState());
assertEquals("proportion complete is invalid", 0.5f, status.getProportionComplete(), delta);
}
Aggregations