diff --git a/CLI/Metadata/StaticXmpCoreContainers/5-t01-fail-a.pdf b/CLI/Metadata/StaticXmpCoreContainers/5-t01-fail-a.pdf new file mode 100644 index 0000000..6b20af5 Binary files /dev/null and b/CLI/Metadata/StaticXmpCoreContainers/5-t01-fail-a.pdf differ diff --git a/CLI/Metadata/StaticXmpCoreContainers/5-t01-pass-a.pdf b/CLI/Metadata/StaticXmpCoreContainers/5-t01-pass-a.pdf new file mode 100644 index 0000000..b347623 Binary files /dev/null and b/CLI/Metadata/StaticXmpCoreContainers/5-t01-pass-a.pdf differ diff --git a/CLI/Metadata/StaticXmpCoreContainers/staticXmpCoreContainers.bats b/CLI/Metadata/StaticXmpCoreContainers/staticXmpCoreContainers.bats new file mode 100644 index 0000000..eaf1898 --- /dev/null +++ b/CLI/Metadata/StaticXmpCoreContainers/staticXmpCoreContainers.bats @@ -0,0 +1,32 @@ +#!/usr/bin/env bats +bats_require_minimum_version 1.5.0 + +setup() { + PROJECT_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/../../.." >/dev/null 2>&1 && pwd)" + load "$PROJECT_ROOT/tools/test_helper/common-setup.bash" + _common_setup + + cp -r $BATS_TEST_DIRNAME/* $BATS_TEST_TMPDIR +} + +teardown() { + echo -e "Done ... \n" >&3 +} + +@test 'StaticXmpCoreContainers check. XMPException: Unregistered schema namespace URI' { + + run --separate-stderr -- verapdf/verapdf $BATS_TEST_TMPDIR/5-t01-fail-a.pdf $BATS_TEST_TMPDIR/5-t01-pass-a.pdf --fixmetadata --flavour ua1 --loglevel 4 + [ "$status" -eq 1 ] + run echo $stderr + assert_output --partial "org.verapdf.xmp.XMPException: Unregistered schema namespace URI" + fineObtainPresent=$(echo $stderr | grep -w -o "FINE: Can not obtain identification fields" | wc -l) #Count the number of lines + assert_equal $fineObtainPresent "1" + + run --separate-stderr -- verapdf/verapdf $BATS_TEST_TMPDIR/5-t01-fail-a.pdf --fixmetadata --flavour ua1 --loglevel 4 + [ "$status" -eq 1 ] + run echo $stderr + assert_output --partial "org.verapdf.xmp.XMPException: Unregistered schema namespace URI" + fineObtainPresent=$(echo $stderr | grep -w -o "FINE: Can not obtain identification fields" | wc -l) #Count the number of lines + assert_equal $fineObtainPresent "1" + +}