-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LDEV-4692 test case for pdf protect / removePassword
- Loading branch information
Showing
2 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
#Build Number for ANT. Do not edit! | ||
#Fri Sep 08 09:45:49 CEST 2023 | ||
build.number=7 | ||
#Thu Sep 14 09:02:27 CEST 2023 | ||
build.number=8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
component extends="org.lucee.cfml.test.LuceeTestCase" labels="pdf" { | ||
|
||
function beforeAll() { | ||
|
||
variables.testPdf = getTempFile( getTempDirectory(), "ldev4692", "pdf" ); | ||
variables.testCode = createUniqueID(); | ||
variables.password = createUniqueID(); | ||
|
||
document fileName="#testPdf#" overwrite="true" { | ||
writeoutput(" test pdf file [#variables.testCode#]" ); | ||
} | ||
} | ||
|
||
function run( testResults , testBox ) { | ||
describe( "testcase for LDEV-3048", function() { | ||
|
||
it( title="cfpdf check password routines, protect, removePassword", body=function( currentSpec ) { | ||
|
||
pdf action="extractText" source="#testPdf#" name="local.extractedText"; | ||
expect( extractedText ).toInclude( testCode ); | ||
|
||
pdf action="protect" source="#testPdf#" destination="#testPdf#" newUserPassword="#variables.password#" overwrite="true"; | ||
pdf action="extractText" source="#testPdf#" name="local.extractedText" password="#variables.password#"; | ||
expect( extractedText ).toInclude( testCode ); | ||
|
||
pdf action="removePassword" source="#testPdf#" destination="#testPdf#" password="#variables.password#" overwrite="true"; | ||
pdf action="extractText" source="#testPdf#" name="local.extractedText"; | ||
expect( extractedText ).toInclude( testCode ); | ||
|
||
}); | ||
|
||
}); | ||
} | ||
|
||
function afterAll(){ | ||
if ( fileExists( variables.testPdf ) ) | ||
fileDelete( variables.testPdf ); | ||
}; | ||
} |