use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AnalysisSubmissionServiceImplIT method testRemoveAnalysisSubmissionFromProject.
@Test
@WithMockUser(username = "aaron", roles = "USER")
public void testRemoveAnalysisSubmissionFromProject() {
AnalysisSubmission read = analysisSubmissionService.read(3L);
Project project2 = projectService.read(1L);
analysisSubmissionService.removeAnalysisProjectShare(read, project2);
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AnalysisSubmissionServiceImplIT method testCreateSubmissionWithUnsavedNamedParameters.
@Test(expected = UnsupportedOperationException.class)
@WithMockUser(username = "aaron", roles = "ADMIN")
public void testCreateSubmissionWithUnsavedNamedParameters() {
final SingleEndSequenceFile sequencingObject = (SingleEndSequenceFile) sequencingObjectRepository.findOne(1L);
final IridaWorkflowNamedParameters params = new IridaWorkflowNamedParameters("named parameters.", workflowId, ImmutableMap.of("named", "parameter"));
final AnalysisSubmission submission = AnalysisSubmission.builder(workflowId).inputFiles(Sets.newHashSet(sequencingObject)).withNamedParameters(params).build();
analysisSubmissionService.create(submission);
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AnalysisSubmissionServiceImplIT method searchAnalyses.
@Test
@WithMockUser(username = "aaron", roles = "ADMIN")
public void searchAnalyses() {
Page<AnalysisSubmission> paged = analysisSubmissionService.listAllSubmissions(null, null, null, null, new PageRequest(0, 10, new Sort(Direction.ASC, "createdDate")));
assertEquals(10, paged.getContent().size());
// Try filtering a by names
String name = "My";
paged = analysisSubmissionService.listAllSubmissions(null, name, null, null, new PageRequest(0, 10, new Sort(Direction.ASC, "createdDate")));
assertEquals(8, paged.getContent().size());
// Add a state filter
AnalysisState state = AnalysisState.COMPLETED;
paged = analysisSubmissionService.listAllSubmissions(null, name, state, null, new PageRequest(0, 10, new Sort(Direction.ASC, "createdDate")));
assertEquals(2, paged.getContent().size());
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AnalysisSubmissionServiceImplIT method testGetAnalysisSubmissionsForUserAsAdminUser.
/**
* Tests getting a set of submissions as an admin user for a different user.
*/
@Test
@WithMockUser(username = "otheraaron", roles = "ADMIN")
public void testGetAnalysisSubmissionsForUserAsAdminUser() {
User user = userRepository.findOne(1L);
Set<AnalysisSubmission> submissions = analysisSubmissionService.getAnalysisSubmissionsForUser(user);
assertNotNull("should get submissions for the user", submissions);
assertEquals("submissions should have correct number", 9, submissions.size());
}
use of ca.corefacility.bioinformatics.irida.model.workflow.submission.AnalysisSubmission in project irida by phac-nml.
the class AnalysisSubmissionServiceImplIT method testCreateSubmissionWithNamedParameters.
@Test
@WithMockUser(username = "aaron", roles = "ADMIN")
public void testCreateSubmissionWithNamedParameters() {
final SingleEndSequenceFile sequencingObject = (SingleEndSequenceFile) sequencingObjectRepository.findOne(1L);
final IridaWorkflowNamedParameters params = parametersRepository.findOne(1L);
final AnalysisSubmission submission = AnalysisSubmission.builder(workflowId).inputFiles(Sets.newHashSet(sequencingObject)).withNamedParameters(params).build();
analysisSubmissionService.create(submission);
assertNotNull("Should have saved and created an id for the submission", submission.getId());
assertNotNull("Submission should have a map of parameters", submission.getInputParameters());
assertEquals("Submission parameters should be the same as the named parameters", params.getInputParameters(), submission.getInputParameters());
}
Aggregations