Search in sources :

Example 36 with History

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

the class GalaxyHistoriesServiceIT method testDeleteHistorySuccess.

/**
 * Tests deleting a history from Galaxy successfully.
 * @throws ExecutionManagerException
 */
@Test
public void testDeleteHistorySuccess() throws ExecutionManagerException {
    History history = galaxyHistory.newHistoryForWorkflow();
    assertNotNull("History contents should not be null", galaxyHistory.showHistoryContents(history.getId()));
    HistoryDeleteResponse deleteResponse = galaxyHistory.deleteHistory(history.getId());
    assertTrue("History is not deleted", deleteResponse.getDeleted());
}
Also used : HistoryDeleteResponse(com.github.jmchilton.blend4j.galaxy.beans.HistoryDeleteResponse) History(com.github.jmchilton.blend4j.galaxy.beans.History) Test(org.junit.Test)

Example 37 with History

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

the class GalaxyHistoriesServiceIT method testFilesToLibraryToHistoryFailNoLibrary.

/**
 * Tests failure to upload a list of files to a Galaxy history through a Library (no library).
 *
 * @throws UploadException
 * @throws GalaxyDatasetException
 */
@Test(expected = UploadException.class)
public void testFilesToLibraryToHistoryFailNoLibrary() throws UploadException, GalaxyDatasetException {
    History history = galaxyHistory.newHistoryForWorkflow();
    Library library = buildEmptyLibrary("testFilesToLibraryToHistoryFail");
    library.setId("invalid");
    galaxyHistory.filesToLibraryToHistory(Sets.newHashSet(dataFile), FILE_TYPE, history, library, DataStorage.LOCAL);
}
Also used : Library(com.github.jmchilton.blend4j.galaxy.beans.Library) History(com.github.jmchilton.blend4j.galaxy.beans.History) Test(org.junit.Test)

Example 38 with History

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

the class GalaxyHistoriesServiceIT method testGetDatasetForFileInHistoryFail.

/**
 * Tests getting a dataset for a file in the history and failing.
 * @throws UploadException
 * @throws GalaxyDatasetException
 */
@Test(expected = GalaxyDatasetNotFoundException.class)
public void testGetDatasetForFileInHistoryFail() throws UploadException, GalaxyDatasetException {
    History history = galaxyHistory.newHistoryForWorkflow();
    Dataset dataset = galaxyHistory.fileToHistory(dataFile, InputFileType.FASTQ_SANGER, history);
    String datasetName = dataset.getName() + "invalid";
    galaxyHistory.getDatasetForFileInHistory(datasetName, history.getId());
}
Also used : Dataset(com.github.jmchilton.blend4j.galaxy.beans.Dataset) History(com.github.jmchilton.blend4j.galaxy.beans.History) Test(org.junit.Test)

Example 39 with History

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

the class GalaxyHistoriesServiceIT method testDownloadDatasetFailHistoryId.

/**
 * Tests failing to download a dataset (invalid history id)
 * @throws IOException
 * @throws InterruptedException
 * @throws ExecutionManagerException
 * @throws TimeoutException
 */
@Test(expected = ExecutionManagerDownloadException.class)
@Ignore("Ignored because if inconsistent behaviour between Galaxy revisions.")
public void testDownloadDatasetFailHistoryId() throws IOException, TimeoutException, ExecutionManagerException, InterruptedException {
    History history = galaxyHistory.newHistoryForWorkflow();
    Dataset dataset = galaxyHistory.fileToHistory(dataFile, InputFileType.FASTQ_SANGER, history);
    Util.waitUntilHistoryComplete(history.getId(), galaxyHistory, 60);
    String invalidHistoryId = history.getId() + "a";
    Path datasetPath = Files.createTempFile("data", "fastq");
    galaxyHistory.downloadDatasetTo(invalidHistoryId, dataset.getId(), datasetPath);
}
Also used : Path(java.nio.file.Path) Dataset(com.github.jmchilton.blend4j.galaxy.beans.Dataset) History(com.github.jmchilton.blend4j.galaxy.beans.History) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 40 with History

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

the class GalaxyWorkflowsIT method testGetWorkflowStatusComplete.

/**
 * Tests executing a single workflow in Galaxy and getting the status after completion.
 * @throws ExecutionManagerException
 * @throws InterruptedException
 * @throws TimeoutException
 */
@Test
public void testGetWorkflowStatusComplete() throws ExecutionManagerException, TimeoutException, InterruptedException {
    History history = galaxyHistory.newHistoryForWorkflow();
    WorkflowOutputs workflowOutput = runSingleFileTabularWorkflowFilterTool(history, dataFile1, VALID_FILTER_PARAMETER);
    Util.waitUntilHistoryComplete(workflowOutput.getHistoryId(), galaxyHistory, 60);
    // test get workflow status
    GalaxyWorkflowStatus workflowStatus = galaxyHistory.getStatusForHistory(workflowOutput.getHistoryId());
    assertEquals("final workflow state is invalid", GalaxyWorkflowState.OK, workflowStatus.getState());
    assertTrue("final workflow state is invalid", workflowStatus.completedSuccessfully());
}
Also used : WorkflowOutputs(com.github.jmchilton.blend4j.galaxy.beans.WorkflowOutputs) History(com.github.jmchilton.blend4j.galaxy.beans.History) GalaxyWorkflowStatus(ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.GalaxyWorkflowStatus) Test(org.junit.Test)

Aggregations

History (com.github.jmchilton.blend4j.galaxy.beans.History)61 Test (org.junit.Test)54 Path (java.nio.file.Path)25 HistoriesClient (com.github.jmchilton.blend4j.galaxy.HistoriesClient)24 WithMockUser (org.springframework.security.test.context.support.WithMockUser)22 IridaWorkflow (ca.corefacility.bioinformatics.irida.model.workflow.IridaWorkflow)19 AnalysisSubmission (ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission)19 WorkflowsClient (com.github.jmchilton.blend4j.galaxy.WorkflowsClient)18 Workflow (com.github.jmchilton.blend4j.galaxy.beans.Workflow)18 Dataset (com.github.jmchilton.blend4j.galaxy.beans.Dataset)17 HistoryContents (com.github.jmchilton.blend4j.galaxy.beans.HistoryContents)11 Library (com.github.jmchilton.blend4j.galaxy.beans.Library)10 ToolsClient (com.github.jmchilton.blend4j.galaxy.ToolsClient)9 SequenceFilePair (ca.corefacility.bioinformatics.irida.model.sequenceFile.SequenceFilePair)8 SingleEndSequenceFile (ca.corefacility.bioinformatics.irida.model.sequenceFile.SingleEndSequenceFile)8 Analysis (ca.corefacility.bioinformatics.irida.model.workflow.analysis.Analysis)7 PreparedWorkflowGalaxy (ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.PreparedWorkflowGalaxy)7 CollectionResponse (com.github.jmchilton.blend4j.galaxy.beans.collection.response.CollectionResponse)7 WorkflowInputsGalaxy (ca.corefacility.bioinformatics.irida.model.workflow.execution.galaxy.WorkflowInputsGalaxy)6 WorkflowInputs (com.github.jmchilton.blend4j.galaxy.beans.WorkflowInputs)6