use of com.github.jmchilton.blend4j.galaxy.beans.Library 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.Library in project irida by phac-nml.
the class GalaxyLibrariesServiceIT method testDeleteLibrarySuccess.
/**
* Tests successfully deleting a data library.
*
* @throws ExecutionManagerException
*/
@Test
public void testDeleteLibrarySuccess() throws ExecutionManagerException {
Library library = buildEmptyLibrary("testDeleteLibrarySuccess");
Map<Path, String> datasetsMap = galaxyLibrariesService.filesToLibraryWait(ImmutableSet.of(dataFile), FILE_TYPE, library, DataStorage.LOCAL);
String datasetId = datasetsMap.get(dataFile);
assertNotNull("Dataset not uploaded correctly", librariesClient.showDataset(library.getId(), datasetId));
// Note: I cannot do much more to test deleting a library beyond making
// sure no exception is thrown.
// The Galaxy API still provides access to libraries even when deleted,
// but sets a deleted status.
// The status is not available in blend4j right now.
galaxyLibrariesService.deleteLibrary(library.getId());
}
use of com.github.jmchilton.blend4j.galaxy.beans.Library in project irida by phac-nml.
the class GalaxyLibrariesServiceIT method testFilesToLibraryWaitSuccess.
/**
* Tests successful upload of a list of files to a Galaxy Library.
*
* @throws UploadException
* @throws GalaxyDatasetException
*/
@Test
public void testFilesToLibraryWaitSuccess() throws UploadException, GalaxyDatasetException {
Library library = buildEmptyLibrary("testFilesToLibraryWaitSuccess");
Map<Path, String> datasetsMap = galaxyLibrariesService.filesToLibraryWait(Sets.newHashSet(dataFile, dataFile2), FILE_TYPE, library, DataStorage.LOCAL);
assertNotNull(datasetsMap);
assertEquals(2, datasetsMap.size());
String datasetId1 = datasetsMap.get(dataFile);
String datasetId2 = datasetsMap.get(dataFile2);
LibraryDataset actualDataset1 = localGalaxy.getGalaxyInstanceAdmin().getLibrariesClient().showDataset(library.getId(), datasetId1);
assertNotNull(actualDataset1);
LibraryDataset actualDataset2 = localGalaxy.getGalaxyInstanceAdmin().getLibrariesClient().showDataset(library.getId(), datasetId2);
assertNotNull(actualDataset2);
}
use of com.github.jmchilton.blend4j.galaxy.beans.Library in project irida by phac-nml.
the class GalaxyLibrariesServiceIT method testFileToLibraryFailure.
/**
* Tests failure to upload of a file to a Galaxy Library.
*
* @throws UploadException
* @throws GalaxyDatasetException
*/
@Test(expected = UploadException.class)
public void testFileToLibraryFailure() throws UploadException, GalaxyDatasetException {
Library library = buildEmptyLibrary("testFileToLibraryFailure");
library.setId("invalid");
galaxyLibrariesService.fileToLibrary(dataFile, FILE_TYPE, library, DataStorage.LOCAL);
}
use of com.github.jmchilton.blend4j.galaxy.beans.Library in project irida by phac-nml.
the class GalaxyLibrariesServiceIT method testFilesToLibraryWaitFailTimeout.
/**
* Tests failure to upload to a library due to a timeout issue.
*
* @throws UploadException
* @throws GalaxyDatasetException
*/
@Test(expected = UploadTimeoutException.class)
public void testFilesToLibraryWaitFailTimeout() throws UploadException, GalaxyDatasetException {
galaxyLibrariesService = new GalaxyLibrariesService(librariesClient, 1, 2, 1);
Library library = buildEmptyLibrary("testFilesToLibraryWaitFailTimeout");
galaxyLibrariesService.filesToLibraryWait(Sets.newHashSet(dataFile, dataFile2), FILE_TYPE, library, DataStorage.LOCAL);
}
Aggregations