use of com.github.jmchilton.blend4j.galaxy.beans.Library 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.Library in project irida by phac-nml.
the class GalaxyHistoriesServiceIT method testLibraryDatasetToHistorySuccess.
/**
* Tests moving a library dataset to a history success.
* @throws ExecutionManagerObjectNotFoundException
* @throws CreateLibraryException
*/
@Test
public void testLibraryDatasetToHistorySuccess() throws CreateLibraryException, ExecutionManagerObjectNotFoundException {
Library library = buildEmptyLibrary("GalaxyHistoriesServiceIT.testLibraryDatasetToHistory");
String fileId = setupLibraries(library, galaxyInstanceAdmin);
History history = galaxyHistory.newHistoryForWorkflow();
HistoryDetails details = galaxyHistory.libraryDatasetToHistory(fileId, history);
assertNotNull(details);
}
use of com.github.jmchilton.blend4j.galaxy.beans.Library in project irida by phac-nml.
the class GalaxyHistoriesServiceIT method testFilesToLibraryToHistorySuccess.
/**
* Tests successful upload of a file to a Galaxy history through a Library.
*
* @throws UploadException
* @throws GalaxyDatasetException
*/
@Test
public void testFilesToLibraryToHistorySuccess() 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.LOCAL);
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.Library in project irida by phac-nml.
the class GalaxyLibrariesServiceIT method testFilesToLibraryWaitFail.
/**
* Tests failure to upload a list of files to a Galaxy history through a Library.
*
* @throws UploadException
* @throws GalaxyDatasetException
*/
@Test(expected = UploadException.class)
public void testFilesToLibraryWaitFail() throws UploadException, GalaxyDatasetException {
Library library = buildEmptyLibrary("testFilesToLibraryToHistoryFail");
library.setId("invalid");
galaxyLibrariesService.filesToLibraryWait(ImmutableSet.of(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 testFileToLibrarySuccess.
/**
* Tests successful upload of a file to a Galaxy Library.
*
* @throws UploadException
* @throws GalaxyDatasetException
*/
@Test
public void testFileToLibrarySuccess() throws UploadException, GalaxyDatasetException {
String filename = dataFile.toFile().getName();
Library library = buildEmptyLibrary("testFileToLibrarySuccess");
String datasetId = galaxyLibrariesService.fileToLibrary(dataFile, FILE_TYPE, library, DataStorage.LOCAL);
assertNotNull(datasetId);
LibraryDataset actualDataset = localGalaxy.getGalaxyInstanceAdmin().getLibrariesClient().showDataset(library.getId(), datasetId);
assertNotNull(actualDataset);
assertEquals(filename, actualDataset.getName());
assertEquals(Long.toString(dataFile.toFile().length()), actualDataset.getFileSize());
}
Aggregations