Search in sources :

Example 6 with FileProcessingChain

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);
}
Also used : DefaultFileProcessingChain(ca.corefacility.bioinformatics.irida.processing.impl.DefaultFileProcessingChain) FileProcessingChain(ca.corefacility.bioinformatics.irida.processing.FileProcessingChain) DefaultFileProcessingChain(ca.corefacility.bioinformatics.irida.processing.impl.DefaultFileProcessingChain) Test(org.junit.Test)

Example 7 with FileProcessingChain

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());
}
Also used : FileProcessorException(ca.corefacility.bioinformatics.irida.processing.FileProcessorException) DefaultFileProcessingChain(ca.corefacility.bioinformatics.irida.processing.impl.DefaultFileProcessingChain) QCEntry(ca.corefacility.bioinformatics.irida.model.sample.QCEntry) FileProcessingChain(ca.corefacility.bioinformatics.irida.processing.FileProcessingChain) DefaultFileProcessingChain(ca.corefacility.bioinformatics.irida.processing.impl.DefaultFileProcessingChain) Test(org.junit.Test)

Example 8 with FileProcessingChain

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);
}
Also used : DefaultFileProcessingChain(ca.corefacility.bioinformatics.irida.processing.impl.DefaultFileProcessingChain) FileProcessingChain(ca.corefacility.bioinformatics.irida.processing.FileProcessingChain) DefaultFileProcessingChain(ca.corefacility.bioinformatics.irida.processing.impl.DefaultFileProcessingChain) Test(org.junit.Test)

Aggregations

FileProcessingChain (ca.corefacility.bioinformatics.irida.processing.FileProcessingChain)8 DefaultFileProcessingChain (ca.corefacility.bioinformatics.irida.processing.impl.DefaultFileProcessingChain)6 Test (org.junit.Test)6 FileProcessorException (ca.corefacility.bioinformatics.irida.processing.FileProcessorException)3 FileProcessorTimeoutException (ca.corefacility.bioinformatics.irida.exceptions.FileProcessorTimeoutException)2 SequencingObjectRepository (ca.corefacility.bioinformatics.irida.repositories.sequencefile.SequencingObjectRepository)2 FileProcessorErrorQCEntry (ca.corefacility.bioinformatics.irida.model.sample.FileProcessorErrorQCEntry)1 QCEntry (ca.corefacility.bioinformatics.irida.model.sample.QCEntry)1 SequenceFile (ca.corefacility.bioinformatics.irida.model.sequenceFile.SequenceFile)1 SequencingObject (ca.corefacility.bioinformatics.irida.model.sequenceFile.SequencingObject)1 FileProcessor (ca.corefacility.bioinformatics.irida.processing.FileProcessor)1 SampleSequencingObjectJoinRepository (ca.corefacility.bioinformatics.irida.repositories.joins.sample.SampleSequencingObjectJoinRepository)1 QCEntryRepository (ca.corefacility.bioinformatics.irida.repositories.sample.QCEntryRepository)1 SequenceConcatenationRepository (ca.corefacility.bioinformatics.irida.repositories.sequencefile.SequenceConcatenationRepository)1 SequenceFileRepository (ca.corefacility.bioinformatics.irida.repositories.sequencefile.SequenceFileRepository)1 SequencingObjectServiceImpl (ca.corefacility.bioinformatics.irida.service.impl.SequencingObjectServiceImpl)1 Files (java.nio.file.Files)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 List (java.util.List)1