[
https://issues.apache.org/jira/browse/PDFBOX-2456?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14187569#comment-14187569
]
Tilman Hausherr commented on PDFBOX-2456:
-----------------------------------------
re the workspace problem, why doesn't the method we use not work for you? I.e.
in the directory structure, by using something like
NAMEOFCLASS.class.getResourceAsStream(filename). Such a file is then found in
pdfbox\src\test\resources\PACKAGE-NAME, like this:
pdfbox\src\test\resources\org\apache\pdfbox\encryption for a class in the
org.apache.pdfbox.encryption package.
re testing: the best would probably be to compare all strings and streams, but
I don't know if the sequence is kept when saving. The 2nd best solution would
be to render the file before and after and compare it the two images, I can do
this if you don't want to bother with it. It would be good that the test PDF
has several elements, e.g. some text and an image. But this isn't required at
the beginning. I could also do this, i.e. create a PDF on the fly later.
- There is a file "test.pdf" - what is it?
- you don't have to call setUp each time
- don't use /tmp, instead use a subdirectory in "target". Look at
LosslessFactoryTest.java to see what I mean
- Andreas may want to request you to sign a CLA
IMHO the purpose of tests here are
- to prove that it works at all
- to prevent that it breaks in refactoring
- to detect whether it breaks with new library versions
- to prove that error cases are handled correctly
So yes, tests are always welcome :-)
> create TestSymmetricKeyEncryption.java
> --------------------------------------
>
> Key: PDFBOX-2456
> URL: https://issues.apache.org/jira/browse/PDFBOX-2456
> Project: PDFBox
> Issue Type: Improvement
> Components: Utilities
> Affects Versions: 2.0.0
> Environment: java7 debian7
> Reporter: Ralf Hauser
> Fix For: 2.0.0
>
> Attachments: TestSymmetricKeyEncryption.java,
> enc128bit_20141025_115145.pdf, enc256bit_20141025_105451.pdf,
> preEnc_20141025_105451.pdf, preEnc_20141025_115145.pdf
>
>
> similarly to org.apache.pdfbox.encryption.TestPublicKeyEncryption, also test
> password based encryption
> 1) 128bit
> 2) 256bit AES PDFBOX-1594
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)