use of com.github.jmchilton.blend4j.galaxy.beans.History in project irida by phac-nml.
the class GalaxyHistoriesServiceIT method testFilesToLibraryToHistoryFailNoHistory.
/**
* Tests failure to upload a list of files to a Galaxy history through a Library (no history).
*
* @throws UploadException
* @throws GalaxyDatasetException
*/
@Test(expected = UploadException.class)
public void testFilesToLibraryToHistoryFailNoHistory() throws UploadException, GalaxyDatasetException {
History history = galaxyHistory.newHistoryForWorkflow();
history.setId("invalid");
Library library = buildEmptyLibrary("testFilesToLibraryToHistoryFail");
galaxyHistory.filesToLibraryToHistory(Sets.newHashSet(dataFile), FILE_TYPE, history, library, DataStorage.LOCAL);
}
use of com.github.jmchilton.blend4j.galaxy.beans.History in project irida by phac-nml.
the class GalaxyHistoriesServiceIT method testDownloadDatasetFailDatasetId.
/**
* Tests failing to download a dataset (invalid dataset id)
* @throws IOException
* @throws InterruptedException
* @throws ExecutionManagerException
* @throws TimeoutException
*/
@Test(expected = ExecutionManagerDownloadException.class)
public void testDownloadDatasetFailDatasetId() 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 invalidDatasetId = dataset.getId() + "a";
Path datasetPath = Files.createTempFile("data", "fastq");
galaxyHistory.downloadDatasetTo(history.getId(), invalidDatasetId, datasetPath);
}
use of com.github.jmchilton.blend4j.galaxy.beans.History in project irida by phac-nml.
the class GalaxyHistoriesServiceIT method testNewHistoryForWorkflow.
/**
* Tests constructing new history for a workflow.
*/
@Test
public void testNewHistoryForWorkflow() {
GalaxyInstance galaxyInstanceAdmin = localGalaxy.getGalaxyInstanceAdmin();
HistoriesClient historiesClient = galaxyInstanceAdmin.getHistoriesClient();
History actualHistory = galaxyHistory.newHistoryForWorkflow();
assertNotNull(actualHistory);
// make sure history is within Galaxy
History foundHistory = null;
for (History h : historiesClient.getHistories()) {
if (h.getId().equals(actualHistory.getId())) {
foundHistory = h;
}
}
assertNotNull(foundHistory);
}
use of com.github.jmchilton.blend4j.galaxy.beans.History in project irida by phac-nml.
the class GalaxyHistoriesServiceIT method testFileToHistoryInvalidType.
/**
* Tests failure to upload file to history due to invalid file type.
* @throws UploadException
* @throws GalaxyDatasetException
*/
@Test(expected = NullPointerException.class)
public void testFileToHistoryInvalidType() throws UploadException, GalaxyDatasetException {
History history = galaxyHistory.newHistoryForWorkflow();
galaxyHistory.fileToHistory(dataFile, INVALID_FILE_TYPE, history);
}
use of com.github.jmchilton.blend4j.galaxy.beans.History in project irida by phac-nml.
the class GalaxyHistoriesServiceIT method testDownloadDatasetSuccess.
/**
* Tests downloading a dataset successfully.
* @throws IOException
* @throws InterruptedException
* @throws ExecutionManagerException
* @throws TimeoutException
*/
@Test
public void testDownloadDatasetSuccess() throws IOException, TimeoutException, ExecutionManagerException, InterruptedException {
History history = galaxyHistory.newHistoryForWorkflow();
Dataset dataset = galaxyHistory.fileToHistory(dataFile, InputFileType.FASTQ_SANGER, history);
Util.waitUntilHistoryComplete(history.getId(), galaxyHistory, 60);
Path datasetPath = Files.createTempFile("data", "fastq");
galaxyHistory.downloadDatasetTo(history.getId(), dataset.getId(), datasetPath);
assertEquals("file lengths should be equals", Files.size(dataFile), Files.size(datasetPath));
assertTrue("uploaded and downloaded dataset should be equal", com.google.common.io.Files.equal(dataFile.toFile(), datasetPath.toFile()));
}
Aggregations