use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class GalaxyJobErrorsServiceIT method testSuccessfulAnalysisReturnsNoJobErrors.
/**
* Test that a successfully completed Galaxy workflow analysis does not return any {@link JobError}s
*/
@Test
@WithMockUser(username = "aaron", roles = "ADMIN")
public void testSuccessfulAnalysisReturnsNoJobErrors() throws Exception {
databaseSetupGalaxyITService.setupSubmissionInDatabase(1L, sequenceFilePath, referenceFilePath, validIridaWorkflowId, false);
AnalysisSubmission submission = runAnalysis();
List<JobError> errors = galaxyJobErrorsService.createNewJobErrors(submission);
assertTrue(errors.isEmpty());
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AnalysisSubmissionRepositoryIT method testCreateAnalysisSingleAndPairedAndReference.
/**
* Tests creating an analysis with both single and paired files and a
* reference genome.
*/
@Test
@WithMockUser(username = "aaron", roles = "ADMIN")
public void testCreateAnalysisSingleAndPairedAndReference() {
Set<SequencingObject> inputs = Sets.newHashSet(sequenceFilePair, singleEndFile);
AnalysisSubmission analysisSubmissionPaired = AnalysisSubmission.builder(workflowId).name("submission paired 1").inputFiles(inputs).referenceFile(referenceFile).build();
analysisSubmissionPaired.setSubmitter(submitter1);
AnalysisSubmission savedSubmission = analysisSubmissionRepository.save(analysisSubmissionPaired);
Set<SequencingObject> inputsSaved = objectRepository.findSequencingObjectsForAnalysisSubmission(savedSubmission);
assertTrue("should have single end file in collection", inputsSaved.contains(singleEndFile));
assertTrue("should have pair file in collection", inputsSaved.contains(sequenceFilePair));
assertEquals(referenceFile, savedSubmission.getReferenceFile().get());
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AnalysisSubmissionRepositoryIT method testCreateAnalysisNoSubmitterFail.
/**
* Tests creating an analysis with no set submitter and failing.
*/
@Test(expected = DataIntegrityViolationException.class)
@WithMockUser(username = "aaron", roles = "ADMIN")
public void testCreateAnalysisNoSubmitterFail() {
AnalysisSubmission analysisSubmissionPaired = AnalysisSubmission.builder(workflowId).name("submission paired 1").inputFiles(Sets.newHashSet(sequenceFilePair)).build();
analysisSubmissionRepository.save(analysisSubmissionPaired);
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class SampleRepositoryIT method testFindSamplesForAnalysisSubmissionSingleSample.
@Test
@WithMockUser(username = "fbristow", roles = "ADMIN")
public void testFindSamplesForAnalysisSubmissionSingleSample() {
AnalysisSubmission a = analysisSubmissionRepository.findOne(10L);
Set<Sample> samples = sampleRepository.findSamplesForAnalysisSubmission(a);
assertEquals("Sample ids are equal", Sets.newHashSet(11L), samples.stream().map(Sample::getId).collect(Collectors.toSet()));
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AnalysisExecutionServiceGalaxyIT method testPrepareSubmissionFailInvalidGalaxyWorkflowFile.
/**
* Tests out attempting to prepare a workflow with an invalid Galaxy
* workflow file.
*
* @throws Throwable
*/
@Test(expected = WorkflowUploadException.class)
@WithMockUser(username = "aaron", roles = "ADMIN")
public void testPrepareSubmissionFailInvalidGalaxyWorkflowFile() throws Throwable {
AnalysisSubmission analysisSubmission = analysisExecutionGalaxyITService.setupSubmissionInDatabase(1L, sequenceFilePath, referenceFilePath, iridaWorkflowIdInvalidWorkflowFile, AnalysisState.NEW, false);
Future<AnalysisSubmission> analysisSubmissionFuture = analysisExecutionService.prepareSubmission(analysisSubmission);
try {
analysisSubmissionFuture.get();
} catch (ExecutionException e) {
logger.debug("Submission on exception=" + analysisSubmissionService.read(analysisSubmission.getId()));
assertEquals(AnalysisState.ERROR, analysisSubmissionService.read(analysisSubmission.getId()).getAnalysisState());
// pull out real exception
throw e.getCause();
}
}
Aggregations