Search in sources :

Example 31 with History

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

the class GalaxyHistoriesServiceIT method testGetDatasetForFileInHistoryFailMultipleDatasets.

/**
 * Tests getting a dataset for a file in the history and failing due to multiple datasets.
 * @throws UploadException
 * @throws GalaxyDatasetException
 */
@Test(expected = GalaxyDatasetException.class)
public void testGetDatasetForFileInHistoryFailMultipleDatasets() throws UploadException, GalaxyDatasetException {
    History history = galaxyHistory.newHistoryForWorkflow();
    Dataset dataset1 = galaxyHistory.fileToHistory(dataFile, InputFileType.FASTQ_SANGER, history);
    galaxyHistory.fileToHistory(dataFile, InputFileType.FASTQ_SANGER, history);
    String datasetName = dataset1.getName();
    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 32 with History

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

the class GalaxyHistoriesServiceIT method testInvalidFileToHistory.

/**
 * Tests direct upload of an invalid (not found) file to a Galaxy history.
 * @throws UploadException
 * @throws GalaxyDatasetException
 */
@Test(expected = IllegalStateException.class)
public void testInvalidFileToHistory() throws UploadException, GalaxyDatasetException {
    History history = galaxyHistory.newHistoryForWorkflow();
    galaxyHistory.fileToHistory(dataFileInvalid, FILE_TYPE, history);
}
Also used : History(com.github.jmchilton.blend4j.galaxy.beans.History) Test(org.junit.Test)

Example 33 with History

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

the class GalaxyHistoriesServiceIT method testGetDatasetForFileInHistorySuccess.

/**
 * Tests getting a dataset for a file in the history.
 * @throws UploadException
 * @throws GalaxyDatasetException
 */
@Test
public void testGetDatasetForFileInHistorySuccess() throws UploadException, GalaxyDatasetException {
    History history = galaxyHistory.newHistoryForWorkflow();
    Dataset dataset = galaxyHistory.fileToHistory(dataFile, InputFileType.FASTQ_SANGER, history);
    String datasetName = dataset.getName();
    Dataset actualDataset = galaxyHistory.getDatasetForFileInHistory(datasetName, history.getId());
    assertEquals("actual output dataset id should equal dataset created id", dataset.getId(), actualDataset.getId());
}
Also used : Dataset(com.github.jmchilton.blend4j.galaxy.beans.Dataset) History(com.github.jmchilton.blend4j.galaxy.beans.History) Test(org.junit.Test)

Example 34 with History

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

the class GalaxyHistoriesServiceIT method testConstructCollectionFail.

/**
 * Tests out failure to construct a collection of datasets.
 * @throws ExecutionManagerException
 */
@Test(expected = ExecutionManagerException.class)
public void testConstructCollectionFail() throws ExecutionManagerException {
    History history = galaxyHistory.newHistoryForWorkflow();
    Dataset dataset1 = galaxyHistory.fileToHistory(dataFile, FILE_TYPE, history);
    Dataset datasetInvalid = new Dataset();
    datasetInvalid.setId("invalidId");
    assertNotNull(dataset1);
    String collectionName = "collectionInvalid";
    CollectionDescription description = new CollectionDescription();
    description.setName(collectionName);
    description.setCollectionType(DatasetCollectionType.LIST.toString());
    HistoryDatasetElement element1 = new HistoryDatasetElement();
    element1.setId(dataset1.getId());
    element1.setName(dataset1.getName());
    description.addDatasetElement(element1);
    HistoryDatasetElement elementInvalid = new HistoryDatasetElement();
    elementInvalid.setId(datasetInvalid.getId());
    elementInvalid.setName(datasetInvalid.getName());
    description.addDatasetElement(elementInvalid);
    galaxyHistory.constructCollection(description, history);
}
Also used : Dataset(com.github.jmchilton.blend4j.galaxy.beans.Dataset) CollectionDescription(com.github.jmchilton.blend4j.galaxy.beans.collection.request.CollectionDescription) HistoryDatasetElement(com.github.jmchilton.blend4j.galaxy.beans.collection.request.HistoryDatasetElement) History(com.github.jmchilton.blend4j.galaxy.beans.History) Test(org.junit.Test)

Example 35 with History

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

the class GalaxyHistoriesServiceIT method testFindByIdSuccess.

/**
 * Tests successfully finding a history by an id.
 * @throws ExecutionManagerObjectNotFoundException
 */
@Test
public void testFindByIdSuccess() throws ExecutionManagerObjectNotFoundException {
    History history = galaxyHistory.newHistoryForWorkflow();
    assertNotNull(galaxyHistory.findById(history.getId()));
}
Also used : History(com.github.jmchilton.blend4j.galaxy.beans.History) 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