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