use of ca.corefacility.bioinformatics.irida.exceptions.galaxy.CreateLibraryException in project irida by phac-nml.
the class GalaxyLibrariesService method buildEmptyLibrary.
/**
* Builds a new empty library with the given name.
*
* @param libraryName
* The name of the new library.
* @return A Library object for the newly created library.
* @throws CreateLibraryException
* If no library could be created.
*/
public Library buildEmptyLibrary(GalaxyProjectName libraryName) throws CreateLibraryException {
checkNotNull(libraryName, "libraryName is null");
Library persistedLibrary;
Library library = new Library(libraryName.getName());
persistedLibrary = librariesClient.createLibrary(library);
if (persistedLibrary != null) {
logger.debug("Created library=" + library.getName() + " libraryId=" + persistedLibrary.getId());
return persistedLibrary;
} else {
throw new CreateLibraryException("Could not create library named " + libraryName);
}
}
use of ca.corefacility.bioinformatics.irida.exceptions.galaxy.CreateLibraryException in project irida by phac-nml.
the class AnalysisWorkspaceServiceGalaxyTest method testPrepareAnalysisFilesNoCreateLibraryFail.
/**
* Tests out successfully to preparing an analysis with single files.
*
* @throws ExecutionManagerException
* @throws IridaWorkflowException
*/
@Test(expected = CreateLibraryException.class)
public void testPrepareAnalysisFilesNoCreateLibraryFail() throws ExecutionManagerException, IridaWorkflowException {
submission = AnalysisSubmission.builder(workflowId).name("my analysis").inputFiles(Sets.newHashSet(sampleSingleSequenceFileMap.values())).referenceFile(referenceFile).build();
submission.setRemoteAnalysisId(HISTORY_ID);
submission.setRemoteWorkflowId(WORKFLOW_ID);
when(iridaWorkflowsService.getIridaWorkflow(workflowId)).thenReturn(iridaWorkflowSingle);
when(galaxyHistoriesService.findById(HISTORY_ID)).thenReturn(workflowHistory);
when(galaxyLibrariesService.buildEmptyLibrary(any(GalaxyProjectName.class))).thenThrow(new CreateLibraryException(""));
workflowPreparation.prepareAnalysisFiles(submission);
}
Aggregations