branch feature/3762 created (now f1712e9)
This is an automated email from the git hooks/post-receive script. New change to branch feature/3762 in repository eugene. See http://git.nuiton.org/eugene.git at f1712e9 Be able to detect complex tag value (See #3762) This branch includes the following new commits: new f1712e9 Be able to detect complex tag value (See #3762) The 1 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit f1712e981a1691e02bb0d25ee13a827de2eab392 Author: Tony CHEMIT <chemit@codelutin.com> Date: Fri Aug 21 15:10:38 2015 +0200 Be able to detect complex tag value (See #3762) -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/3762 in repository eugene. See http://git.nuiton.org/eugene.git commit f1712e981a1691e02bb0d25ee13a827de2eab392 Author: Tony CHEMIT <chemit@codelutin.com> Date: Fri Aug 21 15:10:38 2015 +0200 Be able to detect complex tag value (See #3762) --- .../org/nuiton/eugene/models/tagvalue/TagValues.java | 8 ++++---- .../nuiton/eugene/models/tagvalue/TagValuesTest.java | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/eugene/src/main/java/org/nuiton/eugene/models/tagvalue/TagValues.java b/eugene/src/main/java/org/nuiton/eugene/models/tagvalue/TagValues.java index dde2457..3331c62 100644 --- a/eugene/src/main/java/org/nuiton/eugene/models/tagvalue/TagValues.java +++ b/eugene/src/main/java/org/nuiton/eugene/models/tagvalue/TagValues.java @@ -53,22 +53,22 @@ public class TagValues { * fr.isisfish.entities.Population.operation.getRegion.stereotype=... * fr.isisfish.entities.Population.operation.getRegion.tagvalue.pk=... */ - protected static final Pattern TAG_VALUE_PATTERN = Pattern - .compile("^((?:[_a-zA-Z0-9]+\\.)+(?:_?[A-Z][_a-zA-Z0-9]*\\.)+)(?:(class|attribute|operation))\\.(?:([_a-zA-Z0-9]+)\\.)?(?:(tagvalue|tagValue)?)\\.([_a-z0-9][_a-zA-Z0-9]*)?$"); + protected static final Pattern TAG_VALUE_PATTERN = + Pattern.compile("^((?:[_a-zA-Z0-9]+\\.)+(?:_?[A-Z][_a-zA-Z0-9]*\\.)+)(?:(class|attribute|operation))\\.(?:([_a-zA-Z0-9]+)\\.)?(?:(tagvalue|tagValue)?)\\.((?:[_a-zA-Z0-9]+)+(?:\\._?[A-Z][_a-zA-Z0-9]*)*)?$"); /** * Pattern to define tag values authorized at model level in the model * properties file. */ protected static final Pattern MODEL_TAG_VALUE_PATTERN = Pattern.compile( - "^model\\.(?:(tagvalue|tagValue)?)\\.((?:.+))$"); + "^model\\.(?:(tagvalue|tagValue)?)\\.((?:[_a-zA-Z0-9]+)+(?:\\._?[A-Z][_a-zA-Z0-9]*)*)$"); /** * Pattern to define tag values authorized at model level in the model * properties file. */ protected static final Pattern PACKAGE_TAG_VALUE_PATTERN = Pattern.compile( - "^package\\.((?:[_a-zA-Z0-9]+\\.)+)(?:(tagvalue|tagValue)?)\\.((?:.+))$"); + "^package\\.((?:[_a-zA-Z0-9]+\\.)+)(?:(tagvalue|tagValue)?)\\.((?:[_a-zA-Z0-9]+)+(?:\\._?[A-Z][_a-zA-Z0-9]*)*)$"); public static Matcher getModelMatcher(String key) throws InvalidTagValueSyntaxException { Matcher matcher = MODEL_TAG_VALUE_PATTERN.matcher(key); diff --git a/eugene/src/test/java/org/nuiton/eugene/models/tagvalue/TagValuesTest.java b/eugene/src/test/java/org/nuiton/eugene/models/tagvalue/TagValuesTest.java index 300b958..d422547 100644 --- a/eugene/src/test/java/org/nuiton/eugene/models/tagvalue/TagValuesTest.java +++ b/eugene/src/test/java/org/nuiton/eugene/models/tagvalue/TagValuesTest.java @@ -34,4 +34,22 @@ public class TagValuesTest { Assert.assertEquals(defaultValue, value); } + @Test + public void testGetModelMatcher() throws Exception { + TagValues.getModelMatcher("model.tagValue.hibernateAttributeType.String"); + TagValues.getModelMatcher("model.tagValue.hibernateAttributeType"); + } + + @Test + public void testPackageModelMatcher() throws Exception { + TagValues.getPackageMatcher("package.fr.ird.observe.tagValue.hibernateAttributeType.String"); + TagValues.getPackageMatcher("package.fr.ird.observe.tagValue.hibernateAttributeType"); + } + + @Test + public void testGetMatcher() throws Exception { + TagValues.getMatcher("fr.ird.observe.entities.CommentableEntity.attribute.comment.tagValue.hibernateAttributeType.String"); + TagValues.getMatcher("fr.ird.observe.entities.CommentableEntity.attribute.comment.tagValue.hibernateAttributeType"); + } + } -- To stop receiving notification emails like this one, please contact nuiton.org SCM administrator <admin+scm@nuiton.org>.
participants (1)
-
nuiton.org scm