You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2020/09/05 16:07:20 UTC
svn commit: r1881496 - in
/pdfbox/branches/issue45/pdfbox/src/test/java/org/apache/pdfbox:
cos/TestCOSString.java encryption/TestSymmetricKeyEncryption.java
Author: tilman
Date: Sat Sep 5 16:07:19 2020
New Revision: 1881496
URL: http://svn.apache.org/viewvc?rev=1881496&view=rev
Log:
PDFBOX-4892: SonarQube fix
Modified:
pdfbox/branches/issue45/pdfbox/src/test/java/org/apache/pdfbox/cos/TestCOSString.java
pdfbox/branches/issue45/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestSymmetricKeyEncryption.java
Modified: pdfbox/branches/issue45/pdfbox/src/test/java/org/apache/pdfbox/cos/TestCOSString.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/pdfbox/src/test/java/org/apache/pdfbox/cos/TestCOSString.java?rev=1881496&r1=1881495&r2=1881496&view=diff
==============================================================================
--- pdfbox/branches/issue45/pdfbox/src/test/java/org/apache/pdfbox/cos/TestCOSString.java (original)
+++ pdfbox/branches/issue45/pdfbox/src/test/java/org/apache/pdfbox/cos/TestCOSString.java Sat Sep 5 16:07:19 2020
@@ -216,7 +216,7 @@ public class TestCOSString extends TestC
{
String theString = "\u4e16";
COSString string = new COSString(theString);
- assertTrue(string.getString().equals(theString));
+ Assert.assertEquals(string.getString(), theString);
String textAscii = "This is some regular text. It should all be expressible in ASCII";
/** En français où les choses sont accentués. En español, asà */
Modified: pdfbox/branches/issue45/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestSymmetricKeyEncryption.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestSymmetricKeyEncryption.java?rev=1881496&r1=1881495&r2=1881496&view=diff
==============================================================================
--- pdfbox/branches/issue45/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestSymmetricKeyEncryption.java (original)
+++ pdfbox/branches/issue45/pdfbox/src/test/java/org/apache/pdfbox/encryption/TestSymmetricKeyEncryption.java Sat Sep 5 16:07:19 2020
@@ -372,9 +372,9 @@ public class TestSymmetricKeyEncryption
doc.save(pdfFile);
doc.close();
long sizeEncrypted = pdfFile.length();
- Assert.assertTrue(keyLength
+ Assert.assertNotEquals(keyLength
+ "-bit " + (preferAES ? "AES" : "RC4") + " encrypted pdf should not have same size as plain one",
- sizeEncrypted != sizePriorToEncr);
+ sizeEncrypted, sizePriorToEncr);
// test with owner password => full permissions
PDDocument encryptedDoc = PDDocument.load(pdfFile, ownerpassword);