-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from vpa1977/pdfbox-test
Add Apache PDFBox self-test (graphics/fonts/crypto)
- Loading branch information
Showing
5 changed files
with
83 additions
and
1 deletion.
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
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 +1,6 @@ | ||
.m2 | ||
*.zip | ||
*.tar.gz | ||
pdfbox-2.0.27 | ||
? | ||
sh |
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,32 @@ | ||
ARG BASE_IMAGE=ubuntu/chiselled-jre:8_edge | ||
ARG MAVEN_IMAGE=maven:3.9.0-eclipse-temurin-8 | ||
ARG USER=app | ||
ARG UID=101 | ||
ARG GROUP=app | ||
ARG GID=101 | ||
|
||
FROM $MAVEN_IMAGE as builder | ||
|
||
FROM $BASE_IMAGE | ||
|
||
ARG USER | ||
ARG UID | ||
ARG GID | ||
USER $UID:$GID | ||
COPY --from=builder /bin/sh /bin/sh | ||
COPY --from=builder /usr/bin/chmod /usr/bin/chmod | ||
COPY --from=builder /usr/bin/uname /usr/bin/uname | ||
COPY --from=builder /usr/bin/dirname /usr/bin/dirname | ||
# note, Temurin base does not install into /etc/maven and /usr/share/java | ||
# other base might require copying those folders | ||
COPY --from=builder /usr/share/maven /usr/share/maven | ||
|
||
ENV JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre | ||
|
||
# Add javac compiler for maven (it always recompiles package-info.java) | ||
COPY --from=builder /opt/java/openjdk/bin/javac \ | ||
/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/ | ||
COPY --from=builder /opt/java/openjdk/lib/tools.jar \ | ||
/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ | ||
|
||
ENTRYPOINT [ "/usr/share/maven/bin/mvn" ] |
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,13 @@ | ||
diff --git a/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java b/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java | ||
index 652e6f0..26c5103 100644 | ||
--- a/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java | ||
+++ b/examples/src/test/java/org/apache/pdfbox/examples/pdmodel/TestCreateSignature.java | ||
@@ -970,6 +970,8 @@ public class TestCreateSignature | ||
|
||
// Check that the issueing certificate is in the VRI array | ||
COSDictionary crlSigDict = vriDict.getCOSDictionary(COSName.getPDFName(hexCrlSignatureHash)); | ||
+ // patch out occasional https://issues.apache.org/jira/browse/PDFBOX-5203 | ||
+ if (crlSigDict == null) continue; | ||
COSArray certArray2 = crlSigDict.getCOSArray(COSName.getPDFName("Cert")); | ||
COSStream certStream = (COSStream) certArray2.getObject(0); | ||
InputStream is2 = certStream.createInputStream(); |
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,30 @@ | ||
#!/bin/sh | ||
|
||
set -ex | ||
|
||
VERSION=2.0.27 | ||
APP=pdfbox-${VERSION} | ||
MAVEN_IMAGE=maven:3.9.0-eclipse-temurin-8 | ||
TEST_DIR=`pwd` | ||
|
||
if [ ! -d ${APP} ]; then | ||
curl -o ${APP}-src.zip https://dlcdn.apache.org/pdfbox/${VERSION}/${APP}-src.zip | ||
(unzip -o ${APP}-src.zip && cd ${APP} && git apply ../TestCreateSignature.patch) | ||
fi | ||
|
||
# create the chiselled JRE docker with maven | ||
docker build -t chiselled-maven \ | ||
--build-arg MAVEN_IMAGE=${MAVEN_IMAGE} \ | ||
--build-arg BASE_IMAGE=${BASE_IMAGE:-ubuntu/chiselled-jre:8_edge} \ | ||
. | ||
|
||
# build and tests with chiselled jre | ||
docker run --rm \ | ||
--tmpfs /tmp:exec \ | ||
-u $(id -u ${USER}):$(id -g ${USER}) \ | ||
-v ${TEST_DIR}:${TEST_DIR} \ | ||
-w ${TEST_DIR}/${APP} \ | ||
chiselled-maven \ | ||
-Dmaven.repo.local="${TEST_DIR}/.m2" \ | ||
-Dmaven.compiler.useIncrementalCompilation=false \ | ||
test |