Search in sources :

Example 1 with GalaxyLibrariesService

use of ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyLibrariesService in project irida by phac-nml.

the class GalaxyHistoriesServiceIT method setup.

/**
 * Sets up files for history tests.
 * @throws URISyntaxException
 * @throws IOException
 * @throws CreateLibraryException
 * @throws ExecutionManagerObjectNotFoundException
 */
@Before
public void setup() throws URISyntaxException, IOException, CreateLibraryException, ExecutionManagerObjectNotFoundException {
    setupDataFiles();
    galaxyInstanceAdmin = localGalaxy.getGalaxyInstanceAdmin();
    HistoriesClient historiesClient = galaxyInstanceAdmin.getHistoriesClient();
    ToolsClient toolsClient = galaxyInstanceAdmin.getToolsClient();
    LibrariesClient librariesClient = galaxyInstanceAdmin.getLibrariesClient();
    galaxyLibrariesService = new GalaxyLibrariesService(librariesClient, LIBRARY_POLLING_TIME, LIBRARY_TIMEOUT, 1);
    galaxyHistory = new GalaxyHistoriesService(historiesClient, toolsClient, galaxyLibrariesService);
}
Also used : GalaxyHistoriesService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyHistoriesService) ToolsClient(com.github.jmchilton.blend4j.galaxy.ToolsClient) LibrariesClient(com.github.jmchilton.blend4j.galaxy.LibrariesClient) HistoriesClient(com.github.jmchilton.blend4j.galaxy.HistoriesClient) GalaxyLibrariesService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyLibrariesService) Before(org.junit.Before)

Example 2 with GalaxyLibrariesService

use of ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyLibrariesService in project irida by phac-nml.

the class GalaxyLibrariesServiceIT method setup.

/**
 * Sets up variables for tests
 * @throws URISyntaxException
 */
@Before
public void setup() throws URISyntaxException {
    galaxyInstanceAdmin = localGalaxy.getGalaxyInstanceAdmin();
    librariesClient = galaxyInstanceAdmin.getLibrariesClient();
    galaxyLibrariesService = new GalaxyLibrariesService(librariesClient, LIBRARY_POLLING_TIME, LIBRARY_TIMEOUT, 1);
    dataFile = Paths.get(GalaxyLibrariesServiceIT.class.getResource("testData1.fastq").toURI());
    dataFile2 = Paths.get(GalaxyLibrariesServiceIT.class.getResource("testData2.fastq").toURI());
    dataFileFail = Paths.get(GalaxyLibrariesServiceIT.class.getResource("fail.fastq.gz").toURI());
}
Also used : GalaxyLibrariesService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyLibrariesService) Before(org.junit.Before)

Example 3 with GalaxyLibrariesService

use of ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyLibrariesService in project irida by phac-nml.

the class GalaxyWorkflowsIT method setup.

/**
 * Sets up files and objects for workflow tests.
 * @throws URISyntaxException
 * @throws IOException
 */
@Before
public void setup() throws URISyntaxException, IOException {
    Assume.assumeFalse(WindowsPlatformCondition.isWindows());
    dataFile1 = Paths.get(GalaxyWorkflowsIT.class.getResource("testData1.fastq").toURI());
    dataFile2 = Paths.get(GalaxyWorkflowsIT.class.getResource("testData2.fastq").toURI());
    dataFile3 = Paths.get(GalaxyWorkflowsIT.class.getResource("testData3.fastq").toURI());
    dataFile4 = Paths.get(GalaxyWorkflowsIT.class.getResource("testData4.fastq").toURI());
    workflowPath = Paths.get(GalaxyWorkflowsIT.class.getResource("GalaxyWorkflowSingleInput.ga").toURI());
    invalidWorkflowPath = Paths.get(GalaxyWorkflowsIT.class.getResource("InvalidGalaxyWorkflowSingleInput.ga").toURI());
    dataFileNotExists = Files.createTempFile("temp", ".temp");
    Files.delete(dataFileNotExists);
    assertFalse(Files.exists(dataFileNotExists));
    galaxyAdminInstance = localGalaxy.getGalaxyInstanceAdmin();
    toolsClient = galaxyAdminInstance.getToolsClient();
    workflowsClient = galaxyAdminInstance.getWorkflowsClient();
    historiesClient = galaxyAdminInstance.getHistoriesClient();
    librariesClient = galaxyAdminInstance.getLibrariesClient();
    GalaxyLibrariesService galaxyLibrariesService = new GalaxyLibrariesService(librariesClient, LIBRARY_POLLING_TIME, LIBRARY_TIMEOUT, 1);
    galaxyHistory = new GalaxyHistoriesService(historiesClient, toolsClient, galaxyLibrariesService);
    galaxyWorkflowService = new GalaxyWorkflowService(workflowsClient, StandardCharsets.UTF_8);
}
Also used : GalaxyHistoriesService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyHistoriesService) GalaxyWorkflowService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyWorkflowService) GalaxyLibrariesService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyLibrariesService) Before(org.junit.Before)

Example 4 with GalaxyLibrariesService

use of ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyLibrariesService in project irida by phac-nml.

the class GalaxyLibrariesServiceTest method testBuildEmptyLibrary.

/**
 * Tests create empty library.
 * @throws CreateLibraryException
 */
@Test
public void testBuildEmptyLibrary() throws CreateLibraryException {
    when(librariesClient.createLibrary(any(Library.class))).thenReturn(testLibrary);
    Library library = new GalaxyLibrariesService(librariesClient, 1, 2, 1).buildEmptyLibrary(new GalaxyProjectName("test"));
    assertNotNull(library);
    assertEquals("test", library.getName());
    assertEquals(LIBRARY_ID, library.getId());
}
Also used : Library(com.github.jmchilton.blend4j.galaxy.beans.Library) GalaxyProjectName(ca.corefacility.bioinformatics.irida.model.upload.galaxy.GalaxyProjectName) GalaxyLibrariesService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyLibrariesService) Test(org.junit.Test)

Example 5 with GalaxyLibrariesService

use of ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyLibrariesService in project irida by phac-nml.

the class GalaxyLibrariesServiceTest method testBuildEmptyLibraryFail.

/**
 * Tests create empty library.
 *
 * @throws CreateLibraryException
 */
@Test(expected = CreateLibraryException.class)
public void testBuildEmptyLibraryFail() throws CreateLibraryException {
    when(librariesClient.createLibrary(any(Library.class))).thenReturn(null);
    new GalaxyLibrariesService(librariesClient, 1, 2, 1).buildEmptyLibrary(new GalaxyProjectName("test"));
}
Also used : Library(com.github.jmchilton.blend4j.galaxy.beans.Library) GalaxyProjectName(ca.corefacility.bioinformatics.irida.model.upload.galaxy.GalaxyProjectName) GalaxyLibrariesService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyLibrariesService) Test(org.junit.Test)

Aggregations

GalaxyLibrariesService (ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyLibrariesService)7 Before (org.junit.Before)4 GalaxyHistoriesService (ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyHistoriesService)3 Library (com.github.jmchilton.blend4j.galaxy.beans.Library)3 Test (org.junit.Test)3 GalaxyProjectName (ca.corefacility.bioinformatics.irida.model.upload.galaxy.GalaxyProjectName)2 HistoriesClient (com.github.jmchilton.blend4j.galaxy.HistoriesClient)2 LibrariesClient (com.github.jmchilton.blend4j.galaxy.LibrariesClient)2 ToolsClient (com.github.jmchilton.blend4j.galaxy.ToolsClient)2 SequenceFile (ca.corefacility.bioinformatics.irida.model.sequenceFile.SequenceFile)1 SingleEndSequenceFile (ca.corefacility.bioinformatics.irida.model.sequenceFile.SingleEndSequenceFile)1 GalaxyWorkflowService (ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyWorkflowService)1 GalaxyInstance (com.github.jmchilton.blend4j.galaxy.GalaxyInstance)1 Path (java.nio.file.Path)1