use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AnalysisSubmissionSampleProcessorImplIT method testUpdateFailPermissionNonSampleOwner.
@Test(expected = AccessDeniedException.class)
@WithMockUser(username = "fbristow", roles = "USER")
public void testUpdateFailPermissionNonSampleOwner() throws PostProcessingException {
AnalysisSubmission a = analysisSubmissionRepository.findOne(2L);
analysisSubmissionSampleProcessorImpl.updateSamples(a);
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AnalysisSubmissionSampleProcessorImplIT method testUpdateSamplesSuccess.
@Test
@WithMockUser(username = "fbristow", roles = "USER")
public void testUpdateSamplesSuccess() throws PostProcessingException {
AnalysisSubmission a = analysisSubmissionRepository.findOne(1L);
assertEquals("Should be no join between sample and assembly", 0, sampleGenomeAssemblyJoinRepository.count());
analysisSubmissionSampleProcessorImpl.updateSamples(a);
assertEquals("Should exist a join between sample and assembly", 1, sampleGenomeAssemblyJoinRepository.count());
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AnalysisSubmissionSampleProcessorImplIT method testUpdateFailPermissionNonProjectOwner.
@Test(expected = AccessDeniedException.class)
@WithMockUser(username = "dr-evil", roles = "USER")
public void testUpdateFailPermissionNonProjectOwner() throws PostProcessingException {
AnalysisSubmission a = analysisSubmissionRepository.findOne(2L);
analysisSubmissionSampleProcessorImpl.updateSamples(a);
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AssemblySampleUpdaterIT method testUpdateFailMultipleSamples.
@Test(expected = IllegalArgumentException.class)
@WithMockUser(username = "fbristow", roles = "USER")
public void testUpdateFailMultipleSamples() {
AnalysisSubmission a = analysisSubmissionRepository.findOne(1L);
Sample s1 = sampleRepository.findOne(1L);
Sample s2 = sampleRepository.findOne(2L);
assemblySampleUpdater.update(Sets.newHashSet(s1, s2), a);
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class RESTAnalysisSubmissionController method getAnalysisOutputFileContents.
/**
* Get the actual file contents for an analysis output file.
*
* @param submissionId
* The {@link AnalysisSubmission} id
* @param fileType
* The {@link AnalysisOutputFile} type as defined in the
* {@link Analysis} subclass
* @return a {@link FileSystemResource} containing the contents of the
* {@link AnalysisOutputFile}.
*/
@RequestMapping(value = "/{submissionId}/analysis/file/{fileType}", produces = MediaType.TEXT_PLAIN_VALUE)
@ResponseBody
public FileSystemResource getAnalysisOutputFileContents(@PathVariable Long submissionId, @PathVariable String fileType) {
AnalysisSubmission read = analysisSubmissionService.read(submissionId);
if (read.getAnalysisState() != AnalysisState.COMPLETED) {
throw new EntityNotFoundException("Analysis is not completed");
}
AnalysisOutputFile analysisOutputFile = read.getAnalysis().getAnalysisOutputFile(fileType);
return new FileSystemResource(analysisOutputFile.getFile().toFile());
}
Aggregations