Browse Source

added test

Sebastian Stenzel 9 năm trước cách đây
mục cha
commit
a388acfce4

+ 13 - 0
main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/FifoParallelDataProcessorTest.java

@@ -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);