use of ca.corefacility.bioinformatics.irida.processing.impl.DefaultFileProcessingChain in project irida by phac-nml.
the class DefaultFileProcessingChainTest method testFastFailProcessorChain.
@Test(expected = FileProcessorException.class)
public void testFastFailProcessorChain() throws FileProcessorTimeoutException {
FileProcessingChain fileProcessingChain = new DefaultFileProcessingChain(objectRepository, qcRepository, new FailingFileProcessor());
when(objectRepository.exists(objectId)).thenReturn(true);
fileProcessingChain.setFastFail(true);
fileProcessingChain.launchChain(1L);
fail("should not proceed when encountering exception and fastFail is enabled.");
}
use of ca.corefacility.bioinformatics.irida.processing.impl.DefaultFileProcessingChain in project irida by phac-nml.
the class DefaultFileProcessingChainTest method testFailWithContinueChain.
@Test
public void testFailWithContinueChain() throws FileProcessorTimeoutException {
FileProcessingChain fileProcessingChain = new DefaultFileProcessingChain(objectRepository, qcRepository, new FailingFileProcessor());
when(objectRepository.exists(objectId)).thenReturn(true);
List<Exception> exceptions = fileProcessingChain.launchChain(1L);
// exceptions should be ignored in this test
assertEquals("exactly one exception should have been ignored.", 1, exceptions.size());
assertTrue("ignored exception should be of type FileProcessorException.", exceptions.iterator().next() instanceof FileProcessorException);
}
use of ca.corefacility.bioinformatics.irida.processing.impl.DefaultFileProcessingChain in project irida by phac-nml.
the class DefaultFileProcessingChainTest method testExceedsTimeout.
@Test(expected = FileProcessorTimeoutException.class)
public void testExceedsTimeout() throws FileProcessorTimeoutException {
FileProcessingChain fileProcessingChain = new DefaultFileProcessingChain(objectRepository, qcRepository);
fileProcessingChain.setTimeout(1);
fileProcessingChain.setSleepDuration(0);
fileProcessingChain.launchChain(objectId);
}
use of ca.corefacility.bioinformatics.irida.processing.impl.DefaultFileProcessingChain 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.impl.DefaultFileProcessingChain 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());
}
Aggregations