Bladeren bron

cleanup, attempt to fix test

Sebastian Stenzel 9 jaren geleden
bovenliggende
commit
578f52f4ba

+ 0 - 11
main/filesystem-crypto/src/main/java/org/cryptomator/crypto/engine/impl/FifoParallelDataProcessor.java

@@ -68,15 +68,4 @@ class FifoParallelDataProcessor<T> {
 		return processedData.take().get();
 	}
 
-	/**
-	 * Stops work in progress immediatley.
-	 */
-	@Deprecated
-	void cancelAllPendingJobs() {
-		Future<T> job;
-		while ((job = processedData.poll()) != null) {
-			job.cancel(true);
-		}
-	}
-
 }

+ 2 - 3
main/filesystem-crypto/src/test/java/org/cryptomator/crypto/engine/impl/FileContentDecryptorImplTest.java

@@ -60,7 +60,7 @@ public class FileContentDecryptorImplTest {
 		}
 	}
 
-	@Test
+	@Test(timeout = 2000)
 	public void testPartialDecryption() throws InterruptedException {
 		final byte[] keyBytes = new byte[32];
 		final SecretKey encryptionKey = new SecretKeySpec(keyBytes, "AES");
@@ -90,10 +90,9 @@ public class FileContentDecryptorImplTest {
 		for (int i = 3; i >= 0; i--) {
 			int ciphertextPos = (int) cryptor.toCiphertextPos(i * 32768);
 			try (FileContentDecryptor decryptor = cryptor.createFileContentDecryptor(header, ciphertextPos)) {
-				ByteBuffer intBuf = ByteBuffer.allocate(32768);
-				intBuf.clear();
 				ciphertext.position(ciphertextPos);
 				decryptor.append(ciphertext);
+				decryptor.append(FileContentCryptor.EOF);
 				ByteBuffer decrypted = decryptor.cleartext();
 				Assert.assertEquals(i, decrypted.getInt());
 			}