use of ca.corefacility.bioinformatics.irida.processing.FileProcessingChain in project irida by phac-nml.
the class DefaultFileProcessingChainTest method testProcessEmptyChain.
@Test
public void testProcessEmptyChain() throws FileProcessorTimeoutException {
FileProcessingChain fileProcessingChain = new DefaultFileProcessingChain(objectRepository, qcRepository);
when(objectRepository.exists(objectId)).thenReturn(true);
fileProcessingChain.launchChain(objectId);
}
use of ca.corefacility.bioinformatics.irida.processing.FileProcessingChain in project irida by phac-nml.
the class DefaultFileProcessingChainTest method testFailWriteQCEntry.
@Test
public void testFailWriteQCEntry() throws FileProcessorTimeoutException {
FileProcessingChain fileProcessingChain = new DefaultFileProcessingChain(objectRepository, qcRepository, new FailingFileProcessorNoContinue());
when(objectRepository.exists(objectId)).thenReturn(true);
boolean exceptionCaught = false;
try {
fileProcessingChain.launchChain(1L);
} catch (FileProcessorException e) {
exceptionCaught = true;
}
assertTrue("File process should have thrown exception", exceptionCaught);
ArgumentCaptor<QCEntry> captor = ArgumentCaptor.forClass(QCEntry.class);
verify(qcRepository).save(captor.capture());
QCEntry qcEntry = captor.getValue();
assertEquals("should have saved qc entry for sample", seqObject, qcEntry.getSequencingObject());
}
use of ca.corefacility.bioinformatics.irida.processing.FileProcessingChain in project irida by phac-nml.
the class DefaultFileProcessingChainTest method testFailOnProcessorChain.
@Test(expected = FileProcessorException.class)
public void testFailOnProcessorChain() throws FileProcessorTimeoutException {
FileProcessingChain fileProcessingChain = new DefaultFileProcessingChain(objectRepository, qcRepository, new FailingFileProcessorNoContinue());
when(objectRepository.exists(objectId)).thenReturn(true);
fileProcessingChain.launchChain(1L);
}
Aggregations