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());
}
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);
}
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());
}
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);
}
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()));
}
Aggregations