This is an automated email from the ASF dual-hosted git repository.

mawiesne pushed a commit to branch opennlp-2.x
in repository https://gitbox.apache.org/repos/asf/opennlp.git


The following commit(s) were added to refs/heads/opennlp-2.x by this push:
     new b896fc73 [2.x]: OPENNLP-1775: Update Uimaj to 3.6.1 (#866)
b896fc73 is described below

commit b896fc73de4ca04732c7a730b84d94f1f6e3892e
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
AuthorDate: Mon Oct 6 11:44:17 2025 +0200

    [2.x]: OPENNLP-1775: Update Uimaj to 3.6.1 (#866)
    
    * [2.x]: Bump org.apache.uima:uimaj-core from 3.6.0 to 3.6.1
    
    Bumps org.apache.uima:uimaj-core from 3.6.0 to 3.6.1.
    
    ---
    updated-dependencies:
    - dependency-name: org.apache.uima:uimaj-core
      dependency-version: 3.6.1
      dependency-type: direct:production
      update-type: version-update:semver-patch
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    
    * OPENNLP-1775: Update Uimaj to 3.6.1
    - fixes DictionaryResourceTest xml config to work with latest UimaJ release
    
    ---------
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] 
<49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Martin Wiesner <[email protected]>
---
 .../src/test/java/opennlp/uima/AbstractUimaTest.java       | 14 ++++++++++----
 .../opennlp/uima/dictionary/DictionaryResourceTest.java    | 12 ++++++++----
 .../resources/test-descriptors/DictionaryNameFinder.xml    |  2 +-
 pom.xml                                                    |  2 +-
 4 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/opennlp-uima/src/test/java/opennlp/uima/AbstractUimaTest.java 
b/opennlp-uima/src/test/java/opennlp/uima/AbstractUimaTest.java
index 709a7f81..ad05b717 100644
--- a/opennlp-uima/src/test/java/opennlp/uima/AbstractUimaTest.java
+++ b/opennlp-uima/src/test/java/opennlp/uima/AbstractUimaTest.java
@@ -60,13 +60,19 @@ public abstract class AbstractUimaTest extends AbstractTest 
{
     for (ExternalResourceDescription modelDesc : resources) {
       ResourceSpecifier resourceSpec = modelDesc.getResourceSpecifier();
       String genericValue = 
resourceSpec.getAttributeValue(FILE_URL).toString();
-      String modelName = genericValue.split(":")[1]; // always right of 
'file:' -> idx 1
+      final boolean isDictionary = genericValue.endsWith(".dic");
+      String resourceName;
+      if (genericValue != null && !isDictionary) {
+        resourceName = genericValue.split(":")[1]; // always right of 'file:' 
-> idx 1
+      } else {
+        resourceName = genericValue;
+      }
       try {
-        if ("dictionary.dic".equals(modelName)) {
-          URL fileURL = Paths.get(TARGET_DIR, modelName).toUri().toURL();
+        if (isDictionary) {
+          URL fileURL = Paths.get(TARGET_DIR, resourceName).toUri().toURL();
           resourceSpec.setAttributeValue(FILE_URL, fileURL.toExternalForm());
         } else {
-          URL modelURL = OPENNLP_DIR.resolve(modelName).toUri().toURL();
+          URL modelURL = OPENNLP_DIR.resolve(resourceName).toUri().toURL();
           resourceSpec.setAttributeValue(FILE_URL, modelURL.toExternalForm());
         }
       } catch (MalformedURLException e) {
diff --git 
a/opennlp-uima/src/test/java/opennlp/uima/dictionary/DictionaryResourceTest.java
 
b/opennlp-uima/src/test/java/opennlp/uima/dictionary/DictionaryResourceTest.java
index 846e8c67..66f92e7c 100644
--- 
a/opennlp-uima/src/test/java/opennlp/uima/dictionary/DictionaryResourceTest.java
+++ 
b/opennlp-uima/src/test/java/opennlp/uima/dictionary/DictionaryResourceTest.java
@@ -43,6 +43,8 @@ import opennlp.tools.util.StringList;
 import opennlp.uima.AbstractTest;
 import opennlp.uima.util.CasUtil;
 
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+
 public class DictionaryResourceTest extends AbstractTest {
 
   private static AnalysisEngine AE;
@@ -54,15 +56,17 @@ public class DictionaryResourceTest extends AbstractTest {
 
   @AfterAll
   public static void afterClass() {
-    AE.destroy(); // is this necessary?
+    if (AE != null) {
+      AE.destroy(); // is this necessary?
+    }
   }
 
   private static AnalysisEngine produceAE(String descName)
       throws IOException, InvalidXMLException, ResourceInitializationException 
{
     File descFile = new File(PATH_DESCRIPTORS + "/" + descName);
     XMLInputSource in = new XMLInputSource(descFile);
-    ResourceSpecifier specifier = UIMAFramework.getXMLParser()
-        .parseResourceSpecifier(in);
+    ResourceSpecifier specifier = 
UIMAFramework.getXMLParser().parseResourceSpecifier(in);
+    assertNotNull(specifier);
     return UIMAFramework.produceAnalysisEngine(specifier);
   }
 
@@ -73,7 +77,7 @@ public class DictionaryResourceTest extends AbstractTest {
       final DictionaryResource dic = (DictionaryResource) 
AE.getResourceManager()
               .getResource("/opennlp.uima.Dictionary");
       final Dictionary d = dic.getDictionary();
-      Assertions.assertNotNull(d);
+      assertNotNull(d);
       Assertions.assertEquals(6, d.asStringSet().size(),
               "There should be six entries in the dictionary");
       Assertions.assertTrue(d.contains(new StringList("London")),
diff --git 
a/opennlp-uima/src/test/resources/test-descriptors/DictionaryNameFinder.xml 
b/opennlp-uima/src/test/resources/test-descriptors/DictionaryNameFinder.xml
index a4c91067..d0701700 100644
--- a/opennlp-uima/src/test/resources/test-descriptors/DictionaryNameFinder.xml
+++ b/opennlp-uima/src/test/resources/test-descriptors/DictionaryNameFinder.xml
@@ -108,7 +108,7 @@
                 <name>NameFinderDictionary</name>
                 <description/>
                 <fileResourceSpecifier>
-                    <fileUrl>file:dictionary.dic</fileUrl>
+                    <fileUrl>dictionary.dic</fileUrl>
                 </fileResourceSpecifier>
                 
<implementationName>opennlp.uima.dictionary.DictionaryResourceImpl</implementationName>
             </externalResource>
diff --git a/pom.xml b/pom.xml
index 05cecbca..8524afed 100644
--- a/pom.xml
+++ b/pom.xml
@@ -183,7 +183,7 @@
                <!-- Dependency versions -->
                <junit.version>6.0.0</junit.version>
                <junit5-system-exit.version>2.0.2</junit5-system-exit.version>
-               <uimaj.version>3.6.0</uimaj.version>
+               <uimaj.version>3.6.1</uimaj.version>
                <morfologik.version>2.1.9</morfologik.version>
                <onnxruntime.version>1.23.0</onnxruntime.version>
                <slf4j.version>2.0.17</slf4j.version>

Reply via email to