Search in sources :

Example 1 with HistoryDetails

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

the class GalaxyWorkflowStatusTest method testBuildWorkflowStatusFromHistoryDetailsUnknownStateIdsFail.

/**
 * Tests failing to build a GalaxyWorkflowStats object with some state
 * ids in an unknown state.
 */
@Test(expected = NullPointerException.class)
public void testBuildWorkflowStatusFromHistoryDetailsUnknownStateIdsFail() {
    Map<String, List<String>> stateIds = Util.buildStateIdsWithStateFilled("running", Lists.newArrayList(DATASET_ID));
    stateIds.put("unknown", Lists.newArrayList(DATASET_ID));
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("running");
    historyDetails.setStateIds(stateIds);
    GalaxyWorkflowStatus.builder(historyDetails).build();
}
Also used : HistoryDetails(com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails) List(java.util.List) Test(org.junit.Test)

Example 2 with HistoryDetails

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

the class GalaxyWorkflowStatusTest method testErrorOccuredFailedMetadata.

/**
 * Tests whether or not this workflow is in an error state when there is
 * failed metadata.
 */
@Test
public void testErrorOccuredFailedMetadata() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("failed_metadata");
    historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("failed_metadata", Lists.newArrayList(DATASET_ID)));
    GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
    assertTrue("Workflow is not in an error state", workflowStatus.errorOccurred());
}
Also used : HistoryDetails(com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails) GalaxyWorkflowStatus(ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus) Test(org.junit.Test)

Example 3 with HistoryDetails

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

the class GalaxyWorkflowStatusTest method testErrorOccuredEmptyStillRunning.

/**
 * Tests whether or not this workflow is in an error state when it is empty
 * but the overall workflow is still running.
 */
@Test
public void testErrorOccuredEmptyStillRunning() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("running");
    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());
}
Also used : HistoryDetails(com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails) GalaxyWorkflowStatus(ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus) Test(org.junit.Test)

Example 4 with HistoryDetails

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

the class GalaxyWorkflowStatusTest method testBuildWorkflowStatusFromHistoryDetailsErrorNoDetailsState.

/**
 * Tests building a GalaxyWorkflowStatus object with no history details
 * state and failing.
 */
@Test(expected = NullPointerException.class)
public void testBuildWorkflowStatusFromHistoryDetailsErrorNoDetailsState() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("ok", Lists.newArrayList(DATASET_ID)));
    GalaxyWorkflowStatus.builder(historyDetails).build();
}
Also used : HistoryDetails(com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails) Test(org.junit.Test)

Example 5 with HistoryDetails

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

the class GalaxyWorkflowStatusTest method testBuildWorkflowStatusFromHistoryDetailsErrorNoDetailsIdsMap.

/**
 * Tests building a GalaxyWorkflowStatus object with no history details
 * state ids map and failing.
 */
@Test(expected = NullPointerException.class)
public void testBuildWorkflowStatusFromHistoryDetailsErrorNoDetailsIdsMap() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("ok");
    historyDetails.setStateIds(null);
    GalaxyWorkflowStatus.builder(historyDetails).build();
}
Also used : HistoryDetails(com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails) Test(org.junit.Test)

Aggregations

HistoryDetails (com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails)28 Test (org.junit.Test)25 GalaxyWorkflowStatus (ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus)18 List (java.util.List)5 Dataset (com.github.jmchilton.blend4j.galaxy.beans.Dataset)3 WorkflowOutputs (com.github.jmchilton.blend4j.galaxy.beans.WorkflowOutputs)3 History (com.github.jmchilton.blend4j.galaxy.beans.History)2 HistoryContentsProvenance (com.github.jmchilton.blend4j.galaxy.beans.HistoryContentsProvenance)2 Path (java.nio.file.Path)2 UploadException (ca.corefacility.bioinformatics.irida.exceptions.UploadException)1 WorkflowException (ca.corefacility.bioinformatics.irida.exceptions.WorkflowException)1 JobError (ca.corefacility.bioinformatics.irida.model.workflow.analysis.JobError)1 GalaxyWorkflowState (ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowState)1 AnalysisSubmission (ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission)1 HistoriesClient (com.github.jmchilton.blend4j.galaxy.HistoriesClient)1 JobsClient (com.github.jmchilton.blend4j.galaxy.JobsClient)1 ToolsClient (com.github.jmchilton.blend4j.galaxy.ToolsClient)1 HistoryDataset (com.github.jmchilton.blend4j.galaxy.beans.HistoryDataset)1 JobDetails (com.github.jmchilton.blend4j.galaxy.beans.JobDetails)1 Library (com.github.jmchilton.blend4j.galaxy.beans.Library)1