added test

This commit is contained in:
Sebastian Stenzel
2016-01-01 12:50:25 +01:00
parent 64dec64e95
commit a388acfce4

View File

@@ -16,6 +16,19 @@ import org.junit.Test;
public class FifoParallelDataProcessorTest {
@Test(expected = IllegalStateException.class)
public void testRethrowsException() throws InterruptedException {
FifoParallelDataProcessor<Object> processor = new FifoParallelDataProcessor<>(1, 1);
try {
processor.submit(() -> {
throw new IllegalStateException("will be rethrown during 'processedData()'");
});
} catch (Exception e) {
Assert.fail("Exception must not yet be thrown.");
}
processor.processedData();
}
@Test
public void testStrictFifoOrder() throws InterruptedException {
FifoParallelDataProcessor<Integer> processor = new FifoParallelDataProcessor<>(4, 10);