Search in sources :

Example 11 with HistoryDetails

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

the class GalaxyWorkflowStatusTest method testBuildWorkflowStatusFromHistoryDetailsSuccessQuarterComplete.

/**
 * Tests successfully building a workflow status from history details
 * (quater complete).
 */
@Test
public void testBuildWorkflowStatusFromHistoryDetailsSuccessQuarterComplete() {
    Map<String, List<String>> stateIds = Util.buildStateIdsWithStateFilled("running", Lists.newArrayList(DATASET_ID, DATASET_ID2, DATASET_ID3));
    stateIds.put("ok", Lists.newArrayList(DATASET_ID));
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("running");
    historyDetails.setStateIds(stateIds);
    GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
    assertEquals("workflow status not in correct state", GalaxyWorkflowState.RUNNING, workflowStatus.getState());
    assertEquals("percentage complete not correct", 0.25f, workflowStatus.getProportionComplete(), DELTA);
}
Also used : HistoryDetails(com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails) List(java.util.List) GalaxyWorkflowStatus(ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus) Test(org.junit.Test)

Example 12 with HistoryDetails

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

the class GalaxyWorkflowStatusTest method testBuildWorkflowStatusFromHistoryDetailsSuccessRunning.

/**
 * Tests successfully building a workflow status from history details (still
 * running).
 */
@Test
public void testBuildWorkflowStatusFromHistoryDetailsSuccessRunning() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("running");
    Map<String, List<String>> stateIds = Util.buildStateIdsWithStateFilled("running", Lists.newArrayList(DATASET_ID));
    stateIds.put("ok", Lists.newArrayList(DATASET_ID));
    historyDetails.setStateIds(stateIds);
    GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
    assertEquals("workflow status not in correct state", GalaxyWorkflowState.RUNNING, workflowStatus.getState());
    assertEquals("percentage complete not correct", 0.5f, workflowStatus.getProportionComplete(), DELTA);
}
Also used : HistoryDetails(com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails) List(java.util.List) GalaxyWorkflowStatus(ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus) Test(org.junit.Test)

Example 13 with HistoryDetails

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

the class GalaxyWorkflowStatusTest method testIsRunning.

/**
 * Tests whether or not this workflow is still running.
 */
@Test
public void testIsRunning() {
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("running");
    historyDetails.setStateIds(Util.buildStateIdsWithStateFilled("running", Lists.newArrayList(DATASET_ID)));
    GalaxyWorkflowStatus workflowStatus = GalaxyWorkflowStatus.builder(historyDetails).build();
    assertTrue("Workflow is not still running", workflowStatus.isRunning());
}
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 14 with HistoryDetails

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

the class GalaxyWorkflowStatusTest method testBuildWorkflowStatusFromHistoryDetailsMissingStateSuccess.

/**
 *	Tests building a GalaxyWorkflowStatus object which has a subset of
 *	the expected states and passing
 */
@Test
public void testBuildWorkflowStatusFromHistoryDetailsMissingStateSuccess() {
    Map<String, List<String>> stateIds = Util.buildStateIdsWithStateFilled("ok", Lists.newArrayList(DATASET_ID));
    stateIds.remove("running");
    HistoryDetails historyDetails = new HistoryDetails();
    historyDetails.setState("ok");
    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 15 with HistoryDetails

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

the class GalaxyHistoriesServiceIT method testLibraryDatasetToHistorySuccess.

/**
 * Tests moving a library dataset to a history success.
 * @throws ExecutionManagerObjectNotFoundException
 * @throws CreateLibraryException
 */
@Test
public void testLibraryDatasetToHistorySuccess() throws CreateLibraryException, ExecutionManagerObjectNotFoundException {
    Library library = buildEmptyLibrary("GalaxyHistoriesServiceIT.testLibraryDatasetToHistory");
    String fileId = setupLibraries(library, galaxyInstanceAdmin);
    History history = galaxyHistory.newHistoryForWorkflow();
    HistoryDetails details = galaxyHistory.libraryDatasetToHistory(fileId, history);
    assertNotNull(details);
}
Also used : HistoryDetails(com.github.jmchilton.blend4j.galaxy.beans.HistoryDetails) Library(com.github.jmchilton.blend4j.galaxy.beans.Library) History(com.github.jmchilton.blend4j.galaxy.beans.History) 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