From 676d3e645e18c4033cd83cc2820d7f103c71039d Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Wed, 23 Jun 2021 09:04:51 +0200 Subject: added test for umlaute --- .../pdfas/lib/test/mains/SignatureBlockParameterTest.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pdf-as-lib/src/test/java/at/gv/egiz/pdfas/lib/test/mains/SignatureBlockParameterTest.java b/pdf-as-lib/src/test/java/at/gv/egiz/pdfas/lib/test/mains/SignatureBlockParameterTest.java index 3c76ce11..62d5beaf 100644 --- a/pdf-as-lib/src/test/java/at/gv/egiz/pdfas/lib/test/mains/SignatureBlockParameterTest.java +++ b/pdf-as-lib/src/test/java/at/gv/egiz/pdfas/lib/test/mains/SignatureBlockParameterTest.java @@ -1,5 +1,6 @@ package at.gv.egiz.pdfas.lib.test.mains; +import at.gv.egiz.pdfas.common.settings.DefaultSignatureProfileSettings; import at.gv.egiz.pdfas.common.utils.CheckSignatureBlockParameters; import org.junit.Test; import org.junit.runner.RunWith; @@ -44,7 +45,18 @@ public class SignatureBlockParameterTest { if(checkValid("aaa"+(char) 13 +"aa", "^([\\p{Print}]){1,100}$") == true){assert(false);} } - + @Test + public void testUmlauteValid() { + if(checkValid( "ä", DefaultSignatureProfileSettings.SIG_BLOCK_PARAMETER_DEFAULT_VALUE_REGEX) == false){assert(false);} + if(checkValid( "ö", DefaultSignatureProfileSettings.SIG_BLOCK_PARAMETER_DEFAULT_VALUE_REGEX) == false){assert(false);} + if(checkValid( "ü", DefaultSignatureProfileSettings.SIG_BLOCK_PARAMETER_DEFAULT_VALUE_REGEX) == false){assert(false);} + if(checkValid( "Ä", DefaultSignatureProfileSettings.SIG_BLOCK_PARAMETER_DEFAULT_VALUE_REGEX) == false){assert(false);} + if(checkValid( "Ö", DefaultSignatureProfileSettings.SIG_BLOCK_PARAMETER_DEFAULT_VALUE_REGEX) == false){assert(false);} + if(checkValid( "Ü", DefaultSignatureProfileSettings.SIG_BLOCK_PARAMETER_DEFAULT_VALUE_REGEX) == false){assert(false);} + if(checkValid( "ÄÖÜöäüjhsbdjej", DefaultSignatureProfileSettings.SIG_BLOCK_PARAMETER_DEFAULT_VALUE_REGEX) == false){assert(false);} + if(checkValid( "aauacnhuisdc Ä Ü Ö aaxsa ö aÜaÖa", + DefaultSignatureProfileSettings.SIG_BLOCK_PARAMETER_DEFAULT_VALUE_REGEX) == false){assert(false);} + } public boolean checkValid(String s, String regex) { return CheckSignatureBlockParameters.isValid(s, regex); } -- cgit v1.2.3