use of com.github.jmchilton.blend4j.galaxy.beans.Dataset in project irida by phac-nml.
the class GalaxyHistoriesServiceIT method testFilesToLibraryToHistoryRemoteSuccess.
/**
* Tests successful upload of a file to a Galaxy history through a Library (where files are remote files).
*
* @throws UploadException
* @throws GalaxyDatasetException
*/
@Test
public void testFilesToLibraryToHistoryRemoteSuccess() throws UploadException, GalaxyDatasetException {
History history = galaxyHistory.newHistoryForWorkflow();
Library library = buildEmptyLibrary("testFilesToLibraryToHistorySuccess");
Map<Path, String> datasetsMap = galaxyHistory.filesToLibraryToHistory(Sets.newHashSet(dataFile, dataFile2), FILE_TYPE, history, library, DataStorage.REMOTE);
assertNotNull(datasetsMap);
assertEquals(2, datasetsMap.size());
String datasetId1 = datasetsMap.get(dataFile);
String datasetId2 = datasetsMap.get(dataFile2);
Dataset actualDataset1 = localGalaxy.getGalaxyInstanceAdmin().getHistoriesClient().showDataset(history.getId(), datasetId1);
assertNotNull(actualDataset1);
Dataset actualDataset2 = localGalaxy.getGalaxyInstanceAdmin().getHistoriesClient().showDataset(history.getId(), datasetId2);
assertNotNull(actualDataset2);
}
use of com.github.jmchilton.blend4j.galaxy.beans.Dataset in project irida by phac-nml.
the class GalaxyHistoriesServiceIT method testFileToHistory.
/**
* Tests direct upload of a file to a Galaxy history.
* @throws UploadException
* @throws GalaxyDatasetException
*/
@Test
public void testFileToHistory() throws UploadException, GalaxyDatasetException {
History history = galaxyHistory.newHistoryForWorkflow();
String filename = dataFile.toFile().getName();
Dataset actualDataset = galaxyHistory.fileToHistory(dataFile, FILE_TYPE, history);
assertNotNull(actualDataset);
String dataId = Util.getIdForFileInHistory(filename, history.getId(), localGalaxy.getGalaxyInstanceAdmin());
assertEquals(dataId, actualDataset.getId());
}
use of com.github.jmchilton.blend4j.galaxy.beans.Dataset 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.Dataset 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.Dataset 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);
}
Aggregations