Search in sources :

Example 6 with HistoryDetails

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

the class GalaxyWorkflowStatusTest method testErrorOccuredFailedMetadataStillRunning.

/**
 * Tests whether or not this workflow is in an error state when there is
 * failed metadata but the overall workflow is still running.
 */
@Test
public void testErrorOccuredFailedMetadataStillRunning() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("running");
    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 7 with HistoryDetails

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

the class GalaxyWorkflowStatusTest method testErrorOccuredWhileStillRunning.

/**
 * Tests whether or not an error occured even while still running.
 */
@Test
public void testErrorOccuredWhileStillRunning() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("running");
    historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("error", 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 8 with HistoryDetails

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

the class GalaxyWorkflowStatusTest method testCompletedSuccessfully.

/**
 * Tests whether or not this workflow completed successfully.
 */
@Test
public void testCompletedSuccessfully() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("ok");
    historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("ok", Lists.newArrayList(DATASET_ID)));
    GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
    assertTrue("Workflow did not complete successfully", workflowStatus.completedSuccessfully());
}
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 9 with HistoryDetails

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

the class GalaxyWorkflowStatusTest method testBuildWorkflowStatusFromHistoryDetailsUnknownState.

/**
 * Tests failing to build a workflow status due to an unknwon state.
 */
@Test(expected = NullPointerException.class)
public void testBuildWorkflowStatusFromHistoryDetailsUnknownState() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("unknown");
    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 10 with HistoryDetails

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

the class GalaxyWorkflowStatusTest method testErrorOccured.

/**
 * Tests whether or not this workflow is in an error state.
 */
@Test
public void testErrorOccured() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("error");
    historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("error", 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)

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