-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
987 additions
and
464 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
42 changes: 42 additions & 0 deletions
42
peppol-commons/src/test/java/com/helger/peppol/supplementary/tools/RegExFuncTest.java
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,42 @@ | ||
package com.helger.peppol.supplementary.tools; | ||
|
||
import static org.junit.Assert.assertFalse; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
import java.util.function.Predicate; | ||
import java.util.regex.Pattern; | ||
|
||
import org.junit.Test; | ||
|
||
import com.helger.commons.regex.RegExHelper; | ||
|
||
public class RegExFuncTest | ||
{ | ||
@Test | ||
public void testRegExSPIS () | ||
{ | ||
final String sRegEx = "[0-9]{6}(-[0-9A-Z_]{3,12}(\\.[0-9A-Z\\-\\._~]{3,24})?)?"; | ||
|
||
final Predicate <String> pred = x -> RegExHelper.stringMatchesPattern (sRegEx, Pattern.CASE_INSENSITIVE, x); | ||
|
||
assertTrue (pred.test ("000001")); | ||
assertTrue (pred.test ("000270")); | ||
assertTrue (pred.test ("010101")); | ||
assertTrue (pred.test ("999999")); | ||
assertFalse (pred.test ("99999")); | ||
assertFalse (pred.test ("a99999")); | ||
assertFalse (pred.test ("9999999")); | ||
|
||
assertTrue (pred.test ("000001-AAA")); | ||
assertTrue (pred.test ("000001-Rprtng_MLS")); | ||
assertTrue (pred.test ("000270-1234567")); | ||
assertFalse (pred.test ("000270.12")); | ||
assertFalse (pred.test ("000270.1234567")); | ||
assertFalse (pred.test ("0002701234567")); | ||
assertFalse (pred.test ("000270--1234567")); | ||
|
||
assertTrue (pred.test ("000001-MLS.001")); | ||
assertTrue (pred.test ("000001-001.1234567")); | ||
assertTrue (pred.test ("000270-Rprtng_MLS.Japan.123")); | ||
} | ||
} |
459 changes: 459 additions & 0 deletions
459
...client/src/main/java/com/helger/smpclient/peppol/ISMPExtendedServiceMetadataProvider.java
Large diffs are not rendered by default.
Oops, something went wrong.
391 changes: 0 additions & 391 deletions
391
peppol-smp-client/src/main/java/com/helger/smpclient/peppol/ISMPServiceMetadataProvider.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
Oops, something went wrong.